From e9f0b78443884bfd88ead7235bcf5a6a1adae5cd Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sun, 24 Mar 2013 15:18:02 -0700 Subject: Add casts and consts to ease user conversion to C++. You would still need to run zlib2ansi on all of the *.c files. --- gzread.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gzread.c') diff --git a/gzread.c b/gzread.c index 52985c9..3b497cf 100644 --- a/gzread.c +++ b/gzread.c @@ -91,8 +91,8 @@ local int gz_look(state) /* allocate read buffers and inflate memory */ if (state->size == 0) { /* allocate buffers */ - state->in = malloc(state->want); - state->out = malloc(state->want << 1); + state->in = (unsigned char *)malloc(state->want); + state->out = (unsigned char *)malloc(state->want << 1); if (state->in == NULL || state->out == NULL) { if (state->out != NULL) free(state->out); @@ -353,14 +353,14 @@ int ZEXPORT gzread(file, buf, len) /* large len -- read directly into user buffer */ else if (state->how == COPY) { /* read directly */ - if (gz_load(state, buf, len, &n) == -1) + if (gz_load(state, (unsigned char *)buf, len, &n) == -1) return -1; } /* large len -- decompress directly into user buffer */ else { /* state->how == GZIP */ strm->avail_out = len; - strm->next_out = buf; + strm->next_out = (unsigned char *)buf; if (gz_decomp(state) == -1) return -1; n = state->x.have; @@ -523,7 +523,7 @@ char * ZEXPORT gzgets(file, buf, len) /* look for end-of-line in current output buffer */ n = state->x.have > left ? left : state->x.have; - eol = memchr(state->x.next, '\n', n); + eol = (unsigned char *)memchr(state->x.next, '\n', n); if (eol != NULL) n = (unsigned)(eol - state->x.next) + 1; -- cgit v1.2.1