while (s->lookahead >= MIN_MATCH) {
str = s->strstart;
n = s->lookahead - (MIN_MATCH-1);
- bulk_insert_str(s, str, n);
+ insert_string(s, str, n);
s->strstart = str + n;
s->lookahead = MIN_MATCH-1;
fill_window(s);
*/
hash_head = NIL;
if (s->lookahead >= MIN_MATCH) {
- hash_head = insert_string(s, s->strstart);
+ hash_head = insert_string(s, s->strstart, 1);
}
/* Find the longest match, discarding those <= prev_length.
s->strstart++;
#ifdef NOT_TWEAK_COMPILER
do {
- insert_string(s, s->strstart);
+ insert_string(s, s->strstart, 1);
s->strstart++;
/* strstart never exceeds WSIZE-MAX_MATCH, so there are
* always MIN_MATCH bytes ahead.
} while (--s->match_length != 0);
#else
{
- bulk_insert_str(s, s->strstart, s->match_length);
+ insert_string(s, s->strstart, s->match_length);
s->strstart += s->match_length;
s->match_length = 0;
}
s->match_length = 0;
s->ins_h = s->window[s->strstart];
#ifndef NOT_TWEAK_COMPILER
- bulk_insert_str(s, s->strstart + 2 - MIN_MATCH, MIN_MATCH - 2);
+ insert_string(s, s->strstart + 2 - MIN_MATCH, MIN_MATCH - 2);
#else
- insert_string(s, s->strstart + 2 - MIN_MATCH);
+ insert_string(s, s->strstart + 2 - MIN_MATCH, 1);
#if MIN_MATCH != 3
#warning Call insert_string() MIN_MATCH-3 more times
#endif
if (match.match_length) {
if (match.strstart >= match.orgstart) {
- insert_string(s, match.strstart);
+ insert_string(s, match.strstart, 1);
}
}
}
#ifdef NOT_TWEAK_COMPILER
do {
if (likely(match.strstart >= match.orgstart)) {
- insert_string(s, match.strstart);
+ insert_string(s, match.strstart, 1);
}
match.strstart++;
/* strstart never exceeds WSIZE-MAX_MATCH, so there are
s->ins_h = s->window[match.strstart];
if (match.strstart >= 1)
#ifndef NOT_TWEAK_COMPILER
- bulk_insert_str(s, match.strstart + 2 - MIN_MATCH, MIN_MATCH - 2);
+ insert_string(s, match.strstart + 2 - MIN_MATCH, MIN_MATCH - 2);
#else
- insert_string(s, match.strstart + 2 - MIN_MATCH);
+ insert_string(s, match.strstart + 2 - MIN_MATCH, 1);
#if MIN_MATCH != 3
#warning Call insert_string() MIN_MATCH-3 more times
#endif
} else {
hash_head = 0;
if (s->lookahead >= MIN_MATCH) {
- hash_head = insert_string(s, s->strstart);
+ hash_head = insert_string(s, s->strstart, 1);
}
/* set up the initial match to be a 1 byte literal */
/* now, look ahead one */
if (s->lookahead > MIN_LOOKAHEAD) {
s->strstart = current_match.strstart + current_match.match_length;
- hash_head = insert_string(s, s->strstart);
+ hash_head = insert_string(s, s->strstart, 1);
/* set up the initial match to be a 1 byte literal */
next_match.match_start = 0;
return ret;
}
-static inline Pos insert_string(deflate_state *const s, const Pos str) {
+static inline Pos insert_string(deflate_state *const s, const Pos str, uInt count) {
#ifdef X86_SSE4_2_CRC_HASH
if (x86_cpu_has_sse42)
- return insert_string_sse(s, str, 1);
+ return insert_string_sse(s, str, count);
#endif
- return insert_string_c(s, str, 1);
+ return insert_string_c(s, str, count);
}
-#ifndef NOT_TWEAK_COMPILER
-static inline void bulk_insert_str(deflate_state *const s, Pos startpos, uInt count) {
-# ifdef X86_SSE4_2_CRC_HASH
- if (x86_cpu_has_sse42) {
- insert_string_sse(s, startpos, count);
- } else
-# endif
- {
- insert_string_c(s, startpos, count);
- }
-}
-#endif /* NOT_TWEAK_COMPILER */
-
/* ===========================================================================
* Flush the current block, with given end-of-file flag.
* IN assertion: strstart is set to the end of the current match.
*/
hash_head = NIL;
if (s->lookahead >= MIN_MATCH) {
- hash_head = insert_string(s, s->strstart);
+ hash_head = insert_string(s, s->strstart, 1);
}
/* Find the longest match, discarding those <= prev_length.
s->prev_length -= 2;
do {
if (++s->strstart <= max_insert) {
- insert_string(s, s->strstart);
+ insert_string(s, s->strstart, 1);
}
} while (--s->prev_length != 0);
s->match_available = 0;
if (unlikely(insert_cnt > max_insert - s->strstart))
insert_cnt = max_insert - s->strstart;
- bulk_insert_str(s, s->strstart + 1, insert_cnt);
+ insert_string(s, s->strstart + 1, insert_cnt);
s->prev_length = 0;
s->match_available = 0;
s->match_length = MIN_MATCH-1;