Skip to content

Commit 38f6e0d

Browse files
nodejs-github-botruyadorno
authored andcommittedAug 29, 2023
deps: update zlib to 982b036
PR-URL: #48327 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
1 parent f35c4d3 commit 38f6e0d

25 files changed

+910
-1564
lines changed
 

‎deps/zlib/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ component("zlib") {
359359
if (is_android) {
360360
import("//build/config/android/config.gni")
361361
if (defined(android_ndk_root) && android_ndk_root != "") {
362-
deps += [ "//third_party/android_ndk:cpu_features" ]
362+
deps += [ "//third_party/cpu_features:ndk_compat" ]
363363
} else {
364364
assert(false, "CPU detection requires the Android NDK")
365365
}

‎deps/zlib/adler32.c

+5-27
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
#include "zutil.h"
99

10-
local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
11-
1210
#define BASE 65521U /* largest prime smaller than 65536 */
1311
#define NMAX 5552
1412
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
@@ -65,11 +63,7 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
6563
#endif
6664

6765
/* ========================================================================= */
68-
uLong ZEXPORT adler32_z(adler, buf, len)
69-
uLong adler;
70-
const Bytef *buf;
71-
z_size_t len;
72-
{
66+
uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
7367
unsigned long sum2;
7468
unsigned n;
7569

@@ -159,20 +153,12 @@ uLong ZEXPORT adler32_z(adler, buf, len)
159153
}
160154

161155
/* ========================================================================= */
162-
uLong ZEXPORT adler32(adler, buf, len)
163-
uLong adler;
164-
const Bytef *buf;
165-
uInt len;
166-
{
156+
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
167157
return adler32_z(adler, buf, len);
168158
}
169159

170160
/* ========================================================================= */
171-
local uLong adler32_combine_(adler1, adler2, len2)
172-
uLong adler1;
173-
uLong adler2;
174-
z_off64_t len2;
175-
{
161+
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) {
176162
unsigned long sum1;
177163
unsigned long sum2;
178164
unsigned rem;
@@ -197,18 +183,10 @@ local uLong adler32_combine_(adler1, adler2, len2)
197183
}
198184

199185
/* ========================================================================= */
200-
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
201-
uLong adler1;
202-
uLong adler2;
203-
z_off_t len2;
204-
{
186+
uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) {
205187
return adler32_combine_(adler1, adler2, len2);
206188
}
207189

208-
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
209-
uLong adler1;
210-
uLong adler2;
211-
z_off64_t len2;
212-
{
190+
uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) {
213191
return adler32_combine_(adler1, adler2, len2);
214192
}

‎deps/zlib/compress.c

+5-16
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,8 @@
1919
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
2020
Z_STREAM_ERROR if the level parameter is invalid.
2121
*/
22-
int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
23-
Bytef *dest;
24-
uLongf *destLen;
25-
const Bytef *source;
26-
uLong sourceLen;
27-
int level;
28-
{
22+
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
23+
uLong sourceLen, int level) {
2924
z_stream stream;
3025
int err;
3126
const uInt max = (uInt)-1;
@@ -65,22 +60,16 @@ int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
6560

6661
/* ===========================================================================
6762
*/
68-
int ZEXPORT compress(dest, destLen, source, sourceLen)
69-
Bytef *dest;
70-
uLongf *destLen;
71-
const Bytef *source;
72-
uLong sourceLen;
73-
{
63+
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
64+
uLong sourceLen) {
7465
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
7566
}
7667

7768
/* ===========================================================================
7869
If the default memLevel or windowBits for deflateInit() is changed, then
7970
this function needs to be updated.
8071
*/
81-
uLong ZEXPORT compressBound(sourceLen)
82-
uLong sourceLen;
83-
{
72+
uLong ZEXPORT compressBound(uLong sourceLen) {
8473
sourceLen = sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
8574
(sourceLen >> 25) + 13;
8675
/* FIXME(cavalcantii): usage of CRC32 Castagnoli as a hash function

‎deps/zlib/contrib/optimizations/inffast_chunk.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,7 @@
7272
requires strm->avail_out >= 260 for each loop to avoid checking for
7373
available output space while decoding.
7474
*/
75-
void ZLIB_INTERNAL inflate_fast_chunk_(strm, start)
76-
z_streamp strm;
77-
unsigned start; /* inflate()'s starting value for strm->avail_out */
78-
{
75+
void ZLIB_INTERNAL inflate_fast_chunk_(z_streamp strm, unsigned start) {
7976
struct inflate_state FAR *state;
8077
z_const unsigned char FAR *in; /* local strm->next_in */
8178
z_const unsigned char FAR *last; /* have enough input while in < last */

‎deps/zlib/contrib/optimizations/inffast_chunk.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
#define INFLATE_FAST_MIN_OUTPUT 260
4040
#endif
4141

42-
void ZLIB_INTERNAL inflate_fast_chunk_ OF((z_streamp strm, unsigned start));
42+
void ZLIB_INTERNAL inflate_fast_chunk_(z_streamp strm, unsigned start);

‎deps/zlib/contrib/optimizations/inflate.c

+28-99
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,7 @@
9292
# endif
9393
#endif
9494

95-
/* function prototypes */
96-
local int inflateStateCheck OF((z_streamp strm));
97-
local void fixedtables OF((struct inflate_state FAR *state));
98-
local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
99-
unsigned copy));
100-
#ifdef BUILDFIXED
101-
void makefixed OF((void));
102-
#endif
103-
local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
104-
unsigned len));
105-
106-
local int inflateStateCheck(strm)
107-
z_streamp strm;
108-
{
95+
local int inflateStateCheck(z_streamp strm) {
10996
struct inflate_state FAR *state;
11097
if (strm == Z_NULL ||
11198
strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
@@ -117,9 +104,7 @@ z_streamp strm;
117104
return 0;
118105
}
119106

120-
int ZEXPORT inflateResetKeep(strm)
121-
z_streamp strm;
122-
{
107+
int ZEXPORT inflateResetKeep(z_streamp strm) {
123108
struct inflate_state FAR *state;
124109

125110
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -143,9 +128,7 @@ z_streamp strm;
143128
return Z_OK;
144129
}
145130

146-
int ZEXPORT inflateReset(strm)
147-
z_streamp strm;
148-
{
131+
int ZEXPORT inflateReset(z_streamp strm) {
149132
struct inflate_state FAR *state;
150133

151134
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -156,10 +139,7 @@ z_streamp strm;
156139
return inflateResetKeep(strm);
157140
}
158141

159-
int ZEXPORT inflateReset2(strm, windowBits)
160-
z_streamp strm;
161-
int windowBits;
162-
{
142+
int ZEXPORT inflateReset2(z_streamp strm, int windowBits) {
163143
int wrap;
164144
struct inflate_state FAR *state;
165145

@@ -196,12 +176,8 @@ int windowBits;
196176
return inflateReset(strm);
197177
}
198178

199-
int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
200-
z_streamp strm;
201-
int windowBits;
202-
const char *version;
203-
int stream_size;
204-
{
179+
int ZEXPORT inflateInit2_(z_streamp strm, int windowBits,
180+
const char *version, int stream_size) {
205181
int ret;
206182
struct inflate_state FAR *state;
207183

@@ -241,19 +217,12 @@ int stream_size;
241217
return ret;
242218
}
243219

244-
int ZEXPORT inflateInit_(strm, version, stream_size)
245-
z_streamp strm;
246-
const char *version;
247-
int stream_size;
248-
{
220+
int ZEXPORT inflateInit_(z_streamp strm, const char *version,
221+
int stream_size) {
249222
return inflateInit2_(strm, DEF_WBITS, version, stream_size);
250223
}
251224

252-
int ZEXPORT inflatePrime(strm, bits, value)
253-
z_streamp strm;
254-
int bits;
255-
int value;
256-
{
225+
int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) {
257226
struct inflate_state FAR *state;
258227

259228
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -282,9 +251,7 @@ int value;
282251
used for threaded applications, since the rewriting of the tables and virgin
283252
may not be thread-safe.
284253
*/
285-
local void fixedtables(state)
286-
struct inflate_state FAR *state;
287-
{
254+
local void fixedtables(struct inflate_state FAR *state) {
288255
#ifdef BUILDFIXED
289256
static int virgin = 1;
290257
static code *lenfix, *distfix;
@@ -346,7 +313,7 @@ struct inflate_state FAR *state;
346313
347314
a.out > inffixed.h
348315
*/
349-
void makefixed()
316+
void makefixed(void)
350317
{
351318
unsigned low, size;
352319
struct inflate_state state;
@@ -400,11 +367,7 @@ void makefixed()
400367
output will fall in the output data, making match copies simpler and faster.
401368
The advantage may be dependent on the size of the processor's data caches.
402369
*/
403-
local int updatewindow(strm, end, copy)
404-
z_streamp strm;
405-
const Bytef *end;
406-
unsigned copy;
407-
{
370+
local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) {
408371
struct inflate_state FAR *state;
409372
unsigned dist;
410373

@@ -636,10 +599,7 @@ unsigned copy;
636599
will return Z_BUF_ERROR if it has not reached the end of the stream.
637600
*/
638601

639-
int ZEXPORT inflate(strm, flush)
640-
z_streamp strm;
641-
int flush;
642-
{
602+
int ZEXPORT inflate(z_streamp strm, int flush) {
643603
struct inflate_state FAR *state;
644604
z_const unsigned char FAR *next; /* next input */
645605
unsigned char FAR *put; /* next output */
@@ -1338,9 +1298,7 @@ int flush;
13381298
return ret;
13391299
}
13401300

1341-
int ZEXPORT inflateEnd(strm)
1342-
z_streamp strm;
1343-
{
1301+
int ZEXPORT inflateEnd(z_streamp strm) {
13441302
struct inflate_state FAR *state;
13451303
if (inflateStateCheck(strm))
13461304
return Z_STREAM_ERROR;
@@ -1352,11 +1310,8 @@ z_streamp strm;
13521310
return Z_OK;
13531311
}
13541312

1355-
int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
1356-
z_streamp strm;
1357-
Bytef *dictionary;
1358-
uInt *dictLength;
1359-
{
1313+
int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary,
1314+
uInt *dictLength) {
13601315
struct inflate_state FAR *state;
13611316

13621317
/* check state */
@@ -1375,11 +1330,8 @@ uInt *dictLength;
13751330
return Z_OK;
13761331
}
13771332

1378-
int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
1379-
z_streamp strm;
1380-
const Bytef *dictionary;
1381-
uInt dictLength;
1382-
{
1333+
int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary,
1334+
uInt dictLength) {
13831335
struct inflate_state FAR *state;
13841336
unsigned long dictid;
13851337
int ret;
@@ -1410,10 +1362,7 @@ uInt dictLength;
14101362
return Z_OK;
14111363
}
14121364

1413-
int ZEXPORT inflateGetHeader(strm, head)
1414-
z_streamp strm;
1415-
gz_headerp head;
1416-
{
1365+
int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head) {
14171366
struct inflate_state FAR *state;
14181367

14191368
/* check state */
@@ -1438,11 +1387,8 @@ gz_headerp head;
14381387
called again with more data and the *have state. *have is initialized to
14391388
zero for the first call.
14401389
*/
1441-
local unsigned syncsearch(have, buf, len)
1442-
unsigned FAR *have;
1443-
const unsigned char FAR *buf;
1444-
unsigned len;
1445-
{
1390+
local unsigned syncsearch(unsigned FAR *have, const unsigned char FAR *buf,
1391+
unsigned len) {
14461392
unsigned got;
14471393
unsigned next;
14481394

@@ -1461,9 +1407,7 @@ unsigned len;
14611407
return next;
14621408
}
14631409

1464-
int ZEXPORT inflateSync(strm)
1465-
z_streamp strm;
1466-
{
1410+
int ZEXPORT inflateSync(z_streamp strm) {
14671411
unsigned len; /* number of bytes to look at or looked at */
14681412
int flags; /* temporary to save header status */
14691413
unsigned long in, out; /* temporary to save total_in and total_out */
@@ -1519,20 +1463,15 @@ z_streamp strm;
15191463
block. When decompressing, PPP checks that at the end of input packet,
15201464
inflate is waiting for these length bytes.
15211465
*/
1522-
int ZEXPORT inflateSyncPoint(strm)
1523-
z_streamp strm;
1524-
{
1466+
int ZEXPORT inflateSyncPoint(z_streamp strm) {
15251467
struct inflate_state FAR *state;
15261468

15271469
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
15281470
state = (struct inflate_state FAR *)strm->state;
15291471
return state->mode == STORED && state->bits == 0;
15301472
}
15311473

1532-
int ZEXPORT inflateCopy(dest, source)
1533-
z_streamp dest;
1534-
z_streamp source;
1535-
{
1474+
int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) {
15361475
struct inflate_state FAR *state;
15371476
struct inflate_state FAR *copy;
15381477
unsigned char FAR *window;
@@ -1576,10 +1515,7 @@ z_streamp source;
15761515
return Z_OK;
15771516
}
15781517

1579-
int ZEXPORT inflateUndermine(strm, subvert)
1580-
z_streamp strm;
1581-
int subvert;
1582-
{
1518+
int ZEXPORT inflateUndermine(z_streamp strm, int subvert) {
15831519
struct inflate_state FAR *state;
15841520

15851521
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -1594,10 +1530,7 @@ int subvert;
15941530
#endif
15951531
}
15961532

1597-
int ZEXPORT inflateValidate(strm, check)
1598-
z_streamp strm;
1599-
int check;
1600-
{
1533+
int ZEXPORT inflateValidate(z_streamp strm, int check) {
16011534
struct inflate_state FAR *state;
16021535

16031536
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -1609,9 +1542,7 @@ int check;
16091542
return Z_OK;
16101543
}
16111544

1612-
long ZEXPORT inflateMark(strm)
1613-
z_streamp strm;
1614-
{
1545+
long ZEXPORT inflateMark(z_streamp strm) {
16151546
struct inflate_state FAR *state;
16161547

16171548
if (inflateStateCheck(strm))
@@ -1622,9 +1553,7 @@ z_streamp strm;
16221553
(state->mode == MATCH ? state->was - state->length : 0));
16231554
}
16241555

1625-
unsigned long ZEXPORT inflateCodesUsed(strm)
1626-
z_streamp strm;
1627-
{
1556+
unsigned long ZEXPORT inflateCodesUsed(z_streamp strm) {
16281557
struct inflate_state FAR *state;
16291558
if (inflateStateCheck(strm)) return (unsigned long)-1;
16301559
state = (struct inflate_state FAR *)strm->state;

‎deps/zlib/crc32.c

+84-159
Large diffs are not rendered by default.

‎deps/zlib/deflate.c

+242-348
Large diffs are not rendered by default.

‎deps/zlib/deflate.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,14 @@ typedef struct internal_state {
296296
memory checker errors from longest match routines */
297297

298298
/* in trees.c */
299-
void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
300-
int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
301-
void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
302-
ulg stored_len, int last));
303-
void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));
304-
void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
305-
void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
306-
ulg stored_len, int last));
299+
void ZLIB_INTERNAL _tr_init(deflate_state *s);
300+
int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc);
301+
void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf,
302+
ulg stored_len, int last);
303+
void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s);
304+
void ZLIB_INTERNAL _tr_align(deflate_state *s);
305+
void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf,
306+
ulg stored_len, int last);
307307

308308
#define d_code(dist) \
309309
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])

‎deps/zlib/gzclose.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
/* gzclose() is in a separate file so that it is linked in only if it is used.
99
That way the other gzclose functions can be used instead to avoid linking in
1010
unneeded compression or decompression routines. */
11-
int ZEXPORT gzclose(file)
12-
gzFile file;
13-
{
11+
int ZEXPORT gzclose(gzFile file) {
1412
#ifndef NO_GZCOMPRESS
1513
gz_statep state;
1614

‎deps/zlib/gzguts.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@
119119

120120
/* gz* functions always use library allocation functions */
121121
#ifndef STDC
122-
extern voidp malloc OF((uInt size));
123-
extern void free OF((voidpf ptr));
122+
extern voidp malloc(uInt size);
123+
extern void free(voidpf ptr);
124124
#endif
125125

126126
/* get errno and strerror definition */
@@ -138,10 +138,10 @@
138138

139139
/* provide prototypes for these when building zlib without LFS */
140140
#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
141-
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
142-
ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
143-
ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
144-
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
141+
ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);
142+
ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int);
143+
ZEXTERN z_off64_t ZEXPORT gztell64(gzFile);
144+
ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile);
145145
#endif
146146

147147
/* default memLevel */
@@ -203,9 +203,9 @@ typedef struct {
203203
typedef gz_state FAR *gz_statep;
204204

205205
/* shared functions */
206-
void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
206+
void ZLIB_INTERNAL gz_error(gz_statep, int, const char *);
207207
#if defined UNDER_CE
208-
char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
208+
char ZLIB_INTERNAL *gz_strwinerror(DWORD error);
209209
#endif
210210

211211
/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
@@ -214,6 +214,6 @@ char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
214214
#ifdef INT_MAX
215215
# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
216216
#else
217-
unsigned ZLIB_INTERNAL gz_intmax OF((void));
217+
unsigned ZLIB_INTERNAL gz_intmax(void);
218218
# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
219219
#endif

‎deps/zlib/gzlib.c

+20-77
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
#endif
1919
#endif
2020

21-
/* Local functions */
22-
local void gz_reset OF((gz_statep));
23-
local gzFile gz_open OF((const void *, int, const char *));
24-
2521
#if defined UNDER_CE
2622

2723
/* Map the Windows error number in ERROR to a locale-dependent error message
@@ -33,9 +29,7 @@ local gzFile gz_open OF((const void *, int, const char *));
3329
3430
The gz_strwinerror function does not change the current setting of
3531
GetLastError. */
36-
char ZLIB_INTERNAL *gz_strwinerror(error)
37-
DWORD error;
38-
{
32+
char ZLIB_INTERNAL *gz_strwinerror(DWORD error) {
3933
static char buf[1024];
4034

4135
wchar_t *msgbuf;
@@ -75,9 +69,7 @@ char ZLIB_INTERNAL *gz_strwinerror(error)
7569
#endif /* UNDER_CE */
7670

7771
/* Reset gzip file state */
78-
local void gz_reset(state)
79-
gz_statep state;
80-
{
72+
local void gz_reset(gz_statep state) {
8173
state->x.have = 0; /* no output data available */
8274
if (state->mode == GZ_READ) { /* for reading ... */
8375
state->eof = 0; /* not at end of file */
@@ -93,11 +85,7 @@ local void gz_reset(state)
9385
}
9486

9587
/* Open a gzip file either by name or file descriptor. */
96-
local gzFile gz_open(path, fd, mode)
97-
const void *path;
98-
int fd;
99-
const char *mode;
100-
{
88+
local gzFile gz_open(const void *path, int fd, const char *mode) {
10189
gz_statep state;
10290
z_size_t len;
10391
int oflag;
@@ -272,26 +260,17 @@ local gzFile gz_open(path, fd, mode)
272260
}
273261

274262
/* -- see zlib.h -- */
275-
gzFile ZEXPORT gzopen(path, mode)
276-
const char *path;
277-
const char *mode;
278-
{
263+
gzFile ZEXPORT gzopen(const char *path, const char *mode) {
279264
return gz_open(path, -1, mode);
280265
}
281266

282267
/* -- see zlib.h -- */
283-
gzFile ZEXPORT gzopen64(path, mode)
284-
const char *path;
285-
const char *mode;
286-
{
268+
gzFile ZEXPORT gzopen64(const char *path, const char *mode) {
287269
return gz_open(path, -1, mode);
288270
}
289271

290272
/* -- see zlib.h -- */
291-
gzFile ZEXPORT gzdopen(fd, mode)
292-
int fd;
293-
const char *mode;
294-
{
273+
gzFile ZEXPORT gzdopen(int fd, const char *mode) {
295274
char *path; /* identifier for error messages */
296275
gzFile gz;
297276

@@ -309,19 +288,13 @@ gzFile ZEXPORT gzdopen(fd, mode)
309288

310289
/* -- see zlib.h -- */
311290
#ifdef WIDECHAR
312-
gzFile ZEXPORT gzopen_w(path, mode)
313-
const wchar_t *path;
314-
const char *mode;
315-
{
291+
gzFile ZEXPORT gzopen_w(const wchar_t *path, const char *mode) {
316292
return gz_open(path, -2, mode);
317293
}
318294
#endif
319295

320296
/* -- see zlib.h -- */
321-
int ZEXPORT gzbuffer(file, size)
322-
gzFile file;
323-
unsigned size;
324-
{
297+
int ZEXPORT gzbuffer(gzFile file, unsigned size) {
325298
gz_statep state;
326299

327300
/* get internal structure and check integrity */
@@ -345,9 +318,7 @@ int ZEXPORT gzbuffer(file, size)
345318
}
346319

347320
/* -- see zlib.h -- */
348-
int ZEXPORT gzrewind(file)
349-
gzFile file;
350-
{
321+
int ZEXPORT gzrewind(gzFile file) {
351322
gz_statep state;
352323

353324
/* get internal structure */
@@ -368,11 +339,7 @@ int ZEXPORT gzrewind(file)
368339
}
369340

370341
/* -- see zlib.h -- */
371-
z_off64_t ZEXPORT gzseek64(file, offset, whence)
372-
gzFile file;
373-
z_off64_t offset;
374-
int whence;
375-
{
342+
z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence) {
376343
unsigned n;
377344
z_off64_t ret;
378345
gz_statep state;
@@ -445,21 +412,15 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
445412
}
446413

447414
/* -- see zlib.h -- */
448-
z_off_t ZEXPORT gzseek(file, offset, whence)
449-
gzFile file;
450-
z_off_t offset;
451-
int whence;
452-
{
415+
z_off_t ZEXPORT gzseek(gzFile file, z_off_t offset, int whence) {
453416
z_off64_t ret;
454417

455418
ret = gzseek64(file, (z_off64_t)offset, whence);
456419
return ret == (z_off_t)ret ? (z_off_t)ret : -1;
457420
}
458421

459422
/* -- see zlib.h -- */
460-
z_off64_t ZEXPORT gztell64(file)
461-
gzFile file;
462-
{
423+
z_off64_t ZEXPORT gztell64(gzFile file) {
463424
gz_statep state;
464425

465426
/* get internal structure and check integrity */
@@ -474,19 +435,15 @@ z_off64_t ZEXPORT gztell64(file)
474435
}
475436

476437
/* -- see zlib.h -- */
477-
z_off_t ZEXPORT gztell(file)
478-
gzFile file;
479-
{
438+
z_off_t ZEXPORT gztell(gzFile file) {
480439
z_off64_t ret;
481440

482441
ret = gztell64(file);
483442
return ret == (z_off_t)ret ? (z_off_t)ret : -1;
484443
}
485444

486445
/* -- see zlib.h -- */
487-
z_off64_t ZEXPORT gzoffset64(file)
488-
gzFile file;
489-
{
446+
z_off64_t ZEXPORT gzoffset64(gzFile file) {
490447
z_off64_t offset;
491448
gz_statep state;
492449

@@ -507,19 +464,15 @@ z_off64_t ZEXPORT gzoffset64(file)
507464
}
508465

509466
/* -- see zlib.h -- */
510-
z_off_t ZEXPORT gzoffset(file)
511-
gzFile file;
512-
{
467+
z_off_t ZEXPORT gzoffset(gzFile file) {
513468
z_off64_t ret;
514469

515470
ret = gzoffset64(file);
516471
return ret == (z_off_t)ret ? (z_off_t)ret : -1;
517472
}
518473

519474
/* -- see zlib.h -- */
520-
int ZEXPORT gzeof(file)
521-
gzFile file;
522-
{
475+
int ZEXPORT gzeof(gzFile file) {
523476
gz_statep state;
524477

525478
/* get internal structure and check integrity */
@@ -534,10 +487,7 @@ int ZEXPORT gzeof(file)
534487
}
535488

536489
/* -- see zlib.h -- */
537-
const char * ZEXPORT gzerror(file, errnum)
538-
gzFile file;
539-
int *errnum;
540-
{
490+
const char * ZEXPORT gzerror(gzFile file, int *errnum) {
541491
gz_statep state;
542492

543493
/* get internal structure and check integrity */
@@ -555,9 +505,7 @@ const char * ZEXPORT gzerror(file, errnum)
555505
}
556506

557507
/* -- see zlib.h -- */
558-
void ZEXPORT gzclearerr(file)
559-
gzFile file;
560-
{
508+
void ZEXPORT gzclearerr(gzFile file) {
561509
gz_statep state;
562510

563511
/* get internal structure and check integrity */
@@ -581,11 +529,7 @@ void ZEXPORT gzclearerr(file)
581529
memory). Simply save the error message as a static string. If there is an
582530
allocation failure constructing the error message, then convert the error to
583531
out of memory. */
584-
void ZLIB_INTERNAL gz_error(state, err, msg)
585-
gz_statep state;
586-
int err;
587-
const char *msg;
588-
{
532+
void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {
589533
/* free previously allocated message and clear */
590534
if (state->msg != NULL) {
591535
if (state->err != Z_MEM_ERROR)
@@ -627,8 +571,7 @@ void ZLIB_INTERNAL gz_error(state, err, msg)
627571
available) -- we need to do this to cover cases where 2's complement not
628572
used, since C standard permits 1's complement and sign-bit representations,
629573
otherwise we could just use ((unsigned)-1) >> 1 */
630-
unsigned ZLIB_INTERNAL gz_intmax()
631-
{
574+
unsigned ZLIB_INTERNAL gz_intmax(void) {
632575
unsigned p, q;
633576

634577
p = 1;

‎deps/zlib/gzread.c

+16-68
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,12 @@
55

66
#include "gzguts.h"
77

8-
/* Local functions */
9-
local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));
10-
local int gz_avail OF((gz_statep));
11-
local int gz_look OF((gz_statep));
12-
local int gz_decomp OF((gz_statep));
13-
local int gz_fetch OF((gz_statep));
14-
local int gz_skip OF((gz_statep, z_off64_t));
15-
local z_size_t gz_read OF((gz_statep, voidp, z_size_t));
16-
178
/* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from
189
state->fd, and update state->eof, state->err, and state->msg as appropriate.
1910
This function needs to loop on read(), since read() is not guaranteed to
2011
read the number of bytes requested, depending on the type of descriptor. */
21-
local int gz_load(state, buf, len, have)
22-
gz_statep state;
23-
unsigned char *buf;
24-
unsigned len;
25-
unsigned *have;
26-
{
12+
local int gz_load(gz_statep state, unsigned char *buf, unsigned len,
13+
unsigned *have) {
2714
int ret;
2815
unsigned get, max = ((unsigned)-1 >> 2) + 1;
2916

@@ -53,9 +40,7 @@ local int gz_load(state, buf, len, have)
5340
If strm->avail_in != 0, then the current data is moved to the beginning of
5441
the input buffer, and then the remainder of the buffer is loaded with the
5542
available data from the input file. */
56-
local int gz_avail(state)
57-
gz_statep state;
58-
{
43+
local int gz_avail(gz_statep state) {
5944
unsigned got;
6045
z_streamp strm = &(state->strm);
6146

@@ -88,9 +73,7 @@ local int gz_avail(state)
8873
case, all further file reads will be directly to either the output buffer or
8974
a user buffer. If decompressing, the inflate state will be initialized.
9075
gz_look() will return 0 on success or -1 on failure. */
91-
local int gz_look(state)
92-
gz_statep state;
93-
{
76+
local int gz_look(gz_statep state) {
9477
z_streamp strm = &(state->strm);
9578

9679
/* allocate read buffers and inflate memory */
@@ -170,9 +153,7 @@ local int gz_look(state)
170153
data. If the gzip stream completes, state->how is reset to LOOK to look for
171154
the next gzip stream or raw data, once state->x.have is depleted. Returns 0
172155
on success, -1 on failure. */
173-
local int gz_decomp(state)
174-
gz_statep state;
175-
{
156+
local int gz_decomp(gz_statep state) {
176157
int ret = Z_OK;
177158
unsigned had;
178159
z_streamp strm = &(state->strm);
@@ -224,9 +205,7 @@ local int gz_decomp(state)
224205
looked for to determine whether to copy or decompress. Returns -1 on error,
225206
otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the
226207
end of the input file has been reached and all data has been processed. */
227-
local int gz_fetch(state)
228-
gz_statep state;
229-
{
208+
local int gz_fetch(gz_statep state) {
230209
z_streamp strm = &(state->strm);
231210

232211
do {
@@ -254,10 +233,7 @@ local int gz_fetch(state)
254233
}
255234

256235
/* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */
257-
local int gz_skip(state, len)
258-
gz_statep state;
259-
z_off64_t len;
260-
{
236+
local int gz_skip(gz_statep state, z_off64_t len) {
261237
unsigned n;
262238

263239
/* skip over len bytes or reach end-of-file, whichever comes first */
@@ -289,11 +265,7 @@ local int gz_skip(state, len)
289265
input. Return the number of bytes read. If zero is returned, either the
290266
end of file was reached, or there was an error. state->err must be
291267
consulted in that case to determine which. */
292-
local z_size_t gz_read(state, buf, len)
293-
gz_statep state;
294-
voidp buf;
295-
z_size_t len;
296-
{
268+
local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) {
297269
z_size_t got;
298270
unsigned n;
299271

@@ -370,11 +342,7 @@ local z_size_t gz_read(state, buf, len)
370342
}
371343

372344
/* -- see zlib.h -- */
373-
int ZEXPORT gzread(file, buf, len)
374-
gzFile file;
375-
voidp buf;
376-
unsigned len;
377-
{
345+
int ZEXPORT gzread(gzFile file, voidp buf, unsigned len) {
378346
gz_statep state;
379347

380348
/* get internal structure */
@@ -406,12 +374,7 @@ int ZEXPORT gzread(file, buf, len)
406374
}
407375

408376
/* -- see zlib.h -- */
409-
z_size_t ZEXPORT gzfread(buf, size, nitems, file)
410-
voidp buf;
411-
z_size_t size;
412-
z_size_t nitems;
413-
gzFile file;
414-
{
377+
z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems, gzFile file) {
415378
z_size_t len;
416379
gz_statep state;
417380

@@ -446,9 +409,7 @@ z_size_t ZEXPORT gzfread(buf, size, nitems, file)
446409
# endif
447410
#endif
448411

449-
int ZEXPORT gzgetc(file)
450-
gzFile file;
451-
{
412+
int ZEXPORT gzgetc(gzFile file) {
452413
unsigned char buf[1];
453414
gz_statep state;
454415

@@ -473,17 +434,12 @@ int ZEXPORT gzgetc(file)
473434
return gz_read(state, buf, 1) < 1 ? -1 : buf[0];
474435
}
475436

476-
int ZEXPORT gzgetc_(file)
477-
gzFile file;
478-
{
437+
int ZEXPORT gzgetc_(gzFile file) {
479438
return gzgetc(file);
480439
}
481440

482441
/* -- see zlib.h -- */
483-
int ZEXPORT gzungetc(c, file)
484-
int c;
485-
gzFile file;
486-
{
442+
int ZEXPORT gzungetc(int c, gzFile file) {
487443
gz_statep state;
488444

489445
/* get internal structure */
@@ -540,11 +496,7 @@ int ZEXPORT gzungetc(c, file)
540496
}
541497

542498
/* -- see zlib.h -- */
543-
char * ZEXPORT gzgets(file, buf, len)
544-
gzFile file;
545-
char *buf;
546-
int len;
547-
{
499+
char * ZEXPORT gzgets(gzFile file, char *buf, int len) {
548500
unsigned left, n;
549501
char *str;
550502
unsigned char *eol;
@@ -604,9 +556,7 @@ char * ZEXPORT gzgets(file, buf, len)
604556
}
605557

606558
/* -- see zlib.h -- */
607-
int ZEXPORT gzdirect(file)
608-
gzFile file;
609-
{
559+
int ZEXPORT gzdirect(gzFile file) {
610560
gz_statep state;
611561

612562
/* get internal structure */
@@ -624,9 +574,7 @@ int ZEXPORT gzdirect(file)
624574
}
625575

626576
/* -- see zlib.h -- */
627-
int ZEXPORT gzclose_r(file)
628-
gzFile file;
629-
{
577+
int ZEXPORT gzclose_r(gzFile file) {
630578
int ret, err;
631579
gz_statep state;
632580

‎deps/zlib/gzwrite.c

+18-64
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,10 @@
55

66
#include "gzguts.h"
77

8-
/* Local functions */
9-
local int gz_init OF((gz_statep));
10-
local int gz_comp OF((gz_statep, int));
11-
local int gz_zero OF((gz_statep, z_off64_t));
12-
local z_size_t gz_write OF((gz_statep, voidpc, z_size_t));
13-
148
/* Initialize state for writing a gzip file. Mark initialization by setting
159
state->size to non-zero. Return -1 on a memory allocation failure, or 0 on
1610
success. */
17-
local int gz_init(state)
18-
gz_statep state;
19-
{
11+
local int gz_init(gz_statep state) {
2012
int ret;
2113
z_streamp strm = &(state->strm);
2214

@@ -70,10 +62,7 @@ local int gz_init(state)
7062
deflate() flush value. If flush is Z_FINISH, then the deflate() state is
7163
reset to start a new gzip stream. If gz->direct is true, then simply write
7264
to the output file without compressing, and ignore flush. */
73-
local int gz_comp(state, flush)
74-
gz_statep state;
75-
int flush;
76-
{
65+
local int gz_comp(gz_statep state, int flush) {
7766
int ret, writ;
7867
unsigned have, put, max = ((unsigned)-1 >> 2) + 1;
7968
z_streamp strm = &(state->strm);
@@ -151,10 +140,7 @@ local int gz_comp(state, flush)
151140

152141
/* Compress len zeros to output. Return -1 on a write error or memory
153142
allocation failure by gz_comp(), or 0 on success. */
154-
local int gz_zero(state, len)
155-
gz_statep state;
156-
z_off64_t len;
157-
{
143+
local int gz_zero(gz_statep state, z_off64_t len) {
158144
int first;
159145
unsigned n;
160146
z_streamp strm = &(state->strm);
@@ -184,11 +170,7 @@ local int gz_zero(state, len)
184170

185171
/* Write len bytes from buf to file. Return the number of bytes written. If
186172
the returned value is less than len, then there was an error. */
187-
local z_size_t gz_write(state, buf, len)
188-
gz_statep state;
189-
voidpc buf;
190-
z_size_t len;
191-
{
173+
local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) {
192174
z_size_t put = len;
193175

194176
/* if len is zero, avoid unnecessary operations */
@@ -252,11 +234,7 @@ local z_size_t gz_write(state, buf, len)
252234
}
253235

254236
/* -- see zlib.h -- */
255-
int ZEXPORT gzwrite(file, buf, len)
256-
gzFile file;
257-
voidpc buf;
258-
unsigned len;
259-
{
237+
int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len) {
260238
gz_statep state;
261239

262240
/* get internal structure */
@@ -280,12 +258,8 @@ int ZEXPORT gzwrite(file, buf, len)
280258
}
281259

282260
/* -- see zlib.h -- */
283-
z_size_t ZEXPORT gzfwrite(buf, size, nitems, file)
284-
voidpc buf;
285-
z_size_t size;
286-
z_size_t nitems;
287-
gzFile file;
288-
{
261+
z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, z_size_t nitems,
262+
gzFile file) {
289263
z_size_t len;
290264
gz_statep state;
291265

@@ -310,10 +284,7 @@ z_size_t ZEXPORT gzfwrite(buf, size, nitems, file)
310284
}
311285

312286
/* -- see zlib.h -- */
313-
int ZEXPORT gzputc(file, c)
314-
gzFile file;
315-
int c;
316-
{
287+
int ZEXPORT gzputc(gzFile file, int c) {
317288
unsigned have;
318289
unsigned char buf[1];
319290
gz_statep state;
@@ -358,10 +329,7 @@ int ZEXPORT gzputc(file, c)
358329
}
359330

360331
/* -- see zlib.h -- */
361-
int ZEXPORT gzputs(file, s)
362-
gzFile file;
363-
const char *s;
364-
{
332+
int ZEXPORT gzputs(gzFile file, const char *s) {
365333
z_size_t len, put;
366334
gz_statep state;
367335

@@ -388,8 +356,7 @@ int ZEXPORT gzputs(file, s)
388356
#include <stdarg.h>
389357

390358
/* -- see zlib.h -- */
391-
int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)
392-
{
359+
int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) {
393360
int len;
394361
unsigned left;
395362
char *next;
@@ -460,8 +427,7 @@ int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)
460427
return len;
461428
}
462429

463-
int ZEXPORTVA gzprintf(gzFile file, const char *format, ...)
464-
{
430+
int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) {
465431
va_list va;
466432
int ret;
467433

@@ -474,13 +440,10 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, ...)
474440
#else /* !STDC && !Z_HAVE_STDARG_H */
475441

476442
/* -- see zlib.h -- */
477-
int ZEXPORTVA gzprintf(file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
478-
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
479-
gzFile file;
480-
const char *format;
481-
int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
482-
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
483-
{
443+
int ZEXPORTVA gzprintf(gzFile file, const char *format, int a1, int a2, int a3,
444+
int a4, int a5, int a6, int a7, int a8, int a9, int a10,
445+
int a11, int a12, int a13, int a14, int a15, int a16,
446+
int a17, int a18, int a19, int a20) {
484447
unsigned len, left;
485448
char *next;
486449
gz_statep state;
@@ -562,10 +525,7 @@ int ZEXPORTVA gzprintf(file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
562525
#endif
563526

564527
/* -- see zlib.h -- */
565-
int ZEXPORT gzflush(file, flush)
566-
gzFile file;
567-
int flush;
568-
{
528+
int ZEXPORT gzflush(gzFile file, int flush) {
569529
gz_statep state;
570530

571531
/* get internal structure */
@@ -594,11 +554,7 @@ int ZEXPORT gzflush(file, flush)
594554
}
595555

596556
/* -- see zlib.h -- */
597-
int ZEXPORT gzsetparams(file, level, strategy)
598-
gzFile file;
599-
int level;
600-
int strategy;
601-
{
557+
int ZEXPORT gzsetparams(gzFile file, int level, int strategy) {
602558
gz_statep state;
603559
z_streamp strm;
604560

@@ -636,9 +592,7 @@ int ZEXPORT gzsetparams(file, level, strategy)
636592
}
637593

638594
/* -- see zlib.h -- */
639-
int ZEXPORT gzclose_w(file)
640-
gzFile file;
641-
{
595+
int ZEXPORT gzclose_w(gzFile file) {
642596
int ret = Z_OK;
643597
gz_statep state;
644598

‎deps/zlib/infback.c

+7-23
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,16 @@
1515
#include "inflate.h"
1616
#include "inffast.h"
1717

18-
/* function prototypes */
19-
local void fixedtables OF((struct inflate_state FAR *state));
20-
2118
/*
2219
strm provides memory allocation functions in zalloc and zfree, or
2320
Z_NULL to use the library memory allocation functions.
2421
2522
windowBits is in the range 8..15, and window is a user-supplied
2623
window and output buffer that is 2**windowBits bytes.
2724
*/
28-
int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
29-
z_streamp strm;
30-
int windowBits;
31-
unsigned char FAR *window;
32-
const char *version;
33-
int stream_size;
34-
{
25+
int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,
26+
unsigned char FAR *window, const char *version,
27+
int stream_size) {
3528
struct inflate_state FAR *state;
3629

3730
if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
@@ -80,9 +73,7 @@ int stream_size;
8073
used for threaded applications, since the rewriting of the tables and virgin
8174
may not be thread-safe.
8275
*/
83-
local void fixedtables(state)
84-
struct inflate_state FAR *state;
85-
{
76+
local void fixedtables(struct inflate_state FAR *state) {
8677
#ifdef BUILDFIXED
8778
static int virgin = 1;
8879
static code *lenfix, *distfix;
@@ -248,13 +239,8 @@ struct inflate_state FAR *state;
248239
inflateBack() can also return Z_STREAM_ERROR if the input parameters
249240
are not correct, i.e. strm is Z_NULL or the state was not initialized.
250241
*/
251-
int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
252-
z_streamp strm;
253-
in_func in;
254-
void FAR *in_desc;
255-
out_func out;
256-
void FAR *out_desc;
257-
{
242+
int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
243+
out_func out, void FAR *out_desc) {
258244
struct inflate_state FAR *state;
259245
z_const unsigned char FAR *next; /* next input */
260246
unsigned char FAR *put; /* next output */
@@ -633,9 +619,7 @@ void FAR *out_desc;
633619
return ret;
634620
}
635621

636-
int ZEXPORT inflateBackEnd(strm)
637-
z_streamp strm;
638-
{
622+
int ZEXPORT inflateBackEnd(z_streamp strm) {
639623
if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
640624
return Z_STREAM_ERROR;
641625
ZFREE(strm, strm->state);

‎deps/zlib/inffast.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@
5151
requires strm->avail_out >= 258 for each loop to avoid checking for
5252
available output space while decoding.
5353
*/
54-
void ZLIB_INTERNAL inflate_fast(strm, start)
55-
z_streamp strm;
56-
unsigned start; /* inflate()'s starting value for strm->avail_out */
57-
{
54+
void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
5855
struct inflate_state FAR *state;
5956
z_const unsigned char FAR *in; /* local strm->next_in */
6057
z_const unsigned char FAR *last; /* have enough input while in < last */

‎deps/zlib/inffast.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
*/
2424
#define INFLATE_FAST_MIN_OUTPUT 258
2525

26-
void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
26+
void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start);

‎deps/zlib/inflate.c

+28-99
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,7 @@
9191
# endif
9292
#endif
9393

94-
/* function prototypes */
95-
local int inflateStateCheck OF((z_streamp strm));
96-
local void fixedtables OF((struct inflate_state FAR *state));
97-
local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
98-
unsigned copy));
99-
#ifdef BUILDFIXED
100-
void makefixed OF((void));
101-
#endif
102-
local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
103-
unsigned len));
104-
105-
local int inflateStateCheck(strm)
106-
z_streamp strm;
107-
{
94+
local int inflateStateCheck(z_streamp strm) {
10895
struct inflate_state FAR *state;
10996
if (strm == Z_NULL ||
11097
strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
@@ -116,9 +103,7 @@ z_streamp strm;
116103
return 0;
117104
}
118105

119-
int ZEXPORT inflateResetKeep(strm)
120-
z_streamp strm;
121-
{
106+
int ZEXPORT inflateResetKeep(z_streamp strm) {
122107
struct inflate_state FAR *state;
123108

124109
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -142,9 +127,7 @@ z_streamp strm;
142127
return Z_OK;
143128
}
144129

145-
int ZEXPORT inflateReset(strm)
146-
z_streamp strm;
147-
{
130+
int ZEXPORT inflateReset(z_streamp strm) {
148131
struct inflate_state FAR *state;
149132

150133
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -155,10 +138,7 @@ z_streamp strm;
155138
return inflateResetKeep(strm);
156139
}
157140

158-
int ZEXPORT inflateReset2(strm, windowBits)
159-
z_streamp strm;
160-
int windowBits;
161-
{
141+
int ZEXPORT inflateReset2(z_streamp strm, int windowBits) {
162142
int wrap;
163143
struct inflate_state FAR *state;
164144

@@ -195,12 +175,8 @@ int windowBits;
195175
return inflateReset(strm);
196176
}
197177

198-
int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
199-
z_streamp strm;
200-
int windowBits;
201-
const char *version;
202-
int stream_size;
203-
{
178+
int ZEXPORT inflateInit2_(z_streamp strm, int windowBits,
179+
const char *version, int stream_size) {
204180
int ret;
205181
struct inflate_state FAR *state;
206182

@@ -240,19 +216,12 @@ int stream_size;
240216
return ret;
241217
}
242218

243-
int ZEXPORT inflateInit_(strm, version, stream_size)
244-
z_streamp strm;
245-
const char *version;
246-
int stream_size;
247-
{
219+
int ZEXPORT inflateInit_(z_streamp strm, const char *version,
220+
int stream_size) {
248221
return inflateInit2_(strm, DEF_WBITS, version, stream_size);
249222
}
250223

251-
int ZEXPORT inflatePrime(strm, bits, value)
252-
z_streamp strm;
253-
int bits;
254-
int value;
255-
{
224+
int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) {
256225
struct inflate_state FAR *state;
257226

258227
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -281,9 +250,7 @@ int value;
281250
used for threaded applications, since the rewriting of the tables and virgin
282251
may not be thread-safe.
283252
*/
284-
local void fixedtables(state)
285-
struct inflate_state FAR *state;
286-
{
253+
local void fixedtables(struct inflate_state FAR *state) {
287254
#ifdef BUILDFIXED
288255
static int virgin = 1;
289256
static code *lenfix, *distfix;
@@ -345,7 +312,7 @@ struct inflate_state FAR *state;
345312
346313
a.out > inffixed.h
347314
*/
348-
void makefixed()
315+
void makefixed(void)
349316
{
350317
unsigned low, size;
351318
struct inflate_state state;
@@ -399,11 +366,7 @@ void makefixed()
399366
output will fall in the output data, making match copies simpler and faster.
400367
The advantage may be dependent on the size of the processor's data caches.
401368
*/
402-
local int updatewindow(strm, end, copy)
403-
z_streamp strm;
404-
const Bytef *end;
405-
unsigned copy;
406-
{
369+
local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) {
407370
struct inflate_state FAR *state;
408371
unsigned dist;
409372

@@ -625,10 +588,7 @@ unsigned copy;
625588
will return Z_BUF_ERROR if it has not reached the end of the stream.
626589
*/
627590

628-
int ZEXPORT inflate(strm, flush)
629-
z_streamp strm;
630-
int flush;
631-
{
591+
int ZEXPORT inflate(z_streamp strm, int flush) {
632592
struct inflate_state FAR *state;
633593
z_const unsigned char FAR *next; /* next input */
634594
unsigned char FAR *put; /* next output */
@@ -1305,9 +1265,7 @@ int flush;
13051265
return ret;
13061266
}
13071267

1308-
int ZEXPORT inflateEnd(strm)
1309-
z_streamp strm;
1310-
{
1268+
int ZEXPORT inflateEnd(z_streamp strm) {
13111269
struct inflate_state FAR *state;
13121270
if (inflateStateCheck(strm))
13131271
return Z_STREAM_ERROR;
@@ -1319,11 +1277,8 @@ z_streamp strm;
13191277
return Z_OK;
13201278
}
13211279

1322-
int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
1323-
z_streamp strm;
1324-
Bytef *dictionary;
1325-
uInt *dictLength;
1326-
{
1280+
int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary,
1281+
uInt *dictLength) {
13271282
struct inflate_state FAR *state;
13281283

13291284
/* check state */
@@ -1342,11 +1297,8 @@ uInt *dictLength;
13421297
return Z_OK;
13431298
}
13441299

1345-
int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
1346-
z_streamp strm;
1347-
const Bytef *dictionary;
1348-
uInt dictLength;
1349-
{
1300+
int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary,
1301+
uInt dictLength) {
13501302
struct inflate_state FAR *state;
13511303
unsigned long dictid;
13521304
int ret;
@@ -1377,10 +1329,7 @@ uInt dictLength;
13771329
return Z_OK;
13781330
}
13791331

1380-
int ZEXPORT inflateGetHeader(strm, head)
1381-
z_streamp strm;
1382-
gz_headerp head;
1383-
{
1332+
int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head) {
13841333
struct inflate_state FAR *state;
13851334

13861335
/* check state */
@@ -1405,11 +1354,8 @@ gz_headerp head;
14051354
called again with more data and the *have state. *have is initialized to
14061355
zero for the first call.
14071356
*/
1408-
local unsigned syncsearch(have, buf, len)
1409-
unsigned FAR *have;
1410-
const unsigned char FAR *buf;
1411-
unsigned len;
1412-
{
1357+
local unsigned syncsearch(unsigned FAR *have, const unsigned char FAR *buf,
1358+
unsigned len) {
14131359
unsigned got;
14141360
unsigned next;
14151361

@@ -1428,9 +1374,7 @@ unsigned len;
14281374
return next;
14291375
}
14301376

1431-
int ZEXPORT inflateSync(strm)
1432-
z_streamp strm;
1433-
{
1377+
int ZEXPORT inflateSync(z_streamp strm) {
14341378
unsigned len; /* number of bytes to look at or looked at */
14351379
int flags; /* temporary to save header status */
14361380
unsigned long in, out; /* temporary to save total_in and total_out */
@@ -1486,20 +1430,15 @@ z_streamp strm;
14861430
block. When decompressing, PPP checks that at the end of input packet,
14871431
inflate is waiting for these length bytes.
14881432
*/
1489-
int ZEXPORT inflateSyncPoint(strm)
1490-
z_streamp strm;
1491-
{
1433+
int ZEXPORT inflateSyncPoint(z_streamp strm) {
14921434
struct inflate_state FAR *state;
14931435

14941436
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
14951437
state = (struct inflate_state FAR *)strm->state;
14961438
return state->mode == STORED && state->bits == 0;
14971439
}
14981440

1499-
int ZEXPORT inflateCopy(dest, source)
1500-
z_streamp dest;
1501-
z_streamp source;
1502-
{
1441+
int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) {
15031442
struct inflate_state FAR *state;
15041443
struct inflate_state FAR *copy;
15051444
unsigned char FAR *window;
@@ -1543,10 +1482,7 @@ z_streamp source;
15431482
return Z_OK;
15441483
}
15451484

1546-
int ZEXPORT inflateUndermine(strm, subvert)
1547-
z_streamp strm;
1548-
int subvert;
1549-
{
1485+
int ZEXPORT inflateUndermine(z_streamp strm, int subvert) {
15501486
struct inflate_state FAR *state;
15511487

15521488
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -1561,10 +1497,7 @@ int subvert;
15611497
#endif
15621498
}
15631499

1564-
int ZEXPORT inflateValidate(strm, check)
1565-
z_streamp strm;
1566-
int check;
1567-
{
1500+
int ZEXPORT inflateValidate(z_streamp strm, int check) {
15681501
struct inflate_state FAR *state;
15691502

15701503
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -1576,9 +1509,7 @@ int check;
15761509
return Z_OK;
15771510
}
15781511

1579-
long ZEXPORT inflateMark(strm)
1580-
z_streamp strm;
1581-
{
1512+
long ZEXPORT inflateMark(z_streamp strm) {
15821513
struct inflate_state FAR *state;
15831514

15841515
if (inflateStateCheck(strm))
@@ -1589,9 +1520,7 @@ z_streamp strm;
15891520
(state->mode == MATCH ? state->was - state->length : 0));
15901521
}
15911522

1592-
unsigned long ZEXPORT inflateCodesUsed(strm)
1593-
z_streamp strm;
1594-
{
1523+
unsigned long ZEXPORT inflateCodesUsed(z_streamp strm) {
15951524
struct inflate_state FAR *state;
15961525
if (inflateStateCheck(strm)) return (unsigned long)-1;
15971526
state = (struct inflate_state FAR *)strm->state;

‎deps/zlib/inftrees.c

+3-8
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,9 @@ const char inflate_copyright[] =
2929
table index bits. It will differ if the request is greater than the
3030
longest code or if it is less than the shortest code.
3131
*/
32-
int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
33-
codetype type;
34-
unsigned short FAR *lens;
35-
unsigned codes;
36-
code FAR * FAR *table;
37-
unsigned FAR *bits;
38-
unsigned short FAR *work;
39-
{
32+
int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
33+
unsigned codes, code FAR * FAR *table,
34+
unsigned FAR *bits, unsigned short FAR *work) {
4035
unsigned len; /* a code's length in bits */
4136
unsigned sym; /* index of code symbols */
4237
unsigned min, max; /* minimum and maximum code lengths */

‎deps/zlib/inftrees.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ typedef enum {
5757
DISTS
5858
} codetype;
5959

60-
int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
61-
unsigned codes, code FAR * FAR *table,
62-
unsigned FAR *bits, unsigned short FAR *work));
60+
int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
61+
unsigned codes, code FAR * FAR *table,
62+
unsigned FAR *bits, unsigned short FAR *work);

‎deps/zlib/trees.c

+224-302
Large diffs are not rendered by default.

‎deps/zlib/uncompr.c

+4-12
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@
2424
Z_DATA_ERROR if the input data was corrupted, including if the input data is
2525
an incomplete zlib stream.
2626
*/
27-
int ZEXPORT uncompress2(dest, destLen, source, sourceLen)
28-
Bytef *dest;
29-
uLongf *destLen;
30-
const Bytef *source;
31-
uLong *sourceLen;
32-
{
27+
int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source,
28+
uLong *sourceLen) {
3329
z_stream stream;
3430
int err;
3531
const uInt max = (uInt)-1;
@@ -83,11 +79,7 @@ int ZEXPORT uncompress2(dest, destLen, source, sourceLen)
8379
err;
8480
}
8581

86-
int ZEXPORT uncompress(dest, destLen, source, sourceLen)
87-
Bytef *dest;
88-
uLongf *destLen;
89-
const Bytef *source;
90-
uLong sourceLen;
91-
{
82+
int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source,
83+
uLong sourceLen) {
9284
return uncompress2(dest, destLen, source, &sourceLen);
9385
}

‎deps/zlib/zlib.h

+174-174
Large diffs are not rendered by default.

‎deps/zlib/zutil.c

+16-44
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ z_const char * const z_errmsg[10] = {
2424
};
2525

2626

27-
const char * ZEXPORT zlibVersion()
28-
{
27+
const char * ZEXPORT zlibVersion(void) {
2928
return ZLIB_VERSION;
3029
}
3130

32-
uLong ZEXPORT zlibCompileFlags()
33-
{
31+
uLong ZEXPORT zlibCompileFlags(void) {
3432
uLong flags;
3533

3634
flags = 0;
@@ -121,9 +119,7 @@ uLong ZEXPORT zlibCompileFlags()
121119
# endif
122120
int ZLIB_INTERNAL z_verbose = verbose;
123121

124-
void ZLIB_INTERNAL z_error(m)
125-
char *m;
126-
{
122+
void ZLIB_INTERNAL z_error(char *m) {
127123
fprintf(stderr, "%s\n", m);
128124
exit(1);
129125
}
@@ -132,9 +128,7 @@ void ZLIB_INTERNAL z_error(m)
132128
/* exported to allow conversion of error code to string for compress() and
133129
* uncompress()
134130
*/
135-
const char * ZEXPORT zError(err)
136-
int err;
137-
{
131+
const char * ZEXPORT zError(int err) {
138132
return ERR_MSG(err);
139133
}
140134

@@ -148,22 +142,14 @@ const char * ZEXPORT zError(err)
148142

149143
#ifndef HAVE_MEMCPY
150144

151-
void ZLIB_INTERNAL zmemcpy(dest, source, len)
152-
Bytef* dest;
153-
const Bytef* source;
154-
uInt len;
155-
{
145+
void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len) {
156146
if (len == 0) return;
157147
do {
158148
*dest++ = *source++; /* ??? to be unrolled */
159149
} while (--len != 0);
160150
}
161151

162-
int ZLIB_INTERNAL zmemcmp(s1, s2, len)
163-
const Bytef* s1;
164-
const Bytef* s2;
165-
uInt len;
166-
{
152+
int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len) {
167153
uInt j;
168154

169155
for (j = 0; j < len; j++) {
@@ -172,10 +158,7 @@ int ZLIB_INTERNAL zmemcmp(s1, s2, len)
172158
return 0;
173159
}
174160

175-
void ZLIB_INTERNAL zmemzero(dest, len)
176-
Bytef* dest;
177-
uInt len;
178-
{
161+
void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len) {
179162
if (len == 0) return;
180163
do {
181164
*dest++ = 0; /* ??? to be unrolled */
@@ -216,8 +199,7 @@ local ptr_table table[MAX_PTR];
216199
* a protected system like OS/2. Use Microsoft C instead.
217200
*/
218201

219-
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
220-
{
202+
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
221203
voidpf buf;
222204
ulg bsize = (ulg)items*size;
223205

@@ -242,8 +224,7 @@ voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
242224
return buf;
243225
}
244226

245-
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
246-
{
227+
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
247228
int n;
248229

249230
(void)opaque;
@@ -279,14 +260,12 @@ void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
279260
# define _hfree hfree
280261
#endif
281262

282-
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size)
283-
{
263+
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) {
284264
(void)opaque;
285265
return _halloc((long)items, size);
286266
}
287267

288-
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
289-
{
268+
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
290269
(void)opaque;
291270
_hfree(ptr);
292271
}
@@ -299,25 +278,18 @@ void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
299278
#ifndef MY_ZCALLOC /* Any system without a special alloc function */
300279

301280
#ifndef STDC
302-
extern voidp malloc OF((uInt size));
303-
extern voidp calloc OF((uInt items, uInt size));
304-
extern void free OF((voidpf ptr));
281+
extern voidp malloc(uInt size);
282+
extern voidp calloc(uInt items, uInt size);
283+
extern void free(voidpf ptr);
305284
#endif
306285

307-
voidpf ZLIB_INTERNAL zcalloc(opaque, items, size)
308-
voidpf opaque;
309-
unsigned items;
310-
unsigned size;
311-
{
286+
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
312287
(void)opaque;
313288
return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
314289
(voidpf)calloc(items, size);
315290
}
316291

317-
void ZLIB_INTERNAL zcfree(opaque, ptr)
318-
voidpf opaque;
319-
voidpf ptr;
320-
{
292+
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
321293
(void)opaque;
322294
free(ptr);
323295
}

‎deps/zlib/zutil.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
206206
/* provide prototypes for these when building zlib without LFS */
207207
#if !defined(_WIN32) && \
208208
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
209-
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
210-
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
211-
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
209+
ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);
210+
ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);
211+
ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);
212212
#endif
213213

214214
/* common defaults */
@@ -247,16 +247,16 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
247247
# define zmemzero(dest, len) memset(dest, 0, len)
248248
# endif
249249
#else
250-
void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
251-
int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
252-
void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
250+
void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len);
251+
int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len);
252+
void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len);
253253
#endif
254254

255255
/* Diagnostic functions */
256256
#ifdef ZLIB_DEBUG
257257
# include <stdio.h>
258258
extern int ZLIB_INTERNAL z_verbose;
259-
extern void ZLIB_INTERNAL z_error OF((char *m));
259+
extern void ZLIB_INTERNAL z_error(char *m);
260260
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
261261
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
262262
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
@@ -273,9 +273,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
273273
#endif
274274

275275
#ifndef Z_SOLO
276-
voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
277-
unsigned size));
278-
void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
276+
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items,
277+
unsigned size);
278+
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr);
279279
#endif
280280

281281
#define ZALLOC(strm, items, size) \

0 commit comments

Comments
 (0)
Please sign in to comment.