diff options
Diffstat (limited to '')
| -rw-r--r-- | adler32.c | 24 |
1 files changed, 12 insertions, 12 deletions
| @@ -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 | } |
