]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Avoid compilation warning in bundled zlib
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 22 Jul 2016 13:36:20 +0000 (15:36 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 22 Jul 2016 13:41:04 +0000 (15:41 +0200)
Applied upstream fix madler/zlib@e54e129.

Closes #121.

zlib/inflate.c

index 870f89bb4d3646684bf37e2144c4b83c808ab84d..4fd3f3c1809b49b3e223a3f4f5698fd097ebb287 100644 (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));
 }