summaryrefslogtreecommitdiffstats
path: root/modules/zlib/src/adler32.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-26 21:58:58 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-26 21:58:58 +0200
commit0ccb5a03bb72105b295e9a5ae79510c7bfeee112 (patch)
tree9cef491ea75e491ac795349b4a9254a92e3a6e8d /modules/zlib/src/adler32.c
parentddd7d45862e89d462851d226c8c29e2602633e05 (diff)
downloadUXP-0ccb5a03bb72105b295e9a5ae79510c7bfeee112.tar
UXP-0ccb5a03bb72105b295e9a5ae79510c7bfeee112.tar.gz
UXP-0ccb5a03bb72105b295e9a5ae79510c7bfeee112.tar.lz
UXP-0ccb5a03bb72105b295e9a5ae79510c7bfeee112.tar.xz
UXP-0ccb5a03bb72105b295e9a5ae79510c7bfeee112.zip
Update zlib to 1.2.11
This resolves #676
Diffstat (limited to 'modules/zlib/src/adler32.c')
-rw-r--r--modules/zlib/src/adler32.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/modules/zlib/src/adler32.c b/modules/zlib/src/adler32.c
index a868f073d..d0be4380a 100644
--- a/modules/zlib/src/adler32.c
+++ b/modules/zlib/src/adler32.c
@@ -1,5 +1,5 @@
/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-2011 Mark Adler
+ * Copyright (C) 1995-2011, 2016 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -7,11 +7,9 @@
#include "zutil.h"
-#define local static
-
local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
-#define BASE 65521 /* largest prime smaller than 65536 */
+#define BASE 65521U /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
@@ -62,10 +60,10 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
#endif
/* ========================================================================= */
-uLong ZEXPORT adler32(adler, buf, len)
+uLong ZEXPORT adler32_z(adler, buf, len)
uLong adler;
const Bytef *buf;
- uInt len;
+ z_size_t len;
{
unsigned long sum2;
unsigned n;
@@ -133,6 +131,15 @@ uLong ZEXPORT adler32(adler, buf, len)
}
/* ========================================================================= */
+uLong ZEXPORT adler32(adler, buf, len)
+ uLong adler;
+ const Bytef *buf;
+ uInt len;
+{
+ return adler32_z(adler, buf, len);
+}
+
+/* ========================================================================= */
local uLong adler32_combine_(adler1, adler2, len2)
uLong adler1;
uLong adler2;
@@ -156,7 +163,7 @@ local uLong adler32_combine_(adler1, adler2, len2)
sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
if (sum1 >= BASE) sum1 -= BASE;
if (sum1 >= BASE) sum1 -= BASE;
- if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
+ if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1);
if (sum2 >= BASE) sum2 -= BASE;
return sum1 | (sum2 << 16);
}