Apply changes from commit e54e129 of https://github.com/madler/zlib/ repository to silence compiler warning about shifting a negative signed value.

This commit is contained in:
Martin Winter
2016-04-01 13:57:52 +01:00
parent 64185c4750
commit 2485f97586

View File

@@ -1504,9 +1504,10 @@ z_streamp strm;
{
struct inflate_state FAR *state;
if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
if (strm == Z_NULL || strm->state == Z_NULL)
return (long)(((unsigned long)0 - 1) << 16);
state = (struct inflate_state FAR *)strm->state;
return ((long)(state->back) << 16) +
return (long)(((unsigned long)((long)state->back)) << 16) +
(state->mode == COPY ? state->length :
(state->mode == MATCH ? state->was - state->length : 0));
}