#define HASH_CALC(h, val) h = ((val * 2654435761U) >> HASH_SLIDE);
#define HASH_CALC_VAR h
-#define HASH_CALC_VAR_INIT uint32_t h = 0
+#define HASH_CALC_VAR_INIT uint32_t h
#define UPDATE_HASH update_hash
#define INSERT_STRING insert_string
* the previous length of the hash chain.
*/
Z_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, uint32_t str) {
- Pos head;
uint8_t *strstart = s->window + str + HASH_CALC_OFFSET;
uint32_t val, hm;
+ Pos head;
HASH_CALC_VAR_INIT;
HASH_CALC_READ;
Z_INTERNAL void INSERT_STRING(deflate_state *const s, uint32_t str, uint32_t count) {
uint8_t *strstart = s->window + str + HASH_CALC_OFFSET;
uint8_t *strend = strstart + count;
+ Pos *headp = s->head;
+ Pos *prevp = s->prev;
+ const unsigned int w_mask = s->w_mask;
for (Pos idx = (Pos)str; strstart < strend; idx++, strstart++) {
uint32_t val, hm;
HASH_CALC_VAR &= HASH_CALC_MASK;
hm = HASH_CALC_VAR;
- Pos head = s->head[hm];
+ Pos head = headp[hm];
if (LIKELY(head != idx)) {
- s->prev[idx & s->w_mask] = head;
- s->head[hm] = idx;
+ prevp[idx & w_mask] = head;
+ headp[hm] = idx;
}
}
}