From: Nathan Moinvaziri Date: Wed, 1 Jul 2020 03:00:30 +0000 (-0700) Subject: Fixed integer casting and signed comparison warning in test_gzio. X-Git-Tag: 1.9.9-b1~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3efa8c2b3c70c54d3ca14b84c0287b58365eea7b;p=thirdparty%2Fzlib-ng.git Fixed integer casting and signed comparison warning in test_gzio. example.c(199,57): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data example.c:207:32: warning: comparison between signed and unsigned integer expressions --- diff --git a/test/example.c b/test/example.c index 80cb82cb..c1161a7e 100644 --- a/test/example.c +++ b/test/example.c @@ -81,11 +81,12 @@ void test_gzio(const char *fname, unsigned char *uncompr, z_size_t uncomprLen) { #ifdef NO_GZCOMPRESS fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n"); #else - int err, read; + int err; + size_t read; size_t len = strlen(hello)+1; - z_off64_t comprLen; gzFile file; z_off64_t pos; + z_off64_t comprLen; /* Write gz file with test data */ file = PREFIX(gzopen)(fname, "wb"); @@ -203,7 +204,7 @@ void test_gzio(const char *fname, unsigned char *uncompr, z_size_t uncomprLen) { printf("gzgets(): %s\n", (char*)uncompr); } pos = PREFIX(gzoffset)(file); - if (pos < 0 || (size_t)pos != (comprLen + 10)) { + if (pos < 0 || pos != (comprLen + 10)) { fprintf(stderr, "gzoffset err: wrong offset at end\n"); exit(1); }