From: Mark Adler Date: Sun, 12 Feb 2017 06:45:27 +0000 (-0800) Subject: Avoid some conversion warnings in gzread.c and gzwrite.c. X-Git-Tag: 1.9.9-b1~569 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe871690145e2c70f2aacfa906909fbec1f3a257;p=thirdparty%2Fzlib-ng.git Avoid some conversion warnings in gzread.c and gzwrite.c. --- diff --git a/gzread.c b/gzread.c index 4b72875f..e041a381 100644 --- 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) {