aboutsummaryrefslogtreecommitdiff
path: root/compress.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2023-04-14 01:42:03 -0700
committerMark Adler <madler@alumni.caltech.edu>2023-04-15 21:17:31 -0700
commite9d5486e6635141f589e110fd789648aa08e9544 (patch)
treea78b9ccd92b05af7cd5776b688d9c3eb3a81a40a /compress.c
parent5799c14c8526bf1aaa130c021982f831d155b46d (diff)
downloadzlib-e9d5486e6635141f589e110fd789648aa08e9544.tar.gz
zlib-e9d5486e6635141f589e110fd789648aa08e9544.tar.bz2
zlib-e9d5486e6635141f589e110fd789648aa08e9544.zip
Remove K&R function definitions from zlib.
C2X has removed K&R definitions from the C function syntax. Though the standard has not yet been approved, some high-profile compilers are now issuing warnings when such definitions are encountered.
Diffstat (limited to 'compress.c')
-rw-r--r--compress.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/compress.c b/compress.c
index 2ad5326..f43bacf 100644
--- a/compress.c
+++ b/compress.c
@@ -19,13 +19,8 @@
19 memory, Z_BUF_ERROR if there was not enough room in the output buffer, 19 memory, Z_BUF_ERROR if there was not enough room in the output buffer,
20 Z_STREAM_ERROR if the level parameter is invalid. 20 Z_STREAM_ERROR if the level parameter is invalid.
21*/ 21*/
22int ZEXPORT compress2(dest, destLen, source, sourceLen, level) 22int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
23 Bytef *dest; 23 uLong sourceLen, int level) {
24 uLongf *destLen;
25 const Bytef *source;
26 uLong sourceLen;
27 int level;
28{
29 z_stream stream; 24 z_stream stream;
30 int err; 25 int err;
31 const uInt max = (uInt)-1; 26 const uInt max = (uInt)-1;
@@ -65,12 +60,8 @@ int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
65 60
66/* =========================================================================== 61/* ===========================================================================
67 */ 62 */
68int ZEXPORT compress(dest, destLen, source, sourceLen) 63int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
69 Bytef *dest; 64 uLong sourceLen) {
70 uLongf *destLen;
71 const Bytef *source;
72 uLong sourceLen;
73{
74 return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 65 return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
75} 66}
76 67
@@ -78,9 +69,7 @@ int ZEXPORT compress(dest, destLen, source, sourceLen)
78 If the default memLevel or windowBits for deflateInit() is changed, then 69 If the default memLevel or windowBits for deflateInit() is changed, then
79 this function needs to be updated. 70 this function needs to be updated.
80 */ 71 */
81uLong ZEXPORT compressBound(sourceLen) 72uLong ZEXPORT compressBound(uLong sourceLen) {
82 uLong sourceLen;
83{
84 return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 73 return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
85 (sourceLen >> 25) + 13; 74 (sourceLen >> 25) + 13;
86} 75}