From 793ad7f559555757e6443ea591ce70de5505fc69 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sat, 11 Feb 2017 22:45:27 -0800 Subject: Avoid some conversion warnings in gzread.c and gzwrite.c. --- gzread.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'gzread.c') diff --git a/gzread.c b/gzread.c index 956b91e..f94abfe 100644 --- a/gzread.c +++ b/gzread.c @@ -314,9 +314,9 @@ local z_size_t gz_read(state, buf, 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 = len; + n = (unsigned)len; /* first just try copying data from the output buffer */ if (state->x.have) { @@ -397,7 +397,7 @@ int ZEXPORT gzread(file, buf, len) } /* read len or fewer bytes to buf */ - len = gz_read(state, buf, len); + len = (unsigned)gz_read(state, buf, len); /* check for an error */ if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR) @@ -447,7 +447,6 @@ z_size_t ZEXPORT gzfread(buf, size, nitems, file) int ZEXPORT gzgetc(file) gzFile file; { - int ret; unsigned char buf[1]; gz_statep state; @@ -469,8 +468,7 @@ int ZEXPORT gzgetc(file) } /* nothing there -- try gz_read() */ - ret = gz_read(state, buf, 1); - return ret < 1 ? -1 : buf[0]; + return gz_read(state, buf, 1) < 1 ? -1 : buf[0]; } int ZEXPORT gzgetc_(file) -- cgit v1.2.3-55-g6feb