From fe871690145e2c70f2aacfa906909fbec1f3a257 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sat, 11 Feb 2017 22:45:27 -0800 Subject: [PATCH] Avoid some conversion warnings in gzread.c and gzwrite.c. --- gzread.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) { -- 2.47.2