summaryrefslogtreecommitdiff
path: root/inflate.c
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2020-05-28 11:15:59 -0700
committerHans Kristian Rosbach <hk-github@circlestorm.org>2020-05-30 21:16:37 +0200
commitc0dbcace5d16b6fbee02a0c5f64acb160589eeaa (patch)
treec5a85197eec1ced626bbed0897fc7da47ff7ba04 /inflate.c
parentf0de5acd39813eaa07a94c6ef3afdb78c8d33ac4 (diff)
Use a constant to load adler-32 initial hash value.
Diffstat (limited to 'inflate.c')
-rw-r--r--inflate.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/inflate.c b/inflate.c
index 9ccb0de..59fcd83 100644
--- a/inflate.c
+++ b/inflate.c
@@ -64,7 +64,7 @@ int ZEXPORT PREFIX(inflateResetKeep)(PREFIX3(stream) *strm) {
if (state->wrap) /* to support ill-conceived Java test suite */
strm->adler = state->wrap & 1;
state->mode = HEAD;
- state->check = functable.adler32(0L, NULL, 0);
+ state->check = ADLER32_INITIAL_VALUE;
state->last = 0;
state->havedict = 0;
state->flags = -1;
@@ -448,7 +448,7 @@ int ZEXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int flush) {
state->dmax = 1U << len;
state->flags = 0; /* indicate zlib header */
Tracev((stderr, "inflate: zlib header ok\n"));
- strm->adler = state->check = functable.adler32(0L, NULL, 0);
+ strm->adler = state->check = ADLER32_INITIAL_VALUE;
state->mode = hold & 0x200 ? DICTID : TYPE;
INITBITS();
break;
@@ -604,7 +604,7 @@ int ZEXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int flush) {
RESTORE();
return Z_NEED_DICT;
}
- strm->adler = state->check = functable.adler32(0L, NULL, 0);
+ strm->adler = state->check = ADLER32_INITIAL_VALUE;
state->mode = TYPE;
case TYPE:
@@ -1143,8 +1143,7 @@ int ZEXPORT PREFIX(inflateSetDictionary)(PREFIX3(stream) *strm, const unsigned c
/* check for correct dictionary identifier */
if (state->mode == DICT) {
- dictid = functable.adler32(0L, NULL, 0);
- dictid = functable.adler32(dictid, dictionary, dictLength);
+ dictid = functable.adler32(ADLER32_INITIAL_VALUE, dictionary, dictLength);
if (dictid != state->check)
return Z_DATA_ERROR;
}