summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2016-12-31 08:49:17 -0800
committerMark Adler <madler@alumni.caltech.edu>2016-12-31 08:49:17 -0800
commitb7fbee215674c3399212dffba1e71323056931d9 (patch)
tree4bbc5237bdd56b65dc4fb3f49bac359cec26f9cc
parentf3fcb92cf6c81b3ecd04b3ceb9243548b80c0cd9 (diff)
downloadzlib-b7fbee215674c3399212dffba1e71323056931d9.tar.gz
zlib-b7fbee215674c3399212dffba1e71323056931d9.tar.bz2
zlib-b7fbee215674c3399212dffba1e71323056931d9.zip
Use a uniform approach for the largest value of an unsigned type.
-rw-r--r--compress.c2
-rw-r--r--inflate.c2
-rw-r--r--uncompr.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/compress.c b/compress.c
index e5831e8..f0d0757 100644
--- a/compress.c
+++ b/compress.c
@@ -28,7 +28,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
28{ 28{
29 z_stream stream; 29 z_stream stream;
30 int err; 30 int err;
31 const uInt max = (uInt)0 - 1; 31 const uInt max = (uInt)-1;
32 uLong left; 32 uLong left;
33 33
34 left = *destLen; 34 left = *destLen;
diff --git a/inflate.c b/inflate.c
index 0372edf..92e9139 100644
--- a/inflate.c
+++ b/inflate.c
@@ -1555,7 +1555,7 @@ unsigned long ZEXPORT inflateCodesUsed(strm)
1555z_streamp strm; 1555z_streamp strm;
1556{ 1556{
1557 struct inflate_state FAR *state; 1557 struct inflate_state FAR *state;
1558 if (inflateStateCheck(strm)) return (unsigned long)0 - 1; 1558 if (inflateStateCheck(strm)) return (unsigned long)-1;
1559 state = (struct inflate_state FAR *)strm->state; 1559 state = (struct inflate_state FAR *)strm->state;
1560 return (unsigned long)(state->next - state->codes); 1560 return (unsigned long)(state->next - state->codes);
1561} 1561}
diff --git a/uncompr.c b/uncompr.c
index 2fbfcc0..f03a1a8 100644
--- a/uncompr.c
+++ b/uncompr.c
@@ -32,7 +32,7 @@ int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
32{ 32{
33 z_stream stream; 33 z_stream stream;
34 int err; 34 int err;
35 const uInt max = (uInt)0 - 1; 35 const uInt max = (uInt)-1;
36 uLong len, left; 36 uLong len, left;
37 Byte buf[1]; /* for detection of incomplete stream when *destLen == 0 */ 37 Byte buf[1]; /* for detection of incomplete stream when *destLen == 0 */
38 38