summaryrefslogtreecommitdiff
path: root/adler32.c
diff options
context:
space:
mode:
Diffstat (limited to 'adler32.c')
-rw-r--r--adler32.c4
1 files changed, 2 insertions, 2 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}