18 #define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
19 #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
20 #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
21 #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
22 #define DO16(buf) DO8(buf,0); DO8(buf,8);
31 unsigned long tmp = a >> 16; \
33 a += (tmp << 4) - tmp; \
38 if (a >= BASE) a -= BASE; \
47 z_off64_t tmp = a >> 32; \
49 a += (tmp << 8) - (tmp << 5) + tmp; \
52 a += (tmp << 4) - tmp; \
55 a += (tmp << 4) - tmp; \
56 if (a >= BASE) a -= BASE; \
59 # define MOD(a) a %= BASE
60 # define MOD28(a) a %= BASE
61 # define MOD63(a) a %= BASE
65 uLong ZEXPORT
adler32(uLong adler,
const Bytef *buf, uInt
len)
71 sum2 = (adler >> 16) & 0xffff;
82 return adler | (sum2 << 16);
98 return adler | (sum2 << 16);
102 while (len >=
NMAX) {
129 return adler | (sum2 << 16);
145 rem = (unsigned)len2;
146 sum1 = adler1 & 0xffff;
149 sum1 += (adler2 & 0xffff) +
BASE - 1;
150 sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) +
BASE - rem;
153 if (sum2 >= (
BASE << 1)) sum2 -= (
BASE << 1);
155 return sum1 | (sum2 << 16);
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len)
static constexpr double L
uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2)
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2)
uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2)
voidpf alloc_func OF((voidpf opaque, uInt items, uInt size))