Add casts in gzwrite.c for pointer differences.

pull/40/merge
Mark Adler 12 years ago
parent 9b703f2000
commit 70252daf89
  1. 3
      gzguts.h
  2. 4
      gzwrite.c

@ -142,7 +142,8 @@
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
#endif
/* default i/o buffer size -- double this for output when reading */
/* default i/o buffer size -- double this for output when reading (this and
twice this must be able to fit in an unsigned type) */
#define GZBUFSIZE 8192
/* gzip modes, also provide a little integrity check on the passed structure */

@ -211,7 +211,7 @@ int ZEXPORT gzwrite(file, buf, len)
if (strm->avail_in == 0)
strm->next_in = state->in;
have = strm->next_in + strm->avail_in - state->in;
have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
copy = state->size - have;
if (copy > len)
copy = len;
@ -273,7 +273,7 @@ int ZEXPORT gzputc(file, c)
if (state->size) {
if (strm->avail_in == 0)
strm->next_in = state->in;
have = strm->next_in + strm->avail_in - state->in;
have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
if (have < state->size) {
state->in[have] = c;
strm->avail_in++;

Loading…
Cancel
Save