]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Avoid some conversion warnings in gzread.c and gzwrite.c.
authorMark Adler <madler@alumni.caltech.edu>
Sun, 12 Feb 2017 06:45:27 +0000 (22:45 -0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Tue, 15 Jan 2019 09:57:45 +0000 (10:57 +0100)
gzread.c

index 4b72875f1946d28467de3ba7db9c568e836b2c18..e041a38170e5b89acd55565075ea83291569dcaa 100644 (file)
--- a/gzread.c
+++ b/gzread.c
@@ -285,7 +285,7 @@ static size_t gz_read(gz_state *state, void *buf, size_t len) {
     got = 0;
     do {
         /* set n to the maximum amount of len that fits in an unsigned int */
-        n = -1;
+        n = (unsigned)-1;
         if (n > len)
             n = (unsigned)len;
 
@@ -408,7 +408,6 @@ size_t ZEXPORT PREFIX(gzfread)(void *buf, size_t size, size_t nitems, gzFile fil
 #undef gzgetc
 #undef zng_gzgetc
 int ZEXPORT PREFIX(gzgetc)(gzFile file) {
-    int ret;
     unsigned char buf[1];
     gz_state *state;
 
@@ -429,8 +428,7 @@ int ZEXPORT PREFIX(gzgetc)(gzFile file) {
     }
 
     /* nothing there -- try gz_read() */
-    ret = (int)gz_read(state, buf, 1);
-    return ret < 1 ? -1 : buf[0];
+    return gz_read(state, buf, 1) < 1 ? -1 : buf[0];
 }
 
 int ZEXPORT PREFIX(gzgetc_)(gzFile file) {