Commit 9910824e authored by Steven Cole's avatar Steven Cole Committed by David S. Miller

[PATCH] More ANSI C cleanup of zlib

More zlib K&R to ANSI C function header conversions.
parent 022c22ef
...@@ -316,8 +316,9 @@ int inflateReset( ...@@ -316,8 +316,9 @@ int inflateReset(
} }
int inflateEnd(z) int inflateEnd(
z_stream *z; z_stream *z
)
{ {
uLong c; uLong c;
...@@ -332,9 +333,10 @@ z_stream *z; ...@@ -332,9 +333,10 @@ z_stream *z;
} }
int inflateInit2(z, w) int inflateInit2(
z_stream *z; z_stream *z,
int w; int w
)
{ {
/* initialize state */ /* initialize state */
if (z == Z_NULL) if (z == Z_NULL)
...@@ -378,8 +380,9 @@ int w; ...@@ -378,8 +380,9 @@ int w;
} }
int inflateInit(z) int inflateInit(
z_stream *z; z_stream *z
)
{ {
return inflateInit2(z, DEF_WBITS); return inflateInit2(z, DEF_WBITS);
} }
...@@ -1128,8 +1131,9 @@ local int inflate_addhistory( ...@@ -1128,8 +1131,9 @@ local int inflate_addhistory(
* At the end of a Deflate-compressed PPP packet, we expect to have seen * At the end of a Deflate-compressed PPP packet, we expect to have seen
* a `stored' block type value but not the (zero) length bytes. * a `stored' block type value but not the (zero) length bytes.
*/ */
local int inflate_packet_flush(s) local int inflate_packet_flush(
inflate_blocks_statef *s; inflate_blocks_statef *s
)
{ {
if (s->mode != LENS) if (s->mode != LENS)
return Z_DATA_ERROR; return Z_DATA_ERROR;
...@@ -1592,9 +1596,10 @@ local int inflate_trees_fixed( ...@@ -1592,9 +1596,10 @@ local int inflate_trees_fixed(
} }
local int inflate_trees_free(t, z) local int inflate_trees_free(
inflate_huft *t; /* table to free */ inflate_huft *t, /* table to free */
z_stream *z; /* for zfree function */ z_stream *z /* for zfree function */
)
/* Free the malloc'ed tables built by huft_build(), which makes a linked /* Free the malloc'ed tables built by huft_build(), which makes a linked
list of the tables it made, with the links in a dummy first entry of list of the tables it made, with the links in a dummy first entry of
each table. */ each table. */
......
...@@ -339,8 +339,9 @@ int inflateReset( ...@@ -339,8 +339,9 @@ int inflateReset(
} }
int inflateEnd(z) int inflateEnd(
z_stream *z; z_stream *z
)
{ {
uLong c; uLong c;
...@@ -355,9 +356,10 @@ z_stream *z; ...@@ -355,9 +356,10 @@ z_stream *z;
} }
int inflateInit2(z, w) int inflateInit2(
z_stream *z; z_stream *z,
int w; int w
)
{ {
/* initialize state */ /* initialize state */
if (z == Z_NULL) if (z == Z_NULL)
...@@ -401,8 +403,9 @@ int w; ...@@ -401,8 +403,9 @@ int w;
} }
int inflateInit(z) int inflateInit(
z_stream *z; z_stream *z
)
{ {
return inflateInit2(z, DEF_WBITS); return inflateInit2(z, DEF_WBITS);
} }
...@@ -1151,8 +1154,9 @@ local int inflate_addhistory( ...@@ -1151,8 +1154,9 @@ local int inflate_addhistory(
* At the end of a Deflate-compressed PPP packet, we expect to have seen * At the end of a Deflate-compressed PPP packet, we expect to have seen
* a `stored' block type value but not the (zero) length bytes. * a `stored' block type value but not the (zero) length bytes.
*/ */
local int inflate_packet_flush(s) local int inflate_packet_flush(
inflate_blocks_statef *s; inflate_blocks_statef *s
)
{ {
if (s->mode != LENS) if (s->mode != LENS)
return Z_DATA_ERROR; return Z_DATA_ERROR;
...@@ -1615,9 +1619,10 @@ local int inflate_trees_fixed( ...@@ -1615,9 +1619,10 @@ local int inflate_trees_fixed(
} }
local int inflate_trees_free(t, z) local int inflate_trees_free(
inflate_huft *t; /* table to free */ inflate_huft *t, /* table to free */
z_stream *z; /* for zfree function */ z_stream *z /* for zfree function */
)
/* Free the malloc'ed tables built by huft_build(), which makes a linked /* Free the malloc'ed tables built by huft_build(), which makes a linked
list of the tables it made, with the links in a dummy first entry of list of the tables it made, with the links in a dummy first entry of
each table. */ each table. */
......
...@@ -255,10 +255,11 @@ int zlib_deflateInit2_( ...@@ -255,10 +255,11 @@ int zlib_deflateInit2_(
} }
/* ========================================================================= */ /* ========================================================================= */
int zlib_deflateSetDictionary (strm, dictionary, dictLength) int zlib_deflateSetDictionary(
z_streamp strm; z_streamp strm,
const Bytef *dictionary; const Bytef *dictionary,
uInt dictLength; uInt dictLength
)
{ {
deflate_state *s; deflate_state *s;
uInt length = dictLength; uInt length = dictLength;
...@@ -298,8 +299,9 @@ int zlib_deflateSetDictionary (strm, dictionary, dictLength) ...@@ -298,8 +299,9 @@ int zlib_deflateSetDictionary (strm, dictionary, dictLength)
} }
/* ========================================================================= */ /* ========================================================================= */
int zlib_deflateReset (strm) int zlib_deflateReset(
z_streamp strm; z_streamp strm
)
{ {
deflate_state *s; deflate_state *s;
...@@ -328,10 +330,11 @@ int zlib_deflateReset (strm) ...@@ -328,10 +330,11 @@ int zlib_deflateReset (strm)
} }
/* ========================================================================= */ /* ========================================================================= */
int zlib_deflateParams(strm, level, strategy) int zlib_deflateParams(
z_streamp strm; z_streamp strm,
int level; int level,
int strategy; int strategy
)
{ {
deflate_state *s; deflate_state *s;
compress_func func; compress_func func;
...@@ -405,9 +408,10 @@ local void flush_pending(strm) ...@@ -405,9 +408,10 @@ local void flush_pending(strm)
} }
/* ========================================================================= */ /* ========================================================================= */
int zlib_deflate (strm, flush) int zlib_deflate(
z_streamp strm; z_streamp strm,
int flush; int flush
)
{ {
int old_flush; /* value of flush param for previous deflate call */ int old_flush; /* value of flush param for previous deflate call */
deflate_state *s; deflate_state *s;
...@@ -542,8 +546,9 @@ int zlib_deflate (strm, flush) ...@@ -542,8 +546,9 @@ int zlib_deflate (strm, flush)
} }
/* ========================================================================= */ /* ========================================================================= */
int zlib_deflateEnd (strm) int zlib_deflateEnd(
z_streamp strm; z_streamp strm
)
{ {
int status; int status;
deflate_state *s; deflate_state *s;
...@@ -565,9 +570,10 @@ int zlib_deflateEnd (strm) ...@@ -565,9 +570,10 @@ int zlib_deflateEnd (strm)
/* ========================================================================= /* =========================================================================
* Copy the source state to the destination state. * Copy the source state to the destination state.
*/ */
int zlib_deflateCopy (dest, source) int zlib_deflateCopy (
z_streamp dest; z_streamp dest,
z_streamp source; z_streamp source
)
{ {
#ifdef MAXSEG_64K #ifdef MAXSEG_64K
return Z_STREAM_ERROR; return Z_STREAM_ERROR;
...@@ -624,10 +630,11 @@ int zlib_deflateCopy (dest, source) ...@@ -624,10 +630,11 @@ int zlib_deflateCopy (dest, source)
* allocating a large strm->next_in buffer and copying from it. * allocating a large strm->next_in buffer and copying from it.
* (See also flush_pending()). * (See also flush_pending()).
*/ */
local int read_buf(strm, buf, size) local int read_buf(
z_streamp strm; z_streamp strm,
Bytef *buf; Bytef *buf,
unsigned size; unsigned size
)
{ {
unsigned len = strm->avail_in; unsigned len = strm->avail_in;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment