aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--adler32.c4
-rw-r--r--inflate.c2
-rw-r--r--zlib.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/adler32.c b/adler32.c
index a868f07..cfacc88 100644
--- a/adler32.c
+++ b/adler32.c
@@ -11,7 +11,7 @@
11 11
12local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); 12local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
13 13
14#define BASE 65521 /* largest prime smaller than 65536 */ 14#define BASE 65521U /* largest prime smaller than 65536 */
15#define NMAX 5552 15#define NMAX 5552
16/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ 16/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
17 17
@@ -156,7 +156,7 @@ local uLong adler32_combine_(adler1, adler2, len2)
156 sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; 156 sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
157 if (sum1 >= BASE) sum1 -= BASE; 157 if (sum1 >= BASE) sum1 -= BASE;
158 if (sum1 >= BASE) sum1 -= BASE; 158 if (sum1 >= BASE) sum1 -= BASE;
159 if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1); 159 if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1);
160 if (sum2 >= BASE) sum2 -= BASE; 160 if (sum2 >= BASE) sum2 -= BASE;
161 return sum1 | (sum2 << 16); 161 return sum1 | (sum2 << 16);
162} 162}
diff --git a/inflate.c b/inflate.c
index a718416..72e8438 100644
--- a/inflate.c
+++ b/inflate.c
@@ -243,7 +243,7 @@ int value;
243 } 243 }
244 if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; 244 if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
245 value &= (1L << bits) - 1; 245 value &= (1L << bits) - 1;
246 state->hold += value << state->bits; 246 state->hold += (unsigned)value << state->bits;
247 state->bits += bits; 247 state->bits += bits;
248 return Z_OK; 248 return Z_OK;
249} 249}
diff --git a/zlib.h b/zlib.h
index 40e5732..66dc600 100644
--- a/zlib.h
+++ b/zlib.h
@@ -978,7 +978,7 @@ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
978 location in the input stream can be determined from avail_in and data_type 978 location in the input stream can be determined from avail_in and data_type
979 as noted in the description for the Z_BLOCK flush parameter for inflate. 979 as noted in the description for the Z_BLOCK flush parameter for inflate.
980 980
981 inflateMark returns the value noted above or -1 << 16 if the provided 981 inflateMark returns the value noted above or -65536 if the provided
982 source stream state was inconsistent. 982 source stream state was inconsistent.
983*/ 983*/
984 984