diff options
author | Xin LI <delphij@FreeBSD.org> | 2023-09-03 13:10:10 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2023-09-03 21:50:07 -0700 |
commit | bd9c329c1055a9265812352655ed2eec93f36e92 (patch) | |
tree | 8661055737be23759ced7d2b5c2ecdf73e85c59b /test/example.c | |
parent | 5af7cef45eeef86ddf6ab00b4e363c1eecaf47b6 (diff) | |
download | zlib-bd9c329c1055a9265812352655ed2eec93f36e92.tar.gz zlib-bd9c329c1055a9265812352655ed2eec93f36e92.tar.bz2 zlib-bd9c329c1055a9265812352655ed2eec93f36e92.zip |
Make internal functions static in the test code.
To avoid warnings when building with -Wmissing-prototypes.
Diffstat (limited to '')
-rw-r--r-- | test/example.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/test/example.c b/test/example.c index 582a17a..c3521dd 100644 --- a/test/example.c +++ b/test/example.c | |||
@@ -36,12 +36,12 @@ static uLong dictId; /* Adler32 value of the dictionary */ | |||
36 | 36 | ||
37 | #ifdef Z_SOLO | 37 | #ifdef Z_SOLO |
38 | 38 | ||
39 | void *myalloc(void *q, unsigned n, unsigned m) { | 39 | static void *myalloc(void *q, unsigned n, unsigned m) { |
40 | (void)q; | 40 | (void)q; |
41 | return calloc(n, m); | 41 | return calloc(n, m); |
42 | } | 42 | } |
43 | 43 | ||
44 | void myfree(void *q, void *p) { | 44 | static void myfree(void *q, void *p) { |
45 | (void)q; | 45 | (void)q; |
46 | free(p); | 46 | free(p); |
47 | } | 47 | } |
@@ -57,7 +57,7 @@ static free_func zfree = (free_func)0; | |||
57 | /* =========================================================================== | 57 | /* =========================================================================== |
58 | * Test compress() and uncompress() | 58 | * Test compress() and uncompress() |
59 | */ | 59 | */ |
60 | void test_compress(Byte *compr, uLong comprLen, Byte *uncompr, | 60 | static void test_compress(Byte *compr, uLong comprLen, Byte *uncompr, |
61 | uLong uncomprLen) { | 61 | uLong uncomprLen) { |
62 | int err; | 62 | int err; |
63 | uLong len = (uLong)strlen(hello)+1; | 63 | uLong len = (uLong)strlen(hello)+1; |
@@ -81,7 +81,7 @@ void test_compress(Byte *compr, uLong comprLen, Byte *uncompr, | |||
81 | /* =========================================================================== | 81 | /* =========================================================================== |
82 | * Test read/write of .gz files | 82 | * Test read/write of .gz files |
83 | */ | 83 | */ |
84 | void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) { | 84 | static void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) { |
85 | #ifdef NO_GZCOMPRESS | 85 | #ifdef NO_GZCOMPRESS |
86 | fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n"); | 86 | fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n"); |
87 | #else | 87 | #else |
@@ -163,7 +163,7 @@ void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) { | |||
163 | /* =========================================================================== | 163 | /* =========================================================================== |
164 | * Test deflate() with small buffers | 164 | * Test deflate() with small buffers |
165 | */ | 165 | */ |
166 | void test_deflate(Byte *compr, uLong comprLen) { | 166 | static void test_deflate(Byte *compr, uLong comprLen) { |
167 | z_stream c_stream; /* compression stream */ | 167 | z_stream c_stream; /* compression stream */ |
168 | int err; | 168 | int err; |
169 | uLong len = (uLong)strlen(hello)+1; | 169 | uLong len = (uLong)strlen(hello)+1; |
@@ -198,7 +198,7 @@ void test_deflate(Byte *compr, uLong comprLen) { | |||
198 | /* =========================================================================== | 198 | /* =========================================================================== |
199 | * Test inflate() with small buffers | 199 | * Test inflate() with small buffers |
200 | */ | 200 | */ |
201 | void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr, | 201 | static void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr, |
202 | uLong uncomprLen) { | 202 | uLong uncomprLen) { |
203 | int err; | 203 | int err; |
204 | z_stream d_stream; /* decompression stream */ | 204 | z_stream d_stream; /* decompression stream */ |
@@ -237,7 +237,7 @@ void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr, | |||
237 | /* =========================================================================== | 237 | /* =========================================================================== |
238 | * Test deflate() with large buffers and dynamic change of compression level | 238 | * Test deflate() with large buffers and dynamic change of compression level |
239 | */ | 239 | */ |
240 | void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr, | 240 | static void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr, |
241 | uLong uncomprLen) { | 241 | uLong uncomprLen) { |
242 | z_stream c_stream; /* compression stream */ | 242 | z_stream c_stream; /* compression stream */ |
243 | int err; | 243 | int err; |
@@ -290,7 +290,7 @@ void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr, | |||
290 | /* =========================================================================== | 290 | /* =========================================================================== |
291 | * Test inflate() with large buffers | 291 | * Test inflate() with large buffers |
292 | */ | 292 | */ |
293 | void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr, | 293 | static void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr, |
294 | uLong uncomprLen) { | 294 | uLong uncomprLen) { |
295 | int err; | 295 | int err; |
296 | z_stream d_stream; /* decompression stream */ | 296 | z_stream d_stream; /* decompression stream */ |
@@ -329,7 +329,7 @@ void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr, | |||
329 | /* =========================================================================== | 329 | /* =========================================================================== |
330 | * Test deflate() with full flush | 330 | * Test deflate() with full flush |
331 | */ | 331 | */ |
332 | void test_flush(Byte *compr, uLong *comprLen) { | 332 | static void test_flush(Byte *compr, uLong *comprLen) { |
333 | z_stream c_stream; /* compression stream */ | 333 | z_stream c_stream; /* compression stream */ |
334 | int err; | 334 | int err; |
335 | uInt len = (uInt)strlen(hello)+1; | 335 | uInt len = (uInt)strlen(hello)+1; |
@@ -364,7 +364,8 @@ void test_flush(Byte *compr, uLong *comprLen) { | |||
364 | /* =========================================================================== | 364 | /* =========================================================================== |
365 | * Test inflateSync() | 365 | * Test inflateSync() |
366 | */ | 366 | */ |
367 | void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) { | 367 | static void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, |
368 | uLong uncomprLen) { | ||
368 | int err; | 369 | int err; |
369 | z_stream d_stream; /* decompression stream */ | 370 | z_stream d_stream; /* decompression stream */ |
370 | 371 | ||
@@ -404,7 +405,7 @@ void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) { | |||
404 | /* =========================================================================== | 405 | /* =========================================================================== |
405 | * Test deflate() with preset dictionary | 406 | * Test deflate() with preset dictionary |
406 | */ | 407 | */ |
407 | void test_dict_deflate(Byte *compr, uLong comprLen) { | 408 | static void test_dict_deflate(Byte *compr, uLong comprLen) { |
408 | z_stream c_stream; /* compression stream */ | 409 | z_stream c_stream; /* compression stream */ |
409 | int err; | 410 | int err; |
410 | 411 | ||
@@ -438,7 +439,7 @@ void test_dict_deflate(Byte *compr, uLong comprLen) { | |||
438 | /* =========================================================================== | 439 | /* =========================================================================== |
439 | * Test inflate() with a preset dictionary | 440 | * Test inflate() with a preset dictionary |
440 | */ | 441 | */ |
441 | void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr, | 442 | static void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr, |
442 | uLong uncomprLen) { | 443 | uLong uncomprLen) { |
443 | int err; | 444 | int err; |
444 | z_stream d_stream; /* decompression stream */ | 445 | z_stream d_stream; /* decompression stream */ |