aboutsummaryrefslogtreecommitdiff
path: root/adler32.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:08:07 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:08:07 -0700
commitbdde4e09d21edff02ea5093b7f6eccbf166b272f (patch)
treea64632a98a6bea6e5df864d6e5b6f2e51ea69c1c /adler32.c
parent1c71d8b13b54f91ddec361d3053ecce26e6ff761 (diff)
downloadzlib-bdde4e09d21edff02ea5093b7f6eccbf166b272f.tar.gz
zlib-bdde4e09d21edff02ea5093b7f6eccbf166b272f.tar.bz2
zlib-bdde4e09d21edff02ea5093b7f6eccbf166b272f.zip
zlib 0.92v0.92
Diffstat (limited to 'adler32.c')
-rw-r--r--adler32.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/adler32.c b/adler32.c
index 0b2b820..0ad9bec 100644
--- a/adler32.c
+++ b/adler32.c
@@ -3,7 +3,7 @@
3 * For conditions of distribution and use, see copyright notice in zlib.h 3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */ 4 */
5 5
6/* $Id: adler32.c,v 1.5 1995/04/14 14:49:51 jloup Exp $ */ 6/* $Id: adler32.c,v 1.6 1995/05/03 17:27:08 jloup Exp $ */
7 7
8#include "zutil.h" 8#include "zutil.h"
9 9
@@ -30,17 +30,17 @@ uLong adler32(adler, buf, len)
30 if (buf == Z_NULL) return 1L; 30 if (buf == Z_NULL) return 1L;
31 31
32 while (len > 0) { 32 while (len > 0) {
33 k = len < NMAX ? len : NMAX; 33 k = len < NMAX ? len : NMAX;
34 len -= k; 34 len -= k;
35 while (k >= 16) { 35 while (k >= 16) {
36 DO16(buf); 36 DO16(buf);
37 k -= 16; 37 k -= 16;
38 } 38 }
39 if (k != 0) do { 39 if (k != 0) do {
40 DO1(buf); 40 DO1(buf);
41 } while (--k); 41 } while (--k);
42 s1 %= BASE; 42 s1 %= BASE;
43 s2 %= BASE; 43 s2 %= BASE;
44 } 44 }
45 return (s2 << 16) | s1; 45 return (s2 << 16) | s1;
46} 46}