/* set n to the maximum amount of len that fits in an unsigned int */
n = -1;
if (n > len)
- n = len;
+ n = (unsigned)len;
/* first just try copying data from the output buffer */
if (state->x.have) {
}
/* 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)
}
/* nothing there -- try gz_read() */
- ret = gz_read(state, buf, 1);
+ ret = (int)gz_read(state, buf, 1);
return ret < 1 ? -1 : buf[0];
}
state->in);
copy = state->size - have;
if (copy > len)
- copy = len;
+ copy = (unsigned)len;
memcpy(state->in + have, buf, copy);
state->strm.avail_in += copy;
state->x.pos += copy;
do {
unsigned n = (unsigned)-1;
if (n > len)
- n = len;
+ n = (unsigned)len;
state->strm.avail_in = n;
state->x.pos += n;
if (gz_comp(state, Z_NO_FLUSH) == -1)
/* write string */
len = strlen(str);
- ret = gz_write(state, str, len);
+ ret = (int)gz_write(state, str, len);
return ret == 0 && len != 0 ? -1 : ret;
}