aboutsummaryrefslogtreecommitdiff
path: root/gzread.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2013-03-24 15:18:02 -0700
committerMark Adler <madler@alumni.caltech.edu>2013-03-24 16:09:08 -0700
commite9f0b78443884bfd88ead7235bcf5a6a1adae5cd (patch)
tree05561b485bbc8fe51a56634590d8eac025a247a5 /gzread.c
parent0aac8cf7c4da2572609d177657fb5f947bf38cd2 (diff)
downloadzlib-e9f0b78443884bfd88ead7235bcf5a6a1adae5cd.tar.gz
zlib-e9f0b78443884bfd88ead7235bcf5a6a1adae5cd.tar.bz2
zlib-e9f0b78443884bfd88ead7235bcf5a6a1adae5cd.zip
Add casts and consts to ease user conversion to C++.
You would still need to run zlib2ansi on all of the *.c files.
Diffstat (limited to 'gzread.c')
-rw-r--r--gzread.c10
1 files changed, 5 insertions, 5 deletions
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)
91 /* allocate read buffers and inflate memory */ 91 /* allocate read buffers and inflate memory */
92 if (state->size == 0) { 92 if (state->size == 0) {
93 /* allocate buffers */ 93 /* allocate buffers */
94 state->in = malloc(state->want); 94 state->in = (unsigned char *)malloc(state->want);
95 state->out = malloc(state->want << 1); 95 state->out = (unsigned char *)malloc(state->want << 1);
96 if (state->in == NULL || state->out == NULL) { 96 if (state->in == NULL || state->out == NULL) {
97 if (state->out != NULL) 97 if (state->out != NULL)
98 free(state->out); 98 free(state->out);
@@ -353,14 +353,14 @@ int ZEXPORT gzread(file, buf, len)
353 353
354 /* large len -- read directly into user buffer */ 354 /* large len -- read directly into user buffer */
355 else if (state->how == COPY) { /* read directly */ 355 else if (state->how == COPY) { /* read directly */
356 if (gz_load(state, buf, len, &n) == -1) 356 if (gz_load(state, (unsigned char *)buf, len, &n) == -1)
357 return -1; 357 return -1;
358 } 358 }
359 359
360 /* large len -- decompress directly into user buffer */ 360 /* large len -- decompress directly into user buffer */
361 else { /* state->how == GZIP */ 361 else { /* state->how == GZIP */
362 strm->avail_out = len; 362 strm->avail_out = len;
363 strm->next_out = buf; 363 strm->next_out = (unsigned char *)buf;
364 if (gz_decomp(state) == -1) 364 if (gz_decomp(state) == -1)
365 return -1; 365 return -1;
366 n = state->x.have; 366 n = state->x.have;
@@ -523,7 +523,7 @@ char * ZEXPORT gzgets(file, buf, len)
523 523
524 /* look for end-of-line in current output buffer */ 524 /* look for end-of-line in current output buffer */
525 n = state->x.have > left ? left : state->x.have; 525 n = state->x.have > left ? left : state->x.have;
526 eol = memchr(state->x.next, '\n', n); 526 eol = (unsigned char *)memchr(state->x.next, '\n', n);
527 if (eol != NULL) 527 if (eol != NULL)
528 n = (unsigned)(eol - state->x.next) + 1; 528 n = (unsigned)(eol - state->x.next) + 1;
529 529