diff --git a/adler32.c b/adler32.c index a868f073..82a84cee 100644 --- a/adler32.c +++ b/adler32.c @@ -62,10 +62,10 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); #endif /* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) - uLong adler; - const Bytef *buf; - uInt len; +uLong ZEXPORT adler32( + uLong adler, + const Bytef *buf, + uInt len) { unsigned long sum2; unsigned n; @@ -133,10 +133,10 @@ uLong ZEXPORT adler32(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; @@ -162,18 +162,18 @@ local uLong adler32_combine_(adler1, adler2, len2) } /* ========================================================================= */ -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 --git a/compress.c b/compress.c index ea4dfbe9..0eb50901 100644 --- a/compress.c +++ b/compress.c @@ -19,12 +19,13 @@ memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ -int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; - int level; +int ZEXPORT compress2 ( + Bytef *dest, + uLongf *destLen, + const Bytef *source, + uLong sourceLen, + int level + ) { z_stream stream; int err; @@ -59,11 +60,12 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) /* =========================================================================== */ -int ZEXPORT compress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; +int ZEXPORT compress ( + Bytef *dest, + uLongf *destLen, + const Bytef *source, + uLong sourceLen + ) { return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); } @@ -72,8 +74,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen) If the default memLevel or windowBits for deflateInit() is changed, then this function needs to be updated. */ -uLong ZEXPORT compressBound (sourceLen) - uLong sourceLen; +uLong ZEXPORT compressBound (uLong sourceLen) { return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13; diff --git a/contrib/masmx64/inffas8664.c b/contrib/masmx64/inffas8664.c index e8af06fa..1bfcbf83 100644 --- a/contrib/masmx64/inffas8664.c +++ b/contrib/masmx64/inffas8664.c @@ -103,9 +103,9 @@ } type_ar; #ifdef ASMINF -void inflate_fast(strm, start) -z_streamp strm; -unsigned start; /* inflate()'s starting value for strm->avail_out */ +void inflate_fast( +z_streamp strm, +unsigned start /* inflate()'s starting value for strm->avail_out */ ) { struct inflate_state FAR *state; type_ar ar; diff --git a/contrib/minizip/ioapi.c b/contrib/minizip/ioapi.c index 7f5c191b..2271170a 100644 --- a/contrib/minizip/ioapi.c +++ b/contrib/minizip/ioapi.c @@ -1,4 +1,4 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip +/* ioapi.c -- IO base function header for compress/uncompress .zip part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) @@ -221,8 +221,7 @@ static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) 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 --git a/contrib/minizip/miniunz.c b/contrib/minizip/miniunz.c index 3d65401b..1a3374fc 100644 --- a/contrib/minizip/miniunz.c +++ b/contrib/minizip/miniunz.c @@ -80,10 +80,10 @@ filename : the filename of the file where date/time must be modified dosdate : the new date at the MSDos format (4 bytes) tmu_date : the SAME new date at the tm_unz format */ -void change_file_date(filename,dosdate,tmu_date) - const char *filename; - uLong dosdate; - tm_unz tmu_date; +void change_file_date( + const char *filename, + uLong dosdate, + tm_unz tmu_date) { #ifdef _WIN32 HANDLE hFile; @@ -121,8 +121,8 @@ void change_file_date(filename,dosdate,tmu_date) /* mymkdir and change_file_date are not 100 % portable As I don't know well Unix, I wait feedback for the unix portion */ -int mymkdir(dirname) - const char* dirname; +int mymkdir( + const char* dirname) { int ret=0; #ifdef _WIN32 @@ -135,8 +135,8 @@ int mymkdir(dirname) return ret; } -int makedir (newdir) - char *newdir; +int makedir ( + const char *newdir) { char *buffer ; char *p; @@ -185,13 +185,13 @@ int makedir (newdir) return 1; } -void do_banner() +void do_banner(void) { printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n"); printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); } -void do_help() +void do_help(void) { printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \ " -e Extract without pathname (junk paths)\n" \ @@ -231,8 +231,8 @@ void Display64BitsSize(ZPOS64_T n, int size_char) printf("%s",&number[pos_string]); } -int do_list(uf) - unzFile uf; +int do_list( + unzFile uf) { uLong i; unz_global_info64 gi; @@ -309,11 +309,11 @@ int do_list(uf) } -int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password) - unzFile uf; - const int* popt_extract_without_path; - int* popt_overwrite; - const char* password; +int do_extract_currentfile( + unzFile uf, + const int* popt_extract_without_path, + int* popt_overwrite, + const char* password) { char filename_inzip[256]; char* filename_withoutpath; @@ -472,11 +472,11 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password) } -int do_extract(uf,opt_extract_without_path,opt_overwrite,password) - unzFile uf; - int opt_extract_without_path; - int opt_overwrite; - const char* password; +int do_extract( + unzFile uf, + int opt_extract_without_path, + int opt_overwrite, + const char* password) { uLong i; unz_global_info64 gi; @@ -508,12 +508,12 @@ int do_extract(uf,opt_extract_without_path,opt_overwrite,password) return 0; } -int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,password) - unzFile uf; - const char* filename; - int opt_extract_without_path; - int opt_overwrite; - const char* password; +int do_extract_onefile( + unzFile uf, + const char* filename, + int opt_extract_without_path, + int opt_overwrite, + const char* password) { int err = UNZ_OK; if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK) @@ -531,9 +531,9 @@ int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,passwo } -int main(argc,argv) - int argc; - char *argv[]; +int main( + int argc, + char *argv[]) { const char *zipfilename=NULL; const char *filename_to_extract=NULL; diff --git a/contrib/minizip/minizip.c b/contrib/minizip/minizip.c index 4288962e..eed16764 100644 --- a/contrib/minizip/minizip.c +++ b/contrib/minizip/minizip.c @@ -71,10 +71,10 @@ #define MAXFILENAME (256) #ifdef _WIN32 -uLong filetime(f, tmzip, dt) - char *f; /* name of file to get info on */ - tm_zip *tmzip; /* return value: access, modific. and creation times */ - uLong *dt; /* dostime */ +uLong filetime( + const char *f, /* name of file to get info on */ + tm_zip *tmzip, /* return value: access, modific. and creation times */ + uLong *dt /* dostime */ ) { int ret = 0; { @@ -95,10 +95,10 @@ uLong filetime(f, tmzip, dt) } #else #ifdef unix || __APPLE__ -uLong filetime(f, tmzip, dt) - char *f; /* name of file to get info on */ - tm_zip *tmzip; /* return value: access, modific. and creation times */ - uLong *dt; /* dostime */ +uLong filetime( + const char *f, /* name of file to get info on */ + tm_zip *tmzip, /* return value: access, modific. and creation times */ + uLong *dt /* dostime */ ) { int ret=0; struct stat s; /* results of stat() */ @@ -137,10 +137,10 @@ uLong filetime(f, tmzip, dt) return ret; } #else -uLong filetime(f, tmzip, dt) - char *f; /* name of file to get info on */ - tm_zip *tmzip; /* return value: access, modific. and creation times */ - uLong *dt; /* dostime */ +uLong filetime( + const char *f, /* name of file to get info on */ + tm_zip *tmzip, /* return value: access, modific. and creation times */ + uLong *dt /* dostime */ ) { return 0; } @@ -150,8 +150,8 @@ uLong filetime(f, tmzip, dt) -int check_exist_file(filename) - const char* filename; +int check_exist_file( + const char* filename) { FILE* ftestexist; int ret = 1; @@ -163,13 +163,13 @@ int check_exist_file(filename) return ret; } -void do_banner() +void do_banner(void) { printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n"); printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n"); } -void do_help() +void do_help(void) { printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \ " -o Overwrite existing file.zip\n" \ @@ -182,7 +182,7 @@ void do_help() /* calculate the CRC32 of a file, because to encrypt a file, we need known the CRC32 of the file before */ -int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc) +int getFileCrc(const char* filenameinzip, void*buf, unsigned long size_buf, unsigned long* result_crc) { unsigned long calculate_crc=0; int err=ZIP_OK; @@ -243,9 +243,9 @@ int isLargeFile(const char* filename) return largeFile; } -int main(argc,argv) - int argc; - char *argv[]; +int main( + int argc, + char *argv[]) { int i; int opt_overwrite=0; diff --git a/contrib/minizip/mztools.c b/contrib/minizip/mztools.c index 96891c2e..2ec6ddff 100644 --- a/contrib/minizip/mztools.c +++ b/contrib/minizip/mztools.c @@ -27,12 +27,12 @@ WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \ } while(0) -extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) -const char* file; -const char* fileOut; -const char* fileOutTmp; -uLong* nRecovered; -uLong* bytesRecovered; +extern int ZEXPORT unzRepair( +const char* file, +const char* fileOut, +const char* fileOutTmp, +uLong* nRecovered, +uLong* bytesRecovered) { int err = Z_OK; FILE* fpZip = fopen(file, "rb"); diff --git a/contrib/untgz/untgz.c b/contrib/untgz/untgz.c index 2c391e59..9a41caf0 100644 --- a/contrib/untgz/untgz.c +++ b/contrib/untgz/untgz.c @@ -107,13 +107,13 @@ void TGZnotfound OF((const char *)); int getoct OF((char *, int)); char *strtime OF((time_t *)); -int setfiletime OF((char *, time_t)); +int setfiletime OF((const char *, time_t)); void push_attr OF((struct attr_item **, char *, int, time_t)); void restore_attr OF((struct attr_item **)); int ExprMatch OF((char *, char *)); -int makedir OF((char *)); +int makedir OF((const char *)); int matchname OF((int, int, char **, char *)); void error OF((const char *)); @@ -203,7 +203,7 @@ char *strtime (time_t *t) /* set file time */ -int setfiletime (char *fname,time_t ftime) +int setfiletime (const char *fname,time_t ftime) { #ifdef WIN32 static int isWinNT = -1; @@ -325,7 +325,7 @@ int ExprMatch (char *string,char *expr) /* return 1 if OK */ /* 0 on error */ -int makedir (char *newdir) +int makedir (const char *newdir) { char *buffer = strdup(newdir); char *p; diff --git a/crc32.c b/crc32.c index 5cfc8ff0..4cf249d9 100644 --- a/crc32.c +++ b/crc32.c @@ -110,7 +110,7 @@ local void make_crc_table OF((void)); allow for word-at-a-time CRC calculation for both big-endian and little- endian machines, where a word is four bytes. */ -local void make_crc_table() +local void make_crc_table(void) { crc_table_t c; int n, k; @@ -187,9 +187,9 @@ local void make_crc_table() } #ifdef MAKECRCH -local void write_table(out, table) - FILE *out; - const crc_table_t FAR *table; +local void write_table( + FILE *out, + const crc_table_t FAR *table) { int n; @@ -210,7 +210,7 @@ local void write_table(out, table) /* ========================================================================= * This function can be used by asm versions of crc32() */ -const unsigned long FAR * ZEXPORT get_crc_table() +const unsigned long FAR * ZEXPORT get_crc_table(void) { #ifdef DYNAMIC_CRC_TABLE if (crc_table_empty) @@ -224,10 +224,10 @@ const unsigned long FAR * ZEXPORT get_crc_table() #define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 /* ========================================================================= */ -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) { if (buf == Z_NULL) return 0UL; @@ -267,10 +267,10 @@ unsigned long ZEXPORT crc32(crc, buf, len) #define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4 /* ========================================================================= */ -local unsigned long crc32_little(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - unsigned len; +local unsigned long crc32_little( + unsigned long crc, + const unsigned char FAR *buf, + unsigned len) { register u4 c; register const u4 FAR *buf4; @@ -307,10 +307,10 @@ local unsigned long crc32_little(crc, buf, len) #define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 /* ========================================================================= */ -local unsigned long crc32_big(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - unsigned len; +local unsigned long crc32_big( + unsigned long crc, + const unsigned char FAR *buf, + unsigned len) { register u4 c; register const u4 FAR *buf4; @@ -347,9 +347,9 @@ local unsigned long crc32_big(crc, buf, len) #define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */ /* ========================================================================= */ -local unsigned long gf2_matrix_times(mat, vec) - unsigned long *mat; - unsigned long vec; +local unsigned long gf2_matrix_times( + unsigned long *mat, + unsigned long vec) { unsigned long sum; @@ -364,9 +364,9 @@ local unsigned long gf2_matrix_times(mat, vec) } /* ========================================================================= */ -local void gf2_matrix_square(square, mat) - unsigned long *square; - unsigned long *mat; +local void gf2_matrix_square( + unsigned long *square, + unsigned long *mat) { int n; @@ -375,10 +375,10 @@ local void gf2_matrix_square(square, mat) } /* ========================================================================= */ -local uLong crc32_combine_(crc1, crc2, len2) - uLong crc1; - uLong crc2; - z_off64_t len2; +local uLong crc32_combine_( + uLong crc1, + uLong crc2, + z_off64_t len2) { int n; unsigned long row; @@ -431,18 +431,18 @@ local uLong crc32_combine_(crc1, crc2, len2) } /* ========================================================================= */ -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_combine_(crc1, crc2, len2); } -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) { return crc32_combine_(crc1, crc2, len2); } diff --git a/deflate.c b/deflate.c index 9e4c2cbc..8c921be4 100644 --- a/deflate.c +++ b/deflate.c @@ -198,11 +198,11 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); /* ========================================================================= */ -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); @@ -210,16 +210,15 @@ int ZEXPORT deflateInit_(strm, level, version, stream_size) } /* ========================================================================= */ -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; @@ -320,10 +319,10 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, } /* ========================================================================= */ -int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) - z_streamp strm; - const Bytef *dictionary; - uInt dictLength; +int ZEXPORT deflateSetDictionary ( + z_streamp strm, + const Bytef *dictionary, + uInt dictLength) { deflate_state *s; uInt str, n; @@ -389,8 +388,8 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateResetKeep (strm) - z_streamp strm; +int ZEXPORT deflateReset ( + z_streamp strm) { deflate_state *s; @@ -424,8 +423,7 @@ int ZEXPORT deflateResetKeep (strm) } /* ========================================================================= */ -int ZEXPORT deflateReset (strm) - z_streamp strm; +int ZEXPORT deflateReset (z_streamp strm) { int ret; @@ -436,9 +434,9 @@ int ZEXPORT deflateReset (strm) } /* ========================================================================= */ -int ZEXPORT deflateSetHeader (strm, head) - z_streamp strm; - gz_headerp head; +int ZEXPORT deflateSetHeader ( + z_streamp strm, + gz_headerp head) { if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; if (strm->state->wrap != 2) return Z_STREAM_ERROR; @@ -447,10 +445,10 @@ int ZEXPORT deflateSetHeader (strm, head) } /* ========================================================================= */ -int ZEXPORT deflatePending (strm, pending, bits) - unsigned *pending; - int *bits; - z_streamp strm; +int ZEXPORT deflatePending ( + z_streamp strm, + unsigned *pending, + int *bits) { if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; if (pending != Z_NULL) @@ -461,10 +459,10 @@ int ZEXPORT deflatePending (strm, pending, bits) } /* ========================================================================= */ -int ZEXPORT deflatePrime (strm, bits, value) - z_streamp strm; - int bits; - int value; +int ZEXPORT deflatePrime ( + z_streamp strm, + int bits, + int value) { deflate_state *s; int put; @@ -487,10 +485,10 @@ int ZEXPORT deflatePrime (strm, bits, value) } /* ========================================================================= */ -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; @@ -526,12 +524,12 @@ int ZEXPORT deflateParams(strm, level, strategy) } /* ========================================================================= */ -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; @@ -561,9 +559,9 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) * upper bound of about 14% expansion does not seem onerous for output buffer * allocation. */ -uLong ZEXPORT deflateBound(strm, sourceLen) - z_streamp strm; - uLong sourceLen; +uLong ZEXPORT deflateBound( + z_streamp strm, + uLong sourceLen) { deflate_state *s; uLong complen, wraplen; @@ -623,9 +621,9 @@ uLong ZEXPORT deflateBound(strm, sourceLen) * IN assertion: the stream state is correct and there is enough room in * pending_buf. */ -local void putShortMSB (s, b) - deflate_state *s; - uInt b; +local void putShortMSB ( + deflate_state *s, + uInt b) { put_byte(s, (Byte)(b >> 8)); put_byte(s, (Byte)(b & 0xff)); @@ -637,8 +635,8 @@ local void putShortMSB (s, b) * 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; @@ -660,9 +658,9 @@ local void flush_pending(strm) } /* ========================================================================= */ -int ZEXPORT deflate (strm, flush) - z_streamp strm; - int flush; +int ZEXPORT deflate ( + z_streamp strm, + int flush) { int old_flush; /* value of flush param for previous deflate call */ deflate_state *s; @@ -974,8 +972,8 @@ int ZEXPORT deflate (strm, flush) } /* ========================================================================= */ -int ZEXPORT deflateEnd (strm) - z_streamp strm; +int ZEXPORT deflateEnd ( + z_streamp strm) { int status; @@ -1009,9 +1007,9 @@ int ZEXPORT deflateEnd (strm) * To simplify the source, this is not supported for 16-bit MSDOS (which * doesn't have enough memory anyway to duplicate compression states). */ -int ZEXPORT deflateCopy (dest, source) - z_streamp dest; - z_streamp source; +int ZEXPORT deflateCopy ( + z_streamp dest, + z_streamp source) { #ifdef MAXSEG_64K return Z_STREAM_ERROR; @@ -1071,10 +1069,10 @@ int ZEXPORT deflateCopy (dest, source) * allocating a large strm->next_in buffer and copying from it. * (See also flush_pending()). */ -local int read_buf(strm, buf, size) - z_streamp strm; - Bytef *buf; - unsigned size; +local int read_buf( + z_streamp strm, + Bytef *buf, + unsigned size) { unsigned len = strm->avail_in; @@ -1101,8 +1099,8 @@ local int read_buf(strm, buf, size) /* =========================================================================== * Initialize the "longest match" routines for a new zlib stream */ -local void lm_init (s) - deflate_state *s; +local void lm_init ( + deflate_state *s) { s->window_size = (ulg)2L*s->w_size; @@ -1143,9 +1141,9 @@ local void lm_init (s) /* For 80x86 and 680x0, an optimized version will be provided in match.asm or * match.S. The code will be functionally equivalent. */ -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 */ @@ -1292,9 +1290,9 @@ local uInt longest_match(s, cur_match) /* --------------------------------------------------------------------------- * 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 */ @@ -1351,10 +1349,10 @@ local uInt longest_match(s, cur_match) /* =========================================================================== * 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, @@ -1385,8 +1383,8 @@ local void check_match(s, start, match, length) * performed for at least two bytes (required for the zip translate_eol * option -- not supported here). */ -local void fill_window(s) - deflate_state *s; +local void fill_window( + deflate_state *s) { register unsigned n, m; register Posf *p; @@ -1559,9 +1557,9 @@ local void fill_window(s) * NOTE: this function should be optimized to avoid extra copying from * window to pending_buf. */ -local block_state deflate_stored(s, flush) - deflate_state *s; - int flush; +local block_state deflate_stored( + deflate_state *s, + int flush) { /* Stored blocks are limited to 0xffff bytes, pending_buf is limited * to pending_buf_size, and each stored block has a 5 byte header: @@ -1623,9 +1621,9 @@ local block_state deflate_stored(s, flush) * 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 */ @@ -1725,9 +1723,9 @@ local block_state deflate_fast(s, flush) * 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 */ @@ -1856,9 +1854,9 @@ local block_state deflate_slow(s, flush) * 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 */ @@ -1929,9 +1927,9 @@ local block_state deflate_rle(s, flush) * 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 --git a/gzclose.c b/gzclose.c index caeb99a3..0f010b84 100644 --- a/gzclose.c +++ b/gzclose.c @@ -8,8 +8,8 @@ /* 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 --git a/gzlib.c b/gzlib.c index 4732fcc0..38d4f46b 100644 --- a/gzlib.c +++ b/gzlib.c @@ -30,8 +30,8 @@ local gzFile gz_open OF((const char *, int, const char *)); The gz_strwinerror function does not change the current setting of GetLastError. */ -char ZLIB_INTERNAL *gz_strwinerror (error) - DWORD error; +char ZLIB_INTERNAL *gz_strwinerror ( + DWORD error) { static char buf[1024]; @@ -72,8 +72,8 @@ char ZLIB_INTERNAL *gz_strwinerror (error) #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 ... */ @@ -88,10 +88,10 @@ local void gz_reset(state) } /* Open a gzip file either by name or file descriptor. */ -local gzFile gz_open(path, fd, mode) - const char *path; - int fd; - const char *mode; +local gzFile gz_open( + const char *path, + int fd, + const char *mode) { gz_statep state; int cloexec = 0, exclusive = 0; @@ -226,25 +226,25 @@ local gzFile gz_open(path, fd, mode) } /* -- 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; @@ -258,9 +258,9 @@ gzFile ZEXPORT gzdopen(fd, mode) } /* -- see zlib.h -- */ -int ZEXPORT gzbuffer(file, size) - gzFile file; - unsigned size; +int ZEXPORT gzbuffer( + gzFile file, + unsigned size) { gz_statep state; @@ -283,8 +283,8 @@ int ZEXPORT gzbuffer(file, size) } /* -- see zlib.h -- */ -int ZEXPORT gzrewind(file) - gzFile file; +int ZEXPORT gzrewind( + gzFile file) { gz_statep state; @@ -306,10 +306,10 @@ int ZEXPORT gzrewind(file) } /* -- 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; @@ -383,10 +383,10 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence) } /* -- 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; @@ -395,8 +395,8 @@ z_off_t ZEXPORT gzseek(file, offset, whence) } /* -- see zlib.h -- */ -z_off64_t ZEXPORT gztell64(file) - gzFile file; +z_off64_t ZEXPORT gztell64( + gzFile file) { gz_statep state; @@ -412,8 +412,8 @@ z_off64_t ZEXPORT gztell64(file) } /* -- see zlib.h -- */ -z_off_t ZEXPORT gztell(file) - gzFile file; +z_off_t ZEXPORT gztell( + gzFile file) { z_off64_t ret; @@ -422,8 +422,8 @@ z_off_t ZEXPORT gztell(file) } /* -- 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; @@ -445,8 +445,8 @@ z_off64_t ZEXPORT gzoffset64(file) } /* -- see zlib.h -- */ -z_off_t ZEXPORT gzoffset(file) - gzFile file; +z_off_t ZEXPORT gzoffset( + gzFile file) { z_off64_t ret; @@ -455,8 +455,8 @@ z_off_t ZEXPORT gzoffset(file) } /* -- see zlib.h -- */ -int ZEXPORT gzeof(file) - gzFile file; +int ZEXPORT gzeof( + gzFile file) { gz_statep state; @@ -472,9 +472,9 @@ int ZEXPORT gzeof(file) } /* -- see zlib.h -- */ -const char * ZEXPORT gzerror(file, errnum) - gzFile file; - int *errnum; +const char * ZEXPORT gzerror( + gzFile file, + int *errnum) { gz_statep state; @@ -492,8 +492,8 @@ const char * ZEXPORT gzerror(file, errnum) } /* -- see zlib.h -- */ -void ZEXPORT gzclearerr(file) - gzFile file; +void ZEXPORT gzclearerr( + gzFile file) { gz_statep state; @@ -518,10 +518,10 @@ void ZEXPORT gzclearerr(file) 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) { @@ -562,7 +562,7 @@ void ZLIB_INTERNAL gz_error(state, err, msg) available) -- we need to do this to cover cases where 2's complement not used, since C standard permits 1's complement and sign-bit representations, otherwise we could just use ((unsigned)-1) >> 1 */ -unsigned ZLIB_INTERNAL gz_intmax() +unsigned ZLIB_INTERNAL gz_intmax(void) { unsigned p, q; diff --git a/gzread.c b/gzread.c index 3493d34d..6d469253 100644 --- a/gzread.c +++ b/gzread.c @@ -17,11 +17,11 @@ local int gz_skip OF((gz_statep, z_off64_t)); 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; @@ -48,8 +48,8 @@ local int gz_load(state, buf, len, have) 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); @@ -82,8 +82,8 @@ local int gz_avail(state) 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); @@ -168,8 +168,8 @@ local int gz_look(state) 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; @@ -222,8 +222,8 @@ local int gz_decomp(state) 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); @@ -252,9 +252,9 @@ local int gz_fetch(state) } /* 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; @@ -284,10 +284,10 @@ local int gz_skip(state, len) } /* -- see zlib.h -- */ -int ZEXPORT gzread(file, buf, len) - gzFile file; - voidp buf; - unsigned len; +int ZEXPORT gzread( + gzFile file, + voidp buf, + unsigned len) { unsigned got, n; gz_statep state; @@ -379,8 +379,8 @@ int ZEXPORT gzread(file, buf, len) /* -- see zlib.h -- */ #undef gzgetc -int ZEXPORT gzgetc(file) - gzFile file; +int ZEXPORT gzgetc( + gzFile file) { int ret; unsigned char buf[1]; @@ -408,16 +408,16 @@ int ZEXPORT gzgetc(file) return ret < 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; @@ -475,10 +475,10 @@ int ZEXPORT gzungetc(c, file) } /* -- 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; @@ -539,8 +539,8 @@ char * ZEXPORT gzgets(file, buf, len) } /* -- see zlib.h -- */ -int ZEXPORT gzdirect(file) - gzFile file; +int ZEXPORT gzdirect( + gzFile file) { gz_statep state; @@ -559,8 +559,8 @@ int ZEXPORT gzdirect(file) } /* -- see zlib.h -- */ -int ZEXPORT gzclose_r(file) - gzFile file; +int ZEXPORT gzclose_r( + gzFile file) { int ret, err; gz_statep state; diff --git a/gzwrite.c b/gzwrite.c index 27cb3428..435b2c93 100644 --- a/gzwrite.c +++ b/gzwrite.c @@ -12,8 +12,8 @@ local int gz_zero OF((gz_statep, z_off64_t)); /* Initialize state for writing a gzip file. Mark initialization by setting state->size to non-zero. Return -1 on 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); @@ -67,9 +67,9 @@ local int gz_init(state) 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, got; unsigned have; @@ -130,9 +130,9 @@ local int gz_comp(state, flush) } /* Compress len zeros to output. Return -1 on error, 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; @@ -162,10 +162,10 @@ local int gz_zero(state, len) } /* -- see zlib.h -- */ -int ZEXPORT gzwrite(file, buf, len) - gzFile file; - voidpc buf; - unsigned len; +int ZEXPORT gzwrite( + gzFile file, + voidpc buf, + unsigned len) { unsigned put = len; unsigned n; @@ -240,9 +240,9 @@ int ZEXPORT gzwrite(file, buf, len) } /* -- see zlib.h -- */ -int ZEXPORT gzputc(file, c) - gzFile file; - int c; +int ZEXPORT gzputc( + gzFile file, + int c) { unsigned char buf[1]; gz_statep state; @@ -283,9 +283,9 @@ int ZEXPORT gzputc(file, c) } /* -- see zlib.h -- */ -int ZEXPORT gzputs(file, str) - gzFile file; - const char *str; +int ZEXPORT gzputs( + gzFile file, + const char *str) { int ret; unsigned len; @@ -450,9 +450,9 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, #endif /* -- see zlib.h -- */ -int ZEXPORT gzflush(file, flush) - gzFile file; - int flush; +int ZEXPORT gzflush( + gzFile file, + int flush) { gz_statep state; @@ -482,10 +482,10 @@ int ZEXPORT gzflush(file, flush) } /* -- 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; @@ -524,8 +524,8 @@ int ZEXPORT gzsetparams(file, level, strategy) } /* -- see zlib.h -- */ -int ZEXPORT gzclose_w(file) - gzFile file; +int ZEXPORT gzclose_w( + gzFile file) { int ret = Z_OK; gz_statep state; diff --git a/infback.c b/infback.c index 981aff17..f3d0a680 100644 --- a/infback.c +++ b/infback.c @@ -25,12 +25,12 @@ local void fixedtables OF((struct inflate_state FAR *state)); 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; @@ -79,8 +79,8 @@ int stream_size; 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; @@ -247,12 +247,12 @@ struct inflate_state FAR *state; 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; unsigned char FAR *next; /* next input */ @@ -628,8 +628,8 @@ void FAR *out_desc; 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 --git a/inffast.c b/inffast.c index 2f1d60b4..4fb467df 100644 --- a/inffast.c +++ b/inffast.c @@ -64,9 +64,9 @@ 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; unsigned char FAR *in; /* local strm->next_in */ diff --git a/inflate.c b/inflate.c index 47418a1e..5ad6e9fa 100644 --- a/inflate.c +++ b/inflate.c @@ -100,8 +100,8 @@ local int updatewindow OF((z_streamp strm, unsigned out)); local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, unsigned len)); -int ZEXPORT inflateResetKeep(strm) -z_streamp strm; +int ZEXPORT inflateReset( +z_streamp strm) { struct inflate_state FAR *state; @@ -125,8 +125,8 @@ z_streamp strm; return Z_OK; } -int ZEXPORT inflateReset(strm) -z_streamp strm; +int ZEXPORT inflateReset( + z_streamp strm) { struct inflate_state FAR *state; @@ -138,9 +138,9 @@ z_streamp strm; 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; @@ -176,11 +176,11 @@ int windowBits; 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; @@ -218,18 +218,18 @@ int stream_size; 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; @@ -257,8 +257,8 @@ int value; 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; @@ -375,9 +375,9 @@ void makefixed() 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, out) -z_streamp strm; -unsigned out; +local int updatewindow( +z_streamp strm, +unsigned out) { struct inflate_state FAR *state; unsigned copy, dist; @@ -601,9 +601,9 @@ unsigned out; 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; unsigned char FAR *next; /* next input */ @@ -1250,8 +1250,8 @@ int flush; return ret; } -int ZEXPORT inflateEnd(strm) -z_streamp strm; +int ZEXPORT inflateEnd( +z_streamp strm) { struct inflate_state FAR *state; if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) @@ -1264,10 +1264,10 @@ z_streamp strm; 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; @@ -1307,9 +1307,9 @@ uInt dictLength; 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; @@ -1335,10 +1335,10 @@ gz_headerp head; 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; -unsigned char FAR *buf; -unsigned len; +local unsigned syncsearch( +unsigned FAR *have, +unsigned char FAR *buf, +unsigned len) { unsigned got; unsigned next; @@ -1358,8 +1358,8 @@ unsigned len; 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 */ unsigned long in, out; /* temporary to save total_in and total_out */ @@ -1409,8 +1409,8 @@ z_streamp strm; 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; @@ -1419,9 +1419,9 @@ z_streamp strm; 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; @@ -1466,9 +1466,9 @@ z_streamp source; 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; @@ -1483,8 +1483,8 @@ int subvert; #endif } -long ZEXPORT inflateMark(strm) -z_streamp strm; +long ZEXPORT inflateMark( +z_streamp strm) { struct inflate_state FAR *state; diff --git a/inftrees.c b/inftrees.c index abcd7c45..f6611486 100644 --- a/inftrees.c +++ b/inftrees.c @@ -29,13 +29,13 @@ const char inflate_copyright[] = 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 --git a/test/example.c b/test/example.c index f515a485..b2e49032 100644 --- a/test/example.c +++ b/test/example.c @@ -55,9 +55,9 @@ int main OF((int argc, char *argv[])); 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, m) { q = Z_NULL; return calloc(n, m); @@ -85,9 +85,9 @@ void test_gzio OF((const char *fname, /* =========================================================================== * 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 +111,10 @@ void test_compress(compr, comprLen, uncompr, uncomprLen) /* =========================================================================== * 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 +197,9 @@ void test_gzio(fname, uncompr, uncomprLen) /* =========================================================================== * 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 +235,11 @@ void test_deflate(compr, comprLen) /* =========================================================================== * 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 +278,11 @@ void test_inflate(compr, comprLen, uncompr, uncomprLen) /* =========================================================================== * 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 +335,11 @@ void test_large_deflate(compr, comprLen, uncompr, uncomprLen) /* =========================================================================== * 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 +378,9 @@ void test_large_inflate(compr, comprLen, uncompr, uncomprLen) /* =========================================================================== * 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 +416,11 @@ void test_flush(compr, comprLen) /* =========================================================================== * 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 */ @@ -454,9 +462,9 @@ void test_sync(compr, comprLen, uncompr, uncomprLen) /* =========================================================================== * 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; @@ -491,9 +499,11 @@ void test_dict_deflate(compr, comprLen) /* =========================================================================== * 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 */ @@ -542,9 +552,9 @@ void test_dict_inflate(compr, comprLen, uncompr, uncomprLen) * 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 --git a/test/minigzip.c b/test/minigzip.c index aa7ac7a0..5374220a 100644 --- a/test/minigzip.c +++ b/test/minigzip.c @@ -73,8 +73,8 @@ The strwinerror function does not change the current setting of GetLastError. */ -static char *strwinerror (error) - DWORD error; +static char *strwinerror ( + DWORD error) { static char buf[1024]; @@ -112,8 +112,8 @@ static char *strwinerror (error) return buf; } -static void pwinerror (s) - const char *s; +static void pwinerror ( + const char *s) { if (s && *s) fprintf(stderr, "%s: %s\n", s, strwinerror(GetLastError ())); @@ -145,19 +145,16 @@ static void pwinerror (s) # include /* for unlink() */ #endif -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) { q = Z_NULL; return calloc(n, m); } -void myfree(q, p) - void *q, *p; +void myfree( + void *q, void *p) { q = Z_NULL; free(p); @@ -171,28 +168,24 @@ typedef struct gzFile_s { z_stream strm; } *gzFile; -gzFile gzopen OF((const char *, const char *)); -gzFile gzdopen OF((int, const char *)); -gzFile gz_open OF((const char *, int, const char *)); - -gzFile gzopen(path, mode) -const char *path; -const char *mode; +gzFile gzopen( +const char *path, +const char *mode) { return gz_open(path, -1, mode); } -gzFile gzdopen(fd, mode) -int fd; -const char *mode; +gzFile gzdopen( +int fd, +const char *mode) { return gz_open(NULL, fd, mode); } -gzFile gz_open(path, fd, mode) - const char *path; - int fd; - const char *mode; +gzFile gz_open( + const char *path, + int fd, + const char *mode) { gzFile gz; int ret; @@ -227,12 +220,10 @@ gzFile gz_open(path, fd, mode) return gz; } -int gzwrite OF((gzFile, const void *, unsigned)); - -int gzwrite(gz, buf, len) - gzFile gz; - const void *buf; - unsigned len; +int gzwrite( + gzFile gz, + const void *buf, + unsigned len) { z_stream *strm; unsigned char out[BUFLEN]; @@ -251,12 +242,10 @@ int gzwrite(gz, buf, len) return len; } -int gzread OF((gzFile, void *, unsigned)); - -int gzread(gz, buf, len) - gzFile gz; - void *buf; - unsigned len; +int gzread( + gzFile gz, + void *buf, + unsigned len) { int ret; unsigned got; @@ -288,10 +277,8 @@ int gzread(gz, buf, len) return len - strm->avail_out; } -int gzclose OF((gzFile)); - -int gzclose(gz) - gzFile gz; +int gzclose( + gzFile gz) { z_stream *strm; unsigned char out[BUFLEN]; @@ -317,11 +304,9 @@ int gzclose(gz) return Z_OK; } -const char *gzerror OF((gzFile, int *)); - -const char *gzerror(gz, err) - gzFile gz; - int *err; +const char *gzerror( + gzFile gz, + int *err) { *err = gz->err; return gz->msg; @@ -331,21 +316,15 @@ const char *gzerror(gz, err) char *prog; -void error OF((const char *msg)); -void gz_compress OF((FILE *in, gzFile out)); #ifdef USE_MMAP int gz_compress_mmap OF((FILE *in, gzFile out)); #endif -void gz_uncompress OF((gzFile in, FILE *out)); -void file_compress OF((char *file, char *mode)); -void file_uncompress OF((char *file)); -int main OF((int argc, char *argv[])); /* =========================================================================== * Display error message and exit */ -void error(msg) - const char *msg; +void error( + const char *msg) { fprintf(stderr, "%s: %s\n", prog, msg); exit(1); @@ -355,9 +334,9 @@ void error(msg) * Compress input to output then close both files. */ -void gz_compress(in, out) - FILE *in; - gzFile out; +void gz_compress( + FILE *in, + gzFile out) { local char buf[BUFLEN]; int len; @@ -388,9 +367,9 @@ void gz_compress(in, out) /* Try compressing the input file at once using mmap. Return Z_OK if * if success, Z_ERRNO otherwise. */ -int gz_compress_mmap(in, out) - FILE *in; - gzFile out; +int gz_compress_mmap( + FILE *in, + gzFile out) { int len; int err; @@ -423,9 +402,9 @@ int gz_compress_mmap(in, out) /* =========================================================================== * Uncompress input to output then close both files. */ -void gz_uncompress(in, out) - gzFile in; - FILE *out; +void gz_uncompress( + gzFile in, + FILE *out) { local char buf[BUFLEN]; int len; @@ -450,9 +429,9 @@ void gz_uncompress(in, out) * Compress the given file: create a corresponding .gz file and remove the * original. */ -void file_compress(file, mode) - char *file; - char *mode; +void file_compress( + char *file, + char *mode) { local char outfile[MAX_NAME_LEN]; FILE *in; @@ -485,8 +464,8 @@ void file_compress(file, mode) /* =========================================================================== * Uncompress the given file and remove the original. */ -void file_uncompress(file) - char *file; +void file_uncompress( + char *file) { local char buf[MAX_NAME_LEN]; char *infile, *outfile; @@ -537,9 +516,9 @@ void file_uncompress(file) * -1 to -9 : compression level */ -int main(argc, argv) - int argc; - char *argv[]; +int main( + int argc, + char *argv[]) { int copyout = 0; int uncompr = 0; diff --git a/trees.c b/trees.c index 8c32b214..014f2d82 100644 --- a/trees.c +++ b/trees.c @@ -185,10 +185,10 @@ local void gen_trees_header OF((void)); #ifdef 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"); @@ -231,7 +231,7 @@ local void send_bits(s, value, length) /* =========================================================================== * Initialize the various 'constant' tables. */ -local void tr_static_init() +local void tr_static_init(void) { #if defined(GEN_TREES_H) || !defined(STDC) static int static_init_done = 0; @@ -325,7 +325,7 @@ local void tr_static_init() ((i) == (last)? "\n};\n\n" : \ ((i) % (width) == (width)-1 ? ",\n" : ", ")) -void gen_trees_header() +void gen_trees_header(void) { FILE *header = fopen("trees.h", "w"); int i; @@ -378,8 +378,8 @@ void gen_trees_header() /* =========================================================================== * 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(); @@ -406,8 +406,8 @@ void ZLIB_INTERNAL _tr_init(s) /* =========================================================================== * 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 */ @@ -450,10 +450,10 @@ local void init_block(s) * 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 */ @@ -485,9 +485,9 @@ local void pqdownheap(s, tree, k) * 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; @@ -572,10 +572,10 @@ local void gen_bitlen(s, desc) * 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 */ ush code = 0; /* running code value */ @@ -614,9 +614,9 @@ local void gen_codes (tree, max_code, bl_count) * 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; @@ -702,10 +702,10 @@ local void build_tree(s, desc) * 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 */ @@ -747,10 +747,10 @@ local void scan_tree (s, tree, max_code) * 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 */ @@ -798,8 +798,8 @@ local void send_tree (s, tree, max_code) * 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 */ @@ -833,9 +833,9 @@ local int build_bl_tree(s) * 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, + int lcodes, int dcodes, int blcodes) /* number of codes for each tree */ { int rank; /* index in bl_order */ @@ -862,11 +862,11 @@ local void send_all_trees(s, lcodes, dcodes, blcodes) /* =========================================================================== * 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 */ #ifdef DEBUG @@ -879,8 +879,8 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) /* =========================================================================== * 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); } @@ -889,8 +889,8 @@ void ZLIB_INTERNAL _tr_flush_bits(s) * 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); @@ -904,11 +904,11 @@ void ZLIB_INTERNAL _tr_align(s) * Determine the best encoding for the current block: dynamic trees, static * trees or store, and output the encoded block to the zip file. */ -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 */ @@ -1005,10 +1005,10 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) * 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 (if 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 (if dist==0) */ { s->d_buf[s->last_lit] = (ush)dist; s->l_buf[s->last_lit++] = (uch)lc; @@ -1055,10 +1055,10 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc) /* =========================================================================== * Send the block data compressed using the given Huffman trees */ -local void compress_block(s, ltree, dtree) - deflate_state *s; - ct_data *ltree; /* literal tree */ - ct_data *dtree; /* distance tree */ +local void compress_block( + deflate_state *s, + ct_data *ltree, /* literal tree */ + ct_data *dtree) /* distance tree */ { unsigned dist; /* distance of matched string */ int lc; /* match length or unmatched char (if dist == 0) */ @@ -1115,8 +1115,8 @@ local void compress_block(s, ltree, dtree) * (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) { /* black_mask is the bit mask of black-listed bytes * set bits 0..6, 14..25, and 28..31 @@ -1149,9 +1149,9 @@ local int detect_data_type(s) * 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 { @@ -1164,8 +1164,8 @@ local unsigned bi_reverse(code, len) /* =========================================================================== * 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); @@ -1181,8 +1181,8 @@ local void bi_flush(s) /* =========================================================================== * 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); @@ -1200,11 +1200,11 @@ local void bi_windup(s) * Copy a stored block, storing first the length and its * one's complement if requested. */ -local void copy_block(s, buf, len, header) - deflate_state *s; - charf *buf; /* the input data */ - unsigned len; /* its length */ - int header; /* true if block header must be written */ +local void copy_block( + deflate_state *s, + charf *buf, /* the input data */ + unsigned len, /* its length */ + int header) /* true if block header must be written */ { bi_windup(s); /* align on byte boundary */ diff --git a/uncompr.c b/uncompr.c index ad98be3a..9b272e98 100644 --- a/uncompr.c +++ b/uncompr.c @@ -21,11 +21,11 @@ enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, or Z_DATA_ERROR if the input data was corrupted. */ -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) { z_stream stream; int err; diff --git a/zutil.c b/zutil.c index 65e0d3b7..0d32d797 100644 --- a/zutil.c +++ b/zutil.c @@ -122,8 +122,8 @@ uLong ZEXPORT zlibCompileFlags() # endif int ZLIB_INTERNAL z_verbose = verbose; -void ZLIB_INTERNAL z_error (m) - char *m; +void ZLIB_INTERNAL z_error ( + char *m) { fprintf(stderr, "%s\n", m); exit(1); @@ -133,8 +133,7 @@ void ZLIB_INTERNAL z_error (m) /* 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); } @@ -149,10 +148,10 @@ const char * ZEXPORT zError(err) #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 { @@ -160,10 +159,10 @@ void ZLIB_INTERNAL zmemcpy(dest, source, len) } 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; @@ -173,9 +172,9 @@ int ZLIB_INTERNAL zmemcmp(s1, s2, len) 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 { @@ -301,19 +300,19 @@ extern voidp calloc OF((uInt items, uInt size)); 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) { if (opaque) items += size - size; /* make compiler happy */ 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) { free(ptr); if (opaque) return; /* make compiler happy */