Skip to content

Commit 6b84f15

Browse files
authored
Merge pull request #7 from adomerle/master
libs: zlib: Fix compiling on new clang versions
2 parents 77e7975 + 3b04920 commit 6b84f15

File tree

17 files changed

+155
-498
lines changed

17 files changed

+155
-498
lines changed

libs/compatible/include/string.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void *memmem(const void *, size_t, const void *, size_t);
6767
void *memrchr(const void *, int, size_t);
6868
void *mempcpy(void *, const void *, size_t);
6969
#ifndef __cplusplus
70-
char *basename();
70+
char *basename(char *path);
7171
#endif
7272

7373
#ifdef __cplusplus

libs/compatible/vasprintf.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ __RCSID("$NetBSD: vasprintf.c,v 1.10 2005/02/09 21:35:47 kleink Exp $");
3939
#include "local.h"
4040

4141
weak_decl int
42-
vasprintf(str, fmt, ap)
43-
char **str;
44-
const char *fmt;
45-
va_list ap;
42+
vasprintf(char **str, const char *fmt, va_list ap)
4643
{
4744
int ret;
4845
FILE f;

libs/zlib/adler32.c

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
6060
#endif
6161

6262
/* ========================================================================= */
63-
uLong ZEXPORT adler32_z(adler, buf, len)
64-
uLong adler;
65-
const Bytef *buf;
66-
z_size_t len;
63+
uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len)
6764
{
6865
unsigned long sum2;
6966
unsigned n;
@@ -131,19 +128,13 @@ uLong ZEXPORT adler32_z(adler, buf, len)
131128
}
132129

133130
/* ========================================================================= */
134-
uLong ZEXPORT adler32(adler, buf, len)
135-
uLong adler;
136-
const Bytef *buf;
137-
uInt len;
131+
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len)
138132
{
139133
return adler32_z(adler, buf, len);
140134
}
141135

142136
/* ========================================================================= */
143-
local uLong adler32_combine_(adler1, adler2, len2)
144-
uLong adler1;
145-
uLong adler2;
146-
z_off64_t len2;
137+
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2)
147138
{
148139
unsigned long sum1;
149140
unsigned long sum2;
@@ -169,18 +160,12 @@ local uLong adler32_combine_(adler1, adler2, len2)
169160
}
170161

171162
/* ========================================================================= */
172-
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
173-
uLong adler1;
174-
uLong adler2;
175-
z_off_t len2;
163+
uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2)
176164
{
177165
return adler32_combine_(adler1, adler2, len2);
178166
}
179167

180-
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
181-
uLong adler1;
182-
uLong adler2;
183-
z_off64_t len2;
168+
uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2)
184169
{
185170
return adler32_combine_(adler1, adler2, len2);
186171
}

libs/zlib/compress.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@
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;
22+
int ZEXPORT compress2 (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level)
2823
{
2924
z_stream stream;
3025
int err;
@@ -65,11 +60,7 @@ 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;
63+
int ZEXPORT compress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
7364
{
7465
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
7566
}
@@ -78,8 +69,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
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;
72+
uLong ZEXPORT compressBound (uLong sourceLen)
8373
{
8474
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
8575
(sourceLen >> 25) + 13;

libs/zlib/crc32.c

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ local void make_crc_table()
162162
}
163163

164164
#ifdef MAKECRCH
165-
local void write_table(out, table)
166-
FILE *out;
167-
const z_crc_t FAR *table;
165+
local void write_table(FILE *out, const z_crc_t FAR *table)
168166
{
169167
int n;
170168

@@ -199,10 +197,7 @@ const z_crc_t FAR * ZEXPORT get_crc_table()
199197
#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
200198

201199
/* ========================================================================= */
202-
unsigned long ZEXPORT crc32_z(crc, buf, len)
203-
unsigned long crc;
204-
const unsigned char FAR *buf;
205-
z_size_t len;
200+
unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf, z_size_t len)
206201
{
207202
if (buf == Z_NULL) return 0UL;
208203

@@ -234,10 +229,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
234229
}
235230

236231
/* ========================================================================= */
237-
unsigned long ZEXPORT crc32(crc, buf, len)
238-
unsigned long crc;
239-
const unsigned char FAR *buf;
240-
uInt len;
232+
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
241233
{
242234
return crc32_z(crc, buf, len);
243235
}
@@ -263,10 +255,7 @@ unsigned long ZEXPORT crc32(crc, buf, len)
263255
#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
264256

265257
/* ========================================================================= */
266-
local unsigned long crc32_little(crc, buf, len)
267-
unsigned long crc;
268-
const unsigned char FAR *buf;
269-
z_size_t len;
258+
local unsigned long crc32_little(unsigned long crc, const unsigned char FAR *buf, z_size_t len)
270259
{
271260
register z_crc_t c;
272261
register const z_crc_t FAR *buf4;
@@ -303,10 +292,7 @@ local unsigned long crc32_little(crc, buf, len)
303292
#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
304293

305294
/* ========================================================================= */
306-
local unsigned long crc32_big(crc, buf, len)
307-
unsigned long crc;
308-
const unsigned char FAR *buf;
309-
z_size_t len;
295+
local unsigned long crc32_big(unsigned long crc, const unsigned char FAR *buf, z_size_t len)
310296
{
311297
register z_crc_t c;
312298
register const z_crc_t FAR *buf4;
@@ -341,9 +327,7 @@ local unsigned long crc32_big(crc, buf, len)
341327
#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */
342328

343329
/* ========================================================================= */
344-
local unsigned long gf2_matrix_times(mat, vec)
345-
unsigned long *mat;
346-
unsigned long vec;
330+
local unsigned long gf2_matrix_times(unsigned long *mat, unsigned long vec)
347331
{
348332
unsigned long sum;
349333

@@ -358,9 +342,7 @@ local unsigned long gf2_matrix_times(mat, vec)
358342
}
359343

360344
/* ========================================================================= */
361-
local void gf2_matrix_square(square, mat)
362-
unsigned long *square;
363-
unsigned long *mat;
345+
local void gf2_matrix_square(unsigned long *square, unsigned long *mat)
364346
{
365347
int n;
366348

@@ -369,10 +351,7 @@ local void gf2_matrix_square(square, mat)
369351
}
370352

371353
/* ========================================================================= */
372-
local uLong crc32_combine_(crc1, crc2, len2)
373-
uLong crc1;
374-
uLong crc2;
375-
z_off64_t len2;
354+
local uLong crc32_combine_(uLong crc1, uLong crc2, z_off64_t len2)
376355
{
377356
int n;
378357
unsigned long row;
@@ -425,18 +404,12 @@ local uLong crc32_combine_(crc1, crc2, len2)
425404
}
426405

427406
/* ========================================================================= */
428-
uLong ZEXPORT crc32_combine(crc1, crc2, len2)
429-
uLong crc1;
430-
uLong crc2;
431-
z_off_t len2;
407+
uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2)
432408
{
433409
return crc32_combine_(crc1, crc2, len2);
434410
}
435411

436-
uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
437-
uLong crc1;
438-
uLong crc2;
439-
z_off64_t len2;
412+
uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2)
440413
{
441414
return crc32_combine_(crc1, crc2, len2);
442415
}

0 commit comments

Comments
 (0)