Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 851250 Details for
Bug 894598
sys-libs/zlib: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
zlib-1.2.13-clang16.patch
zlib-1.2.13-clang16.patch (text/plain), 53.18 KB, created by
Peter Levine
on 2023-02-15 15:37:11 UTC
(
hide
)
Description:
zlib-1.2.13-clang16.patch
Filename:
MIME Type:
Creator:
Peter Levine
Created:
2023-02-15 15:37:11 UTC
Size:
53.18 KB
patch
obsolete
>diff -Naur a/adler32.c b/adler32.c >--- a/adler32.c 2017-01-01 02:37:10.000000000 -0500 >+++ b/adler32.c 2023-02-15 01:02:24.200172486 -0500 >@@ -60,10 +60,7 @@ > #endif > > /* ========================================================================= */ >-uLong ZEXPORT adler32_z(adler, buf, len) >- uLong adler; >- const Bytef *buf; >- z_size_t len; >+uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) > { > unsigned long sum2; > unsigned n; >@@ -131,19 +128,13 @@ > } > > /* ========================================================================= */ >-uLong ZEXPORT adler32(adler, buf, len) >- uLong adler; >- const Bytef *buf; >- uInt len; >+uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) > { > return adler32_z(adler, buf, len); > } > > /* ========================================================================= */ >-local uLong adler32_combine_(adler1, adler2, len2) >- uLong adler1; >- uLong adler2; >- z_off64_t len2; >+local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) > { > unsigned long sum1; > unsigned long sum2; >@@ -169,18 +160,12 @@ > } > > /* ========================================================================= */ >-uLong ZEXPORT adler32_combine(adler1, adler2, len2) >- uLong adler1; >- uLong adler2; >- z_off_t len2; >+uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) > { > return adler32_combine_(adler1, adler2, len2); > } > >-uLong ZEXPORT adler32_combine64(adler1, adler2, len2) >- uLong adler1; >- uLong adler2; >- z_off64_t len2; >+uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) > { > return adler32_combine_(adler1, adler2, len2); > } >diff -Naur a/contrib/minizip/ioapi.c b/contrib/minizip/ioapi.c >--- a/contrib/minizip/ioapi.c 2022-10-06 23:43:18.000000000 -0400 >+++ b/contrib/minizip/ioapi.c 2023-02-15 01:14:41.163494387 -0500 >@@ -231,8 +231,7 @@ > return ret; > } > >-void fill_fopen_filefunc (pzlib_filefunc_def) >- zlib_filefunc_def* pzlib_filefunc_def; >+void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def) > { > pzlib_filefunc_def->zopen_file = fopen_file_func; > pzlib_filefunc_def->zread_file = fread_file_func; >diff -Naur a/crc32.c b/crc32.c >--- a/crc32.c 2022-10-06 23:43:18.000000000 -0400 >+++ b/crc32.c 2023-02-15 01:11:01.348472242 -0500 >@@ -123,8 +123,7 @@ > instruction, if one is available. This assumes that word_t is either 32 bits > or 64 bits. > */ >-local z_word_t byte_swap(word) >- z_word_t word; >+local z_word_t byte_swap(z_word_t word) > { > # if W == 8 > return >@@ -223,8 +222,7 @@ > /* Test and set. Alas, not atomic, but tries to minimize the period of > vulnerability. */ > local int test_and_set OF((int volatile *)); >-local int test_and_set(flag) >- int volatile *flag; >+local int test_and_set(int volatile *flag) > { > int was; > >@@ -234,9 +232,7 @@ > } > > /* Run the provided init() function once. This is not thread-safe. */ >-local void once(state, init) >- once_t *state; >- void (*init)(void); >+local void once(once_t *state, void (*init)(void)) > { > if (!state->done) { > if (test_and_set(&state->begun)) >@@ -447,10 +443,7 @@ > Write the 32-bit values in table[0..k-1] to out, five per line in > hexadecimal separated by commas. > */ >-local void write_table(out, table, k) >- FILE *out; >- const z_crc_t FAR *table; >- int k; >+local void write_table(FILE *out, const z_crc_t FAR *table, int k) > { > int n; > >@@ -464,10 +457,7 @@ > Write the high 32-bits of each value in table[0..k-1] to out, five per line > in hexadecimal separated by commas. > */ >-local void write_table32hi(out, table, k) >-FILE *out; >-const z_word_t FAR *table; >-int k; >+local void write_table32hi(FILE *out, const z_word_t FAR *table, int k) > { > int n; > >@@ -484,10 +474,7 @@ > bits. If not, then the type cast and format string can be adjusted > accordingly. > */ >-local void write_table64(out, table, k) >- FILE *out; >- const z_word_t FAR *table; >- int k; >+local void write_table64(FILE *out, const z_word_t FAR *table, int k) > { > int n; > >@@ -511,11 +498,7 @@ > Generate the little and big-endian braid tables for the given n and z_word_t > size w. Each array must have room for w blocks of 256 elements. > */ >-local void braid(ltl, big, n, w) >- z_crc_t ltl[][256]; >- z_word_t big[][256]; >- int n; >- int w; >+local void braid(z_crc_t ltl[][256],z_word_t big[][256], int n, int w) > { > int k; > z_crc_t i, p, q; >@@ -548,9 +531,7 @@ > Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial, > reflected. For speed, this requires that a not be zero. > */ >-local z_crc_t multmodp(a, b) >- z_crc_t a; >- z_crc_t b; >+local z_crc_t multmodp(z_crc_t a, z_crc_t b) > { > z_crc_t m, p; > >@@ -572,9 +553,7 @@ > Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been > initialized. > */ >-local z_crc_t x2nmodp(n, k) >- z_off64_t n; >- unsigned k; >+local z_crc_t x2nmodp(z_off64_t n, unsigned k) > { > z_crc_t p; > >@@ -619,10 +598,9 @@ > #define Z_BATCH_ZEROS 0xa10d3d0c /* computed from Z_BATCH = 3990 */ > #define Z_BATCH_MIN 800 /* fewest words in a final batch */ > >-unsigned long ZEXPORT crc32_z(crc, buf, len) >- unsigned long crc; >- const unsigned char FAR *buf; >- z_size_t len; >+unsigned long ZEXPORT crc32_z(unsigned long crc, >+ const unsigned char FAR *buf, >+ z_size_t len) > { > z_crc_t val; > z_word_t crc1, crc2; >@@ -723,8 +701,7 @@ > least-significant byte of the word as the first byte of data, without any pre > or post conditioning. This is used to combine the CRCs of each braid. > */ >-local z_crc_t crc_word(data) >- z_word_t data; >+local z_crc_t crc_word(z_word_t data) > { > int k; > for (k = 0; k < W; k++) >@@ -732,8 +709,7 @@ > return (z_crc_t)data; > } > >-local z_word_t crc_word_big(data) >- z_word_t data; >+local z_word_t crc_word_big(z_word_t data) > { > int k; > for (k = 0; k < W; k++) >@@ -745,10 +721,8 @@ > #endif > > /* ========================================================================= */ >-unsigned long ZEXPORT crc32_z(crc, buf, len) >- unsigned long crc; >- const unsigned char FAR *buf; >- z_size_t len; >+unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf, >+ z_size_t len) > { > /* Return initial CRC, if requested. */ > if (buf == Z_NULL) return 0; >@@ -1069,19 +1043,14 @@ > #endif > > /* ========================================================================= */ >-unsigned long ZEXPORT crc32(crc, buf, len) >- unsigned long crc; >- const unsigned char FAR *buf; >- uInt len; >+unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, >+ uInt len) > { > return crc32_z(crc, buf, len); > } > > /* ========================================================================= */ >-uLong ZEXPORT crc32_combine64(crc1, crc2, len2) >- uLong crc1; >- uLong crc2; >- z_off64_t len2; >+uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) > { > #ifdef DYNAMIC_CRC_TABLE > once(&made, make_crc_table); >@@ -1090,17 +1059,13 @@ > } > > /* ========================================================================= */ >-uLong ZEXPORT crc32_combine(crc1, crc2, len2) >- uLong crc1; >- uLong crc2; >- z_off_t len2; >+uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2) > { > return crc32_combine64(crc1, crc2, (z_off64_t)len2); > } > > /* ========================================================================= */ >-uLong ZEXPORT crc32_combine_gen64(len2) >- z_off64_t len2; >+uLong ZEXPORT crc32_combine_gen64(z_off64_t len2) > { > #ifdef DYNAMIC_CRC_TABLE > once(&made, make_crc_table); >@@ -1109,17 +1074,13 @@ > } > > /* ========================================================================= */ >-uLong ZEXPORT crc32_combine_gen(len2) >- z_off_t len2; >+uLong ZEXPORT crc32_combine_gen(z_off_t len2) > { > return crc32_combine_gen64((z_off64_t)len2); > } > > /* ========================================================================= */ >-uLong ZEXPORT crc32_combine_op(crc1, crc2, op) >- uLong crc1; >- uLong crc2; >- uLong op; >+uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op) > { > return multmodp(op, crc1) ^ (crc2 & 0xffffffff); > } >diff -Naur a/deflate.c b/deflate.c >--- a/deflate.c 2022-10-13 01:06:55.000000000 -0400 >+++ b/deflate.c 2023-02-15 01:02:24.201172477 -0500 >@@ -195,8 +195,7 @@ > * bit values at the expense of memory usage). We slide even when level == 0 to > * keep the hash table consistent if we switch back to level > 0 later. > */ >-local void slide_hash(s) >- deflate_state *s; >+local void slide_hash(deflate_state *s) > { > unsigned n, m; > Posf *p; >@@ -222,11 +221,7 @@ > } > > /* ========================================================================= */ >-int ZEXPORT deflateInit_(strm, level, version, stream_size) >- z_streamp strm; >- int level; >- const char *version; >- int stream_size; >+int ZEXPORT deflateInit_(z_streamp strm, int level, const char * version, int stream_size) > { > return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, > Z_DEFAULT_STRATEGY, version, stream_size); >@@ -234,16 +229,8 @@ > } > > /* ========================================================================= */ >-int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, >- version, stream_size) >- z_streamp strm; >- int level; >- int method; >- int windowBits; >- int memLevel; >- int strategy; >- const char *version; >- int stream_size; >+int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, >+ const char *version, int stream_size) > { > deflate_state *s; > int wrap = 1; >@@ -602,10 +589,7 @@ > } > > /* ========================================================================= */ >-int ZEXPORT deflateParams(strm, level, strategy) >- z_streamp strm; >- int level; >- int strategy; >+int ZEXPORT deflateParams(z_streamp strm, int level, int strategy) > { > deflate_state *s; > compress_func func; >@@ -651,12 +635,7 @@ > } > > /* ========================================================================= */ >-int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) >- z_streamp strm; >- int good_length; >- int max_lazy; >- int nice_length; >- int max_chain; >+int ZEXPORT deflateTune(z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain) > { > deflate_state *s; > >@@ -693,9 +672,7 @@ > * > * Shifts are used to approximate divisions, for speed. > */ >-uLong ZEXPORT deflateBound(strm, sourceLen) >- z_streamp strm; >- uLong sourceLen; >+uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) > { > deflate_state *s; > uLong fixedlen, storelen, wraplen; >@@ -779,8 +756,7 @@ > * applications may wish to modify it to avoid allocating a large > * strm->next_out buffer and copying into it. (See also read_buf()). > */ >-local void flush_pending(strm) >- z_streamp strm; >+local void flush_pending(z_streamp strm) > { > unsigned len; > deflate_state *s = strm->state; >@@ -1275,9 +1251,7 @@ > * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 > * OUT assertion: the match length is not greater than s->lookahead. > */ >-local uInt longest_match(s, cur_match) >- deflate_state *s; >- IPos cur_match; /* current match */ >+local uInt longest_match(deflate_state *s, IPos cur_match /* current match */) > { > unsigned chain_length = s->max_chain_length;/* max hash chain length */ > register Bytef *scan = s->window + s->strstart; /* current string */ >@@ -1426,9 +1400,7 @@ > /* --------------------------------------------------------------------------- > * Optimized version for FASTEST only > */ >-local uInt longest_match(s, cur_match) >- deflate_state *s; >- IPos cur_match; /* current match */ >+local uInt longest_match(deflate_state *s, IPos cur_match /* current match */) > { > register Bytef *scan = s->window + s->strstart; /* current string */ > register Bytef *match; /* matched string */ >@@ -1490,10 +1462,7 @@ > /* =========================================================================== > * Check that the match at match_start is indeed a match. > */ >-local void check_match(s, start, match, length) >- deflate_state *s; >- IPos start, match; >- int length; >+local void check_match(deflate_state *s, IPos start, IPos match, int length) > { > /* check that the match is indeed a match */ > if (zmemcmp(s->window + match, >@@ -1687,9 +1656,7 @@ > * copied. It is most efficient with large input and output buffers, which > * maximizes the opportunities to have a single copy from next_in to next_out. > */ >-local block_state deflate_stored(s, flush) >- deflate_state *s; >- int flush; >+local block_state deflate_stored(deflate_state *s, int flush) > { > /* Smallest worthy block size when not flushing or finishing. By default > * this is 32K. This can be as small as 507 bytes for memLevel == 1. For >@@ -1874,9 +1841,7 @@ > * new strings in the dictionary only for unmatched strings or for short > * matches. It is used only for the fast compression options. > */ >-local block_state deflate_fast(s, flush) >- deflate_state *s; >- int flush; >+local block_state deflate_fast(deflate_state *s, int flush) > { > IPos hash_head; /* head of the hash chain */ > int bflush; /* set if current block must be flushed */ >@@ -1976,9 +1941,7 @@ > * evaluation for matches: a match is finally adopted only if there is > * no better match at the next window position. > */ >-local block_state deflate_slow(s, flush) >- deflate_state *s; >- int flush; >+local block_state deflate_slow(deflate_state *s, int flush) > { > IPos hash_head; /* head of hash chain */ > int bflush; /* set if current block must be flushed */ >@@ -2107,9 +2070,7 @@ > * one. Do not maintain a hash table. (It will be regenerated if this run of > * deflate switches away from Z_RLE.) > */ >-local block_state deflate_rle(s, flush) >- deflate_state *s; >- int flush; >+local block_state deflate_rle(deflate_state *s, int flush) > { > int bflush; /* set if current block must be flushed */ > uInt prev; /* byte at distance one to match */ >@@ -2181,9 +2142,7 @@ > * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. > * (It will be regenerated if this run of deflate switches away from Huffman.) > */ >-local block_state deflate_huff(s, flush) >- deflate_state *s; >- int flush; >+local block_state deflate_huff(deflate_state *s, int flush) > { > int bflush; /* set if current block must be flushed */ > >diff -Naur a/gzclose.c b/gzclose.c >--- a/gzclose.c 2010-02-13 19:12:48.000000000 -0500 >+++ b/gzclose.c 2023-02-15 01:02:24.201172477 -0500 >@@ -8,8 +8,7 @@ > /* gzclose() is in a separate file so that it is linked in only if it is used. > That way the other gzclose functions can be used instead to avoid linking in > unneeded compression or decompression routines. */ >-int ZEXPORT gzclose(file) >- gzFile file; >+int ZEXPORT gzclose(gzFile file) > { > #ifndef NO_GZCOMPRESS > gz_statep state; >diff -Naur a/gzlib.c b/gzlib.c >--- a/gzlib.c 2022-10-05 18:17:52.000000000 -0400 >+++ b/gzlib.c 2023-02-15 01:02:24.202172467 -0500 >@@ -72,8 +72,7 @@ > #endif /* UNDER_CE */ > > /* Reset gzip file state */ >-local void gz_reset(state) >- gz_statep state; >+local void gz_reset(gz_statep state) > { > state->x.have = 0; /* no output data available */ > if (state->mode == GZ_READ) { /* for reading ... */ >@@ -90,10 +89,7 @@ > } > > /* Open a gzip file either by name or file descriptor. */ >-local gzFile gz_open(path, fd, mode) >- const void *path; >- int fd; >- const char *mode; >+local gzFile gz_open(const void *path, int fd, const char *mode) > { > gz_statep state; > z_size_t len; >@@ -269,25 +265,19 @@ > } > > /* -- see zlib.h -- */ >-gzFile ZEXPORT gzopen(path, mode) >- const char *path; >- const char *mode; >+gzFile ZEXPORT gzopen(const char *path, const char *mode) > { > return gz_open(path, -1, mode); > } > > /* -- see zlib.h -- */ >-gzFile ZEXPORT gzopen64(path, mode) >- const char *path; >- const char *mode; >+gzFile ZEXPORT gzopen64(const char *path, const char *mode) > { > return gz_open(path, -1, mode); > } > > /* -- see zlib.h -- */ >-gzFile ZEXPORT gzdopen(fd, mode) >- int fd; >- const char *mode; >+gzFile ZEXPORT gzdopen(int fd, const char *mode) > { > char *path; /* identifier for error messages */ > gzFile gz; >@@ -306,18 +296,14 @@ > > /* -- see zlib.h -- */ > #ifdef WIDECHAR >-gzFile ZEXPORT gzopen_w(path, mode) >- const wchar_t *path; >- const char *mode; >+gzFile ZEXPORT gzopen_w(const wchar_t *path, const char *mode) > { > return gz_open(path, -2, mode); > } > #endif > > /* -- see zlib.h -- */ >-int ZEXPORT gzbuffer(file, size) >- gzFile file; >- unsigned size; >+int ZEXPORT gzbuffer(gzFile file, unsigned size) > { > gz_statep state; > >@@ -342,8 +328,7 @@ > } > > /* -- see zlib.h -- */ >-int ZEXPORT gzrewind(file) >- gzFile file; >+int ZEXPORT gzrewind(gzFile file) > { > gz_statep state; > >@@ -365,10 +350,7 @@ > } > > /* -- see zlib.h -- */ >-z_off64_t ZEXPORT gzseek64(file, offset, whence) >- gzFile file; >- z_off64_t offset; >- int whence; >+z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence) > { > unsigned n; > z_off64_t ret; >@@ -442,10 +424,7 @@ > } > > /* -- see zlib.h -- */ >-z_off_t ZEXPORT gzseek(file, offset, whence) >- gzFile file; >- z_off_t offset; >- int whence; >+z_off_t ZEXPORT gzseek(gzFile file, z_off_t offset, int whence) > { > z_off64_t ret; > >@@ -454,8 +433,7 @@ > } > > /* -- see zlib.h -- */ >-z_off64_t ZEXPORT gztell64(file) >- gzFile file; >+z_off64_t ZEXPORT gztell64(gzFile file) > { > gz_statep state; > >@@ -471,8 +449,7 @@ > } > > /* -- see zlib.h -- */ >-z_off_t ZEXPORT gztell(file) >- gzFile file; >+z_off_t ZEXPORT gztell(gzFile file) > { > z_off64_t ret; > >@@ -481,8 +458,7 @@ > } > > /* -- see zlib.h -- */ >-z_off64_t ZEXPORT gzoffset64(file) >- gzFile file; >+z_off64_t ZEXPORT gzoffset64(gzFile file) > { > z_off64_t offset; > gz_statep state; >@@ -504,8 +480,7 @@ > } > > /* -- see zlib.h -- */ >-z_off_t ZEXPORT gzoffset(file) >- gzFile file; >+z_off_t ZEXPORT gzoffset(gzFile file) > { > z_off64_t ret; > >@@ -514,8 +489,7 @@ > } > > /* -- see zlib.h -- */ >-int ZEXPORT gzeof(file) >- gzFile file; >+int ZEXPORT gzeof(gzFile file) > { > gz_statep state; > >@@ -531,9 +505,7 @@ > } > > /* -- see zlib.h -- */ >-const char * ZEXPORT gzerror(file, errnum) >- gzFile file; >- int *errnum; >+const char * ZEXPORT gzerror(gzFile file, int *errnum) > { > gz_statep state; > >@@ -552,8 +524,7 @@ > } > > /* -- see zlib.h -- */ >-void ZEXPORT gzclearerr(file) >- gzFile file; >+void ZEXPORT gzclearerr(gzFile file) > { > gz_statep state; > >@@ -578,10 +549,7 @@ > memory). Simply save the error message as a static string. If there is an > allocation failure constructing the error message, then convert the error to > out of memory. */ >-void ZLIB_INTERNAL gz_error(state, err, msg) >- gz_statep state; >- int err; >- const char *msg; >+void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) > { > /* free previously allocated message and clear */ > if (state->msg != NULL) { >diff -Naur a/gzread.c b/gzread.c >--- a/gzread.c 2022-10-06 23:43:18.000000000 -0400 >+++ b/gzread.c 2023-02-15 01:02:24.202172467 -0500 >@@ -18,11 +18,8 @@ > state->fd, and update state->eof, state->err, and state->msg as appropriate. > This function needs to loop on read(), since read() is not guaranteed to > read the number of bytes requested, depending on the type of descriptor. */ >-local int gz_load(state, buf, len, have) >- gz_statep state; >- unsigned char *buf; >- unsigned len; >- unsigned *have; >+local int gz_load(gz_statep state, unsigned char *buf, >+ unsigned len, unsigned *have) > { > int ret; > unsigned get, max = ((unsigned)-1 >> 2) + 1; >@@ -53,8 +50,7 @@ > If strm->avail_in != 0, then the current data is moved to the beginning of > the input buffer, and then the remainder of the buffer is loaded with the > available data from the input file. */ >-local int gz_avail(state) >- gz_statep state; >+local int gz_avail(gz_statep state) > { > unsigned got; > z_streamp strm = &(state->strm); >@@ -88,8 +84,7 @@ > case, all further file reads will be directly to either the output buffer or > a user buffer. If decompressing, the inflate state will be initialized. > gz_look() will return 0 on success or -1 on failure. */ >-local int gz_look(state) >- gz_statep state; >+local int gz_look(gz_statep state) > { > z_streamp strm = &(state->strm); > >@@ -170,8 +165,7 @@ > data. If the gzip stream completes, state->how is reset to LOOK to look for > the next gzip stream or raw data, once state->x.have is depleted. Returns 0 > on success, -1 on failure. */ >-local int gz_decomp(state) >- gz_statep state; >+local int gz_decomp(gz_statep state) > { > int ret = Z_OK; > unsigned had; >@@ -224,8 +218,7 @@ > looked for to determine whether to copy or decompress. Returns -1 on error, > otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the > end of the input file has been reached and all data has been processed. */ >-local int gz_fetch(state) >- gz_statep state; >+local int gz_fetch(gz_statep state) > { > z_streamp strm = &(state->strm); > >@@ -254,9 +247,7 @@ > } > > /* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */ >-local int gz_skip(state, len) >- gz_statep state; >- z_off64_t len; >+local int gz_skip(gz_statep state, z_off64_t len) > { > unsigned n; > >@@ -289,10 +280,7 @@ > input. Return the number of bytes read. If zero is returned, either the > end of file was reached, or there was an error. state->err must be > consulted in that case to determine which. */ >-local z_size_t gz_read(state, buf, len) >- gz_statep state; >- voidp buf; >- z_size_t len; >+local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) > { > z_size_t got; > unsigned n; >@@ -370,10 +358,7 @@ > } > > /* -- see zlib.h -- */ >-int ZEXPORT gzread(file, buf, len) >- gzFile file; >- voidp buf; >- unsigned len; >+int ZEXPORT gzread(gzFile file, voidp buf, unsigned len) > { > gz_statep state; > >@@ -406,11 +391,8 @@ > } > > /* -- see zlib.h -- */ >-z_size_t ZEXPORT gzfread(buf, size, nitems, file) >- voidp buf; >- z_size_t size; >- z_size_t nitems; >- gzFile file; >+z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, >+ z_size_t nitems, gzFile file) > { > z_size_t len; > gz_statep state; >@@ -469,16 +451,13 @@ > return gz_read(state, buf, 1) < 1 ? -1 : buf[0]; > } > >-int ZEXPORT gzgetc_(file) >-gzFile file; >+int ZEXPORT gzgetc_(gzFile file) > { > return gzgetc(file); > } > > /* -- see zlib.h -- */ >-int ZEXPORT gzungetc(c, file) >- int c; >- gzFile file; >+int ZEXPORT gzungetc(int c, gzFile file) > { > gz_statep state; > >@@ -536,10 +515,7 @@ > } > > /* -- see zlib.h -- */ >-char * ZEXPORT gzgets(file, buf, len) >- gzFile file; >- char *buf; >- int len; >+char * ZEXPORT gzgets(gzFile file, char *buf, int len) > { > unsigned left, n; > char *str; >@@ -600,8 +576,7 @@ > } > > /* -- see zlib.h -- */ >-int ZEXPORT gzdirect(file) >- gzFile file; >+int ZEXPORT gzdirect(gzFile file) > { > gz_statep state; > >@@ -620,8 +595,7 @@ > } > > /* -- see zlib.h -- */ >-int ZEXPORT gzclose_r(file) >- gzFile file; >+int ZEXPORT gzclose_r(gzFile file) > { > int ret, err; > gz_statep state; >diff -Naur a/gzwrite.c b/gzwrite.c >--- a/gzwrite.c 2022-10-05 18:17:52.000000000 -0400 >+++ b/gzwrite.c 2023-02-15 01:02:24.202172467 -0500 >@@ -14,8 +14,7 @@ > /* Initialize state for writing a gzip file. Mark initialization by setting > state->size to non-zero. Return -1 on a memory allocation failure, or 0 on > success. */ >-local int gz_init(state) >- gz_statep state; >+local int gz_init(gz_statep state) > { > int ret; > z_streamp strm = &(state->strm); >@@ -70,9 +69,7 @@ > deflate() flush value. If flush is Z_FINISH, then the deflate() state is > reset to start a new gzip stream. If gz->direct is true, then simply write > to the output file without compressing, and ignore flush. */ >-local int gz_comp(state, flush) >- gz_statep state; >- int flush; >+local int gz_comp(gz_statep state, int flush) > { > int ret, writ; > unsigned have, put, max = ((unsigned)-1 >> 2) + 1; >@@ -151,9 +148,7 @@ > > /* Compress len zeros to output. Return -1 on a write error or memory > allocation failure by gz_comp(), or 0 on success. */ >-local int gz_zero(state, len) >- gz_statep state; >- z_off64_t len; >+local int gz_zero(gz_statep state, z_off64_t len) > { > int first; > unsigned n; >@@ -184,10 +179,7 @@ > > /* Write len bytes from buf to file. Return the number of bytes written. If > the returned value is less than len, then there was an error. */ >-local z_size_t gz_write(state, buf, len) >- gz_statep state; >- voidpc buf; >- z_size_t len; >+local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) > { > z_size_t put = len; > >@@ -252,10 +244,7 @@ > } > > /* -- see zlib.h -- */ >-int ZEXPORT gzwrite(file, buf, len) >- gzFile file; >- voidpc buf; >- unsigned len; >+int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len) > { > gz_statep state; > >@@ -280,11 +269,8 @@ > } > > /* -- see zlib.h -- */ >-z_size_t ZEXPORT gzfwrite(buf, size, nitems, file) >- voidpc buf; >- z_size_t size; >- z_size_t nitems; >- gzFile file; >+z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, >+ z_size_t nitems, gzFile file) > { > z_size_t len; > gz_statep state; >@@ -310,9 +296,7 @@ > } > > /* -- see zlib.h -- */ >-int ZEXPORT gzputc(file, c) >- gzFile file; >- int c; >+int ZEXPORT gzputc(gzFile file, int c) > { > unsigned have; > unsigned char buf[1]; >@@ -358,9 +342,7 @@ > } > > /* -- see zlib.h -- */ >-int ZEXPORT gzputs(file, s) >- gzFile file; >- const char *s; >+int ZEXPORT gzputs(gzFile file, const char *s) > { > z_size_t len, put; > gz_statep state; >@@ -562,9 +544,7 @@ > #endif > > /* -- see zlib.h -- */ >-int ZEXPORT gzflush(file, flush) >- gzFile file; >- int flush; >+int ZEXPORT gzflush(gzFile file, int flush) > { > gz_statep state; > >@@ -594,10 +574,7 @@ > } > > /* -- see zlib.h -- */ >-int ZEXPORT gzsetparams(file, level, strategy) >- gzFile file; >- int level; >- int strategy; >+int ZEXPORT gzsetparams(gzFile file, int level, int strategy) > { > gz_statep state; > z_streamp strm; >@@ -636,8 +613,7 @@ > } > > /* -- see zlib.h -- */ >-int ZEXPORT gzclose_w(file) >- gzFile file; >+int ZEXPORT gzclose_w(gzFile file) > { > int ret = Z_OK; > gz_statep state; >diff -Naur a/infback.c b/infback.c >--- a/infback.c 2022-07-24 14:41:07.000000000 -0400 >+++ b/infback.c 2023-02-15 01:02:24.202172467 -0500 >@@ -25,12 +25,9 @@ > windowBits is in the range 8..15, and window is a user-supplied > window and output buffer that is 2**windowBits bytes. > */ >-int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) >-z_streamp strm; >-int windowBits; >-unsigned char FAR *window; >-const char *version; >-int stream_size; >+int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits, >+ unsigned char FAR *window, >+ const char *version, int stream_size) > { > struct inflate_state FAR *state; > >@@ -80,8 +77,7 @@ > used for threaded applications, since the rewriting of the tables and virgin > may not be thread-safe. > */ >-local void fixedtables(state) >-struct inflate_state FAR *state; >+local void fixedtables(struct inflate_state FAR *state) > { > #ifdef BUILDFIXED > static int virgin = 1; >@@ -248,12 +244,8 @@ > inflateBack() can also return Z_STREAM_ERROR if the input parameters > are not correct, i.e. strm is Z_NULL or the state was not initialized. > */ >-int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) >-z_streamp strm; >-in_func in; >-void FAR *in_desc; >-out_func out; >-void FAR *out_desc; >+int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc, >+ out_func out, void FAR *out_desc) > { > struct inflate_state FAR *state; > z_const unsigned char FAR *next; /* next input */ >@@ -632,8 +624,7 @@ > return ret; > } > >-int ZEXPORT inflateBackEnd(strm) >-z_streamp strm; >+int ZEXPORT inflateBackEnd(z_streamp strm) > { > if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) > return Z_STREAM_ERROR; >diff -Naur a/inffast.c b/inffast.c >--- a/inffast.c 2017-02-16 01:39:26.000000000 -0500 >+++ b/inffast.c 2023-02-15 01:02:24.202172467 -0500 >@@ -47,9 +47,8 @@ > requires strm->avail_out >= 258 for each loop to avoid checking for > output space. > */ >-void ZLIB_INTERNAL inflate_fast(strm, start) >-z_streamp strm; >-unsigned start; /* inflate()'s starting value for strm->avail_out */ >+void ZLIB_INTERNAL inflate_fast(z_streamp strm, >+ unsigned start /* inflate()'s starting value for strm->avail_out */) > { > struct inflate_state FAR *state; > z_const unsigned char FAR *in; /* local strm->next_in */ >diff -Naur a/inflate.c b/inflate.c >--- a/inflate.c 2022-10-06 23:43:18.000000000 -0400 >+++ b/inflate.c 2023-02-15 01:02:24.202172467 -0500 >@@ -102,8 +102,7 @@ > local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, > unsigned len)); > >-local int inflateStateCheck(strm) >-z_streamp strm; >+local int inflateStateCheck(z_streamp strm) > { > struct inflate_state FAR *state; > if (strm == Z_NULL || >@@ -116,8 +115,7 @@ > return 0; > } > >-int ZEXPORT inflateResetKeep(strm) >-z_streamp strm; >+int ZEXPORT inflateResetKeep(z_streamp strm) > { > struct inflate_state FAR *state; > >@@ -142,8 +140,7 @@ > return Z_OK; > } > >-int ZEXPORT inflateReset(strm) >-z_streamp strm; >+int ZEXPORT inflateReset(z_streamp strm) > { > struct inflate_state FAR *state; > >@@ -155,9 +152,7 @@ > return inflateResetKeep(strm); > } > >-int ZEXPORT inflateReset2(strm, windowBits) >-z_streamp strm; >-int windowBits; >+int ZEXPORT inflateReset2(z_streamp strm, int windowBits) > { > int wrap; > struct inflate_state FAR *state; >@@ -195,11 +190,8 @@ > return inflateReset(strm); > } > >-int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) >-z_streamp strm; >-int windowBits; >-const char *version; >-int stream_size; >+int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, >+ const char * version, int stream_size) > { > int ret; > struct inflate_state FAR *state; >@@ -239,18 +231,12 @@ > return ret; > } > >-int ZEXPORT inflateInit_(strm, version, stream_size) >-z_streamp strm; >-const char *version; >-int stream_size; >+int ZEXPORT inflateInit_(z_streamp strm, const char *version, int stream_size) > { > return inflateInit2_(strm, DEF_WBITS, version, stream_size); > } > >-int ZEXPORT inflatePrime(strm, bits, value) >-z_streamp strm; >-int bits; >-int value; >+int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) > { > struct inflate_state FAR *state; > >@@ -278,8 +264,7 @@ > used for threaded applications, since the rewriting of the tables and virgin > may not be thread-safe. > */ >-local void fixedtables(state) >-struct inflate_state FAR *state; >+local void fixedtables(struct inflate_state FAR *state) > { > #ifdef BUILDFIXED > static int virgin = 1; >@@ -396,10 +381,7 @@ > output will fall in the output data, making match copies simpler and faster. > The advantage may be dependent on the size of the processor's data caches. > */ >-local int updatewindow(strm, end, copy) >-z_streamp strm; >-const Bytef *end; >-unsigned copy; >+local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) > { > struct inflate_state FAR *state; > unsigned dist; >@@ -622,9 +604,7 @@ > will return Z_BUF_ERROR if it has not reached the end of the stream. > */ > >-int ZEXPORT inflate(strm, flush) >-z_streamp strm; >-int flush; >+int ZEXPORT inflate(z_streamp strm, int flush) > { > struct inflate_state FAR *state; > z_const unsigned char FAR *next; /* next input */ >@@ -1301,8 +1281,7 @@ > return ret; > } > >-int ZEXPORT inflateEnd(strm) >-z_streamp strm; >+int ZEXPORT inflateEnd(z_streamp strm) > { > struct inflate_state FAR *state; > if (inflateStateCheck(strm)) >@@ -1315,10 +1294,8 @@ > return Z_OK; > } > >-int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) >-z_streamp strm; >-Bytef *dictionary; >-uInt *dictLength; >+int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary, >+ uInt *dictLength) > { > struct inflate_state FAR *state; > >@@ -1338,10 +1315,8 @@ > return Z_OK; > } > >-int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) >-z_streamp strm; >-const Bytef *dictionary; >-uInt dictLength; >+int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary, >+ uInt dictLength) > { > struct inflate_state FAR *state; > unsigned long dictid; >@@ -1373,9 +1348,7 @@ > return Z_OK; > } > >-int ZEXPORT inflateGetHeader(strm, head) >-z_streamp strm; >-gz_headerp head; >+int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head) > { > struct inflate_state FAR *state; > >@@ -1401,10 +1374,8 @@ > called again with more data and the *have state. *have is initialized to > zero for the first call. > */ >-local unsigned syncsearch(have, buf, len) >-unsigned FAR *have; >-const unsigned char FAR *buf; >-unsigned len; >+local unsigned syncsearch(unsigned FAR *have, >+ const unsigned char FAR *buf, unsigned len) > { > unsigned got; > unsigned next; >@@ -1424,8 +1395,7 @@ > return next; > } > >-int ZEXPORT inflateSync(strm) >-z_streamp strm; >+int ZEXPORT inflateSync(z_streamp strm) > { > unsigned len; /* number of bytes to look at or looked at */ > int flags; /* temporary to save header status */ >@@ -1482,8 +1452,7 @@ > block. When decompressing, PPP checks that at the end of input packet, > inflate is waiting for these length bytes. > */ >-int ZEXPORT inflateSyncPoint(strm) >-z_streamp strm; >+int ZEXPORT inflateSyncPoint(z_streamp strm) > { > struct inflate_state FAR *state; > >@@ -1492,9 +1461,7 @@ > return state->mode == STORED && state->bits == 0; > } > >-int ZEXPORT inflateCopy(dest, source) >-z_streamp dest; >-z_streamp source; >+int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) > { > struct inflate_state FAR *state; > struct inflate_state FAR *copy; >@@ -1539,9 +1506,7 @@ > return Z_OK; > } > >-int ZEXPORT inflateUndermine(strm, subvert) >-z_streamp strm; >-int subvert; >+int ZEXPORT inflateUndermine(z_streamp strm, int subvert) > { > struct inflate_state FAR *state; > >@@ -1557,9 +1522,7 @@ > #endif > } > >-int ZEXPORT inflateValidate(strm, check) >-z_streamp strm; >-int check; >+int ZEXPORT inflateValidate(z_streamp strm, int check) > { > struct inflate_state FAR *state; > >@@ -1572,8 +1535,7 @@ > return Z_OK; > } > >-long ZEXPORT inflateMark(strm) >-z_streamp strm; >+long ZEXPORT inflateMark(z_streamp strm) > { > struct inflate_state FAR *state; > >@@ -1585,8 +1547,7 @@ > (state->mode == MATCH ? state->was - state->length : 0)); > } > >-unsigned long ZEXPORT inflateCodesUsed(strm) >-z_streamp strm; >+unsigned long ZEXPORT inflateCodesUsed(z_streamp strm) > { > struct inflate_state FAR *state; > if (inflateStateCheck(strm)) return (unsigned long)-1; >diff -Naur a/inftrees.c b/inftrees.c >--- a/inftrees.c 2022-10-13 01:06:55.000000000 -0400 >+++ b/inftrees.c 2023-02-15 01:02:24.203172458 -0500 >@@ -29,13 +29,9 @@ > table index bits. It will differ if the request is greater than the > longest code or if it is less than the shortest code. > */ >-int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work) >-codetype type; >-unsigned short FAR *lens; >-unsigned codes; >-code FAR * FAR *table; >-unsigned FAR *bits; >-unsigned short FAR *work; >+int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, >+ unsigned codes, code FAR * FAR *table, >+ unsigned FAR *bits, unsigned short FAR *work) > { > unsigned len; /* a code's length in bits */ > unsigned sym; /* index of code symbols */ >diff -Naur a/test/example.c b/test/example.c >--- a/test/example.c 2022-05-26 11:47:51.000000000 -0400 >+++ b/test/example.c 2023-02-15 01:21:22.651833738 -0500 >@@ -55,9 +55,7 @@ > void *myalloc OF((void *, unsigned, unsigned)); > void myfree OF((void *, void *)); > >-void *myalloc(q, n, m) >- void *q; >- unsigned n, m; >+void *myalloc(void *q, unsigned n, unsigned m) > { > (void)q; > return calloc(n, m); >@@ -85,9 +83,7 @@ > /* =========================================================================== > * Test compress() and uncompress() > */ >-void test_compress(compr, comprLen, uncompr, uncomprLen) >- Byte *compr, *uncompr; >- uLong comprLen, uncomprLen; >+void test_compress(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) > { > int err; > uLong len = (uLong)strlen(hello)+1; >@@ -111,10 +107,8 @@ > /* =========================================================================== > * Test read/write of .gz files > */ >-void test_gzio(fname, uncompr, uncomprLen) >- const char *fname; /* compressed file name */ >- Byte *uncompr; >- uLong uncomprLen; >+void test_gzio(const char *fname /* compressed file name */, >+ Byte *uncompr, uLong uncomprLen) > { > #ifdef NO_GZCOMPRESS > fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n"); >@@ -197,9 +191,7 @@ > /* =========================================================================== > * Test deflate() with small buffers > */ >-void test_deflate(compr, comprLen) >- Byte *compr; >- uLong comprLen; >+void test_deflate(Byte *compr, uLong comprLen) > { > z_stream c_stream; /* compression stream */ > int err; >@@ -235,9 +227,7 @@ > /* =========================================================================== > * Test inflate() with small buffers > */ >-void test_inflate(compr, comprLen, uncompr, uncomprLen) >- Byte *compr, *uncompr; >- uLong comprLen, uncomprLen; >+void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) > { > int err; > z_stream d_stream; /* decompression stream */ >@@ -276,9 +266,7 @@ > /* =========================================================================== > * Test deflate() with large buffers and dynamic change of compression level > */ >-void test_large_deflate(compr, comprLen, uncompr, uncomprLen) >- Byte *compr, *uncompr; >- uLong comprLen, uncomprLen; >+void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) > { > z_stream c_stream; /* compression stream */ > int err; >@@ -331,9 +319,7 @@ > /* =========================================================================== > * Test inflate() with large buffers > */ >-void test_large_inflate(compr, comprLen, uncompr, uncomprLen) >- Byte *compr, *uncompr; >- uLong comprLen, uncomprLen; >+void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) > { > int err; > z_stream d_stream; /* decompression stream */ >@@ -372,9 +358,7 @@ > /* =========================================================================== > * Test deflate() with full flush > */ >-void test_flush(compr, comprLen) >- Byte *compr; >- uLong *comprLen; >+void test_flush(Byte *compr, uLong *comprLen) > { > z_stream c_stream; /* compression stream */ > int err; >@@ -410,9 +394,7 @@ > /* =========================================================================== > * Test inflateSync() > */ >-void test_sync(compr, comprLen, uncompr, uncomprLen) >- Byte *compr, *uncompr; >- uLong comprLen, uncomprLen; >+void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) > { > int err; > z_stream d_stream; /* decompression stream */ >@@ -453,9 +435,7 @@ > /* =========================================================================== > * Test deflate() with preset dictionary > */ >-void test_dict_deflate(compr, comprLen) >- Byte *compr; >- uLong comprLen; >+void test_dict_deflate(Byte *compr, uLong comprLen) > { > z_stream c_stream; /* compression stream */ > int err; >@@ -490,9 +470,7 @@ > /* =========================================================================== > * Test inflate() with a preset dictionary > */ >-void test_dict_inflate(compr, comprLen, uncompr, uncomprLen) >- Byte *compr, *uncompr; >- uLong comprLen, uncomprLen; >+void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) > { > int err; > z_stream d_stream; /* decompression stream */ >@@ -541,9 +519,7 @@ > * Usage: example [output.gz [input.gz]] > */ > >-int main(argc, argv) >- int argc; >- char *argv[]; >+int main(int argc, char *argv[]) > { > Byte *compr, *uncompr; > uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */ >diff -Naur a/trees.c b/trees.c >--- a/trees.c 2022-10-05 18:17:52.000000000 -0400 >+++ b/trees.c 2023-02-15 01:29:46.416985720 -0500 >@@ -183,10 +183,9 @@ > #ifdef ZLIB_DEBUG > local void send_bits OF((deflate_state *s, int value, int length)); > >-local void send_bits(s, value, length) >- deflate_state *s; >- int value; /* value to send */ >- int length; /* number of bits */ >+local void send_bits(deflate_state *s, >+ int value /* value to send */, >+ int length /* number of bits */) > { > Tracevv((stderr," l %2d v %4x ", length, value)); > Assert(length > 0 && length <= 15, "invalid length"); >@@ -376,8 +375,7 @@ > /* =========================================================================== > * Initialize the tree data structures for a new zlib stream. > */ >-void ZLIB_INTERNAL _tr_init(s) >- deflate_state *s; >+void ZLIB_INTERNAL _tr_init(deflate_state *s) > { > tr_static_init(); > >@@ -404,8 +402,7 @@ > /* =========================================================================== > * Initialize a new block. > */ >-local void init_block(s) >- deflate_state *s; >+local void init_block(deflate_state *s) > { > int n; /* iterates over tree elements */ > >@@ -448,10 +445,9 @@ > * when the heap property is re-established (each father smaller than its > * two sons). > */ >-local void pqdownheap(s, tree, k) >- deflate_state *s; >- ct_data *tree; /* the tree to restore */ >- int k; /* node to move down */ >+local void pqdownheap(deflate_state *s, >+ ct_data *tree /* the tree to restore */, >+ int k /* node to move down */) > { > int v = s->heap[k]; > int j = k << 1; /* left son of k */ >@@ -483,9 +479,8 @@ > * The length opt_len is updated; static_len is also updated if stree is > * not null. > */ >-local void gen_bitlen(s, desc) >- deflate_state *s; >- tree_desc *desc; /* the tree descriptor */ >+local void gen_bitlen(deflate_state *s, >+ tree_desc *desc /* the tree descriptor */) > { > ct_data *tree = desc->dyn_tree; > int max_code = desc->max_code; >@@ -569,10 +564,9 @@ > * OUT assertion: the field code is set for all tree elements of non > * zero code length. > */ >-local void gen_codes(tree, max_code, bl_count) >- ct_data *tree; /* the tree to decorate */ >- int max_code; /* largest code with non zero frequency */ >- ushf *bl_count; /* number of codes at each bit length */ >+local void gen_codes(ct_data *tree /* the tree to decorate */, >+ int max_code /* largest code with non zero frequency */, >+ ushf *bl_count /* number of codes at each bit length */) > { > ush next_code[MAX_BITS+1]; /* next code value for each bit length */ > unsigned code = 0; /* running code value */ >@@ -612,9 +606,8 @@ > * and corresponding code. The length opt_len is updated; static_len is > * also updated if stree is not null. The field max_code is set. > */ >-local void build_tree(s, desc) >- deflate_state *s; >- tree_desc *desc; /* the tree descriptor */ >+local void build_tree(deflate_state *s, >+ tree_desc *desc /* the tree descriptor */) > { > ct_data *tree = desc->dyn_tree; > const ct_data *stree = desc->stat_desc->static_tree; >@@ -700,10 +693,9 @@ > * Scan a literal or distance tree to determine the frequencies of the codes > * in the bit length tree. > */ >-local void scan_tree(s, tree, max_code) >- deflate_state *s; >- ct_data *tree; /* the tree to be scanned */ >- int max_code; /* and its largest code of non zero frequency */ >+local void scan_tree(deflate_state *s, >+ ct_data *tree /* the tree to be scanned */, >+ int max_code /* and its largest code of non zero frequency */) > { > int n; /* iterates over all tree elements */ > int prevlen = -1; /* last emitted length */ >@@ -745,10 +737,9 @@ > * Send a literal or distance tree in compressed form, using the codes in > * bl_tree. > */ >-local void send_tree(s, tree, max_code) >- deflate_state *s; >- ct_data *tree; /* the tree to be scanned */ >- int max_code; /* and its largest code of non zero frequency */ >+local void send_tree( deflate_state *s, >+ ct_data *tree /* the tree to be scanned */, >+ int max_code /* and its largest code of non zero frequency */) > { > int n; /* iterates over all tree elements */ > int prevlen = -1; /* last emitted length */ >@@ -796,8 +787,7 @@ > * Construct the Huffman tree for the bit lengths and return the index in > * bl_order of the last bit length code to send. > */ >-local int build_bl_tree(s) >- deflate_state *s; >+local int build_bl_tree(deflate_state *s) > { > int max_blindex; /* index of last bit length code of non zero freq */ > >@@ -831,9 +821,8 @@ > * lengths of the bit length codes, the literal tree and the distance tree. > * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. > */ >-local void send_all_trees(s, lcodes, dcodes, blcodes) >- deflate_state *s; >- int lcodes, dcodes, blcodes; /* number of codes for each tree */ >+local void send_all_trees(deflate_state *s, >+ /* number of codes for each tree */ int lcodes, int dcodes, int blcodes) > { > int rank; /* index in bl_order */ > >@@ -860,11 +849,10 @@ > /* =========================================================================== > * Send a stored block > */ >-void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) >- deflate_state *s; >- charf *buf; /* input block */ >- ulg stored_len; /* length of input block */ >- int last; /* one if this is the last block for a file */ >+void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, >+ charf *buf /* input block */, >+ ulg stored_len /* length of input block */, >+ int last /* one if this is the last block for a file */) > { > send_bits(s, (STORED_BLOCK<<1) + last, 3); /* send block type */ > bi_windup(s); /* align on byte boundary */ >@@ -884,8 +872,7 @@ > /* =========================================================================== > * Flush the bits in the bit buffer to pending output (leaves at most 7 bits) > */ >-void ZLIB_INTERNAL _tr_flush_bits(s) >- deflate_state *s; >+void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) > { > bi_flush(s); > } >@@ -894,8 +881,7 @@ > * Send one empty static block to give enough lookahead for inflate. > * This takes 10 bits, of which 7 may remain in the bit buffer. > */ >-void ZLIB_INTERNAL _tr_align(s) >- deflate_state *s; >+void ZLIB_INTERNAL _tr_align(deflate_state *s) > { > send_bits(s, STATIC_TREES<<1, 3); > send_code(s, END_BLOCK, static_ltree); >@@ -909,11 +895,10 @@ > * Determine the best encoding for the current block: dynamic trees, static > * trees or store, and write out the encoded block. > */ >-void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) >- deflate_state *s; >- charf *buf; /* input block, or NULL if too old */ >- ulg stored_len; /* length of input block */ >- int last; /* one if this is the last block for a file */ >+void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, >+ charf *buf /* input block, or NULL if too old */, >+ ulg stored_len /* length of input block */, >+ int last /* one if this is the last block for a file */) > { > ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ > int max_blindex = 0; /* index of last bit length code of non zero freq */ >@@ -1011,10 +996,9 @@ > * Save the match info and tally the frequency counts. Return true if > * the current block must be flushed. > */ >-int ZLIB_INTERNAL _tr_tally(s, dist, lc) >- deflate_state *s; >- unsigned dist; /* distance of matched string */ >- unsigned lc; /* match length - MIN_MATCH or unmatched char (dist==0) */ >+int ZLIB_INTERNAL _tr_tally(deflate_state *s, >+ unsigned dist /* distance of matched string */, >+ unsigned lc /* match length - MIN_MATCH or unmatched char (dist==0) */) > { > s->sym_buf[s->sym_next++] = (uch)dist; > s->sym_buf[s->sym_next++] = (uch)(dist >> 8); >@@ -1039,10 +1023,9 @@ > /* =========================================================================== > * Send the block data compressed using the given Huffman trees > */ >-local void compress_block(s, ltree, dtree) >- deflate_state *s; >- const ct_data *ltree; /* literal tree */ >- const ct_data *dtree; /* distance tree */ >+local void compress_block(deflate_state *s, >+ const ct_data *ltree /* literal tree */, >+ const ct_data *dtree /* distance tree */) > { > unsigned dist; /* distance of matched string */ > int lc; /* match length or unmatched char (if dist == 0) */ >@@ -1099,8 +1082,7 @@ > * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). > * IN assertion: the fields Freq of dyn_ltree are set. > */ >-local int detect_data_type(s) >- deflate_state *s; >+local int detect_data_type(deflate_state *s) > { > /* block_mask is the bit mask of block-listed bytes > * set bits 0..6, 14..25, and 28..31 >@@ -1133,9 +1115,8 @@ > * method would use a table) > * IN assertion: 1 <= len <= 15 > */ >-local unsigned bi_reverse(code, len) >- unsigned code; /* the value to invert */ >- int len; /* its bit length */ >+local unsigned bi_reverse(unsigned code /* the value to invert */, >+ int len /* its bit length */) > { > register unsigned res = 0; > do { >@@ -1148,8 +1129,7 @@ > /* =========================================================================== > * Flush the bit buffer, keeping at most 7 bits in it. > */ >-local void bi_flush(s) >- deflate_state *s; >+local void bi_flush(deflate_state *s) > { > if (s->bi_valid == 16) { > put_short(s, s->bi_buf); >@@ -1165,8 +1145,7 @@ > /* =========================================================================== > * Flush the bit buffer and align the output on a byte boundary > */ >-local void bi_windup(s) >- deflate_state *s; >+local void bi_windup(deflate_state *s) > { > if (s->bi_valid > 8) { > put_short(s, s->bi_buf); >diff -Naur a/uncompr.c b/uncompr.c >--- a/uncompr.c 2022-10-05 18:17:52.000000000 -0400 >+++ b/uncompr.c 2023-02-15 01:12:48.385561135 -0500 >@@ -24,11 +24,8 @@ > Z_DATA_ERROR if the input data was corrupted, including if the input data is > an incomplete zlib stream. > */ >-int ZEXPORT uncompress2(dest, destLen, source, sourceLen) >- Bytef *dest; >- uLongf *destLen; >- const Bytef *source; >- uLong *sourceLen; >+int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source, >+ uLongf *sourceLen) > { > z_stream stream; > int err; >@@ -83,11 +80,8 @@ > err; > } > >-int ZEXPORT uncompress(dest, destLen, source, sourceLen) >- Bytef *dest; >- uLongf *destLen; >- const Bytef *source; >- uLong sourceLen; >+int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, >+ uLong sourceLen) > { > return uncompress2(dest, destLen, source, &sourceLen); > } >diff -Naur a/zutil.c b/zutil.c >--- a/zutil.c 2022-10-06 23:43:09.000000000 -0400 >+++ b/zutil.c 2023-02-15 01:23:00.432039394 -0500 >@@ -132,8 +132,7 @@ > /* exported to allow conversion of error code to string for compress() and > * uncompress() > */ >-const char * ZEXPORT zError(err) >- int err; >+const char * ZEXPORT zError(int err) > { > return ERR_MSG(err); > } >@@ -148,10 +147,7 @@ > > #ifndef HAVE_MEMCPY > >-void ZLIB_INTERNAL zmemcpy(dest, source, len) >- Bytef* dest; >- const Bytef* source; >- uInt len; >+void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len) > { > if (len == 0) return; > do { >@@ -159,10 +155,7 @@ > } while (--len != 0); > } > >-int ZLIB_INTERNAL zmemcmp(s1, s2, len) >- const Bytef* s1; >- const Bytef* s2; >- uInt len; >+int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len) > { > uInt j; > >@@ -172,9 +165,7 @@ > return 0; > } > >-void ZLIB_INTERNAL zmemzero(dest, len) >- Bytef* dest; >- uInt len; >+void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len) > { > if (len == 0) return; > do { >@@ -304,19 +295,14 @@ > extern void free OF((voidpf ptr)); > #endif > >-voidpf ZLIB_INTERNAL zcalloc(opaque, items, size) >- voidpf opaque; >- unsigned items; >- unsigned size; >+voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) > { > (void)opaque; > return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : > (voidpf)calloc(items, size); > } > >-void ZLIB_INTERNAL zcfree(opaque, ptr) >- voidpf opaque; >- voidpf ptr; >+void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) > { > (void)opaque; > free(ptr);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 894598
: 851250 |
851252
|
851254