diff options
author | Nathan Moinvaziri <nathan@nathanm.com> | 2020-06-30 20:00:30 -0700 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2020-07-01 23:06:53 +0200 |
commit | 3efa8c2b3c70c54d3ca14b84c0287b58365eea7b (patch) | |
tree | 2879718972333262c7b679b8d392c0c4980d53c9 /test/example.c | |
parent | 6b8b4fab47d3cc37e83c9f21f86e854273ce3af0 (diff) |
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
Diffstat (limited to 'test/example.c')
-rw-r--r-- | test/example.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/example.c b/test/example.c index 80cb82c..c1161a7 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); } |