aboutsummaryrefslogtreecommitdiff
path: root/test/example.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2023-09-03 13:10:10 -0700
committerMark Adler <madler@alumni.caltech.edu>2023-09-03 21:50:07 -0700
commitbd9c329c1055a9265812352655ed2eec93f36e92 (patch)
tree8661055737be23759ced7d2b5c2ecdf73e85c59b /test/example.c
parent5af7cef45eeef86ddf6ab00b4e363c1eecaf47b6 (diff)
downloadzlib-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.c25
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
39void *myalloc(void *q, unsigned n, unsigned m) { 39static 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
44void myfree(void *q, void *p) { 44static 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 */
60void test_compress(Byte *compr, uLong comprLen, Byte *uncompr, 60static 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 */
84void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) { 84static 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 */
166void test_deflate(Byte *compr, uLong comprLen) { 166static 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 */
201void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr, 201static 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 */
240void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr, 240static 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 */
293void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr, 293static 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 */
332void test_flush(Byte *compr, uLong *comprLen) { 332static 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 */
367void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) { 367static 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 */
407void test_dict_deflate(Byte *compr, uLong comprLen) { 408static 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 */
441void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr, 442static 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 */