From: Hans Kristian Rosbach Date: Mon, 10 May 2021 15:11:54 +0000 (+0200) Subject: Minor formatting changes related to MIN_MATCH/MAX_MATCH X-Git-Tag: 2.1.0-beta1~575 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6bea8508876f8b712f26a4130158f79e5e1fa6e0;p=thirdparty%2Fzlib-ng.git Minor formatting changes related to MIN_MATCH/MAX_MATCH --- diff --git a/deflate.c b/deflate.c index f95c6859..73cd58a4 100644 --- a/deflate.c +++ b/deflate.c @@ -433,17 +433,17 @@ int32_t Z_EXPORT PREFIX(deflateSetDictionary)(PREFIX3(stream) *strm, const uint8 fill_window(s); while (s->lookahead >= STD_MIN_MATCH) { str = s->strstart; - n = s->lookahead - (STD_MIN_MATCH-1); + n = s->lookahead - (STD_MIN_MATCH - 1); functable.insert_string(s, str, n); s->strstart = str + n; - s->lookahead = STD_MIN_MATCH-1; + s->lookahead = STD_MIN_MATCH - 1; fill_window(s); } s->strstart += s->lookahead; s->block_start = (int)s->strstart; s->insert = s->lookahead; s->lookahead = 0; - s->prev_length = STD_MIN_MATCH-1; + s->prev_length = STD_MIN_MATCH - 1; s->match_available = 0; strm->next_in = (z_const unsigned char *)next; strm->avail_in = avail; @@ -1160,7 +1160,7 @@ static void lm_init(deflate_state *s) { s->block_start = 0; s->lookahead = 0; s->insert = 0; - s->prev_length = STD_MIN_MATCH-1; + s->prev_length = STD_MIN_MATCH - 1; s->match_available = 0; s->match_start = 0; } diff --git a/deflate_fast.c b/deflate_fast.c index 4d335a3d..074e9676 100644 --- a/deflate_fast.c +++ b/deflate_fast.c @@ -95,7 +95,7 @@ Z_INTERNAL block_state deflate_fast(deflate_state *s, int flush) { if (UNLIKELY(bflush)) FLUSH_BLOCK(s, 0); } - s->insert = s->strstart < STD_MIN_MATCH-1 ? s->strstart : STD_MIN_MATCH-1; + s->insert = s->strstart < (STD_MIN_MATCH - 1) ? s->strstart : (STD_MIN_MATCH - 1); if (UNLIKELY(flush == Z_FINISH)) { FLUSH_BLOCK(s, 1); return finish_done; diff --git a/deflate_medium.c b/deflate_medium.c index 25f3a0b1..71eb4835 100644 --- a/deflate_medium.c +++ b/deflate_medium.c @@ -67,7 +67,7 @@ static void insert_match(deflate_state *s, struct match match) { /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. */ - if (match.match_length <= 16* s->max_insert_length && s->lookahead >= WANT_MIN_MATCH) { + if (match.match_length <= 16 * s->max_insert_length && s->lookahead >= WANT_MIN_MATCH) { match.match_length--; /* string at strstart already in table */ match.strstart++; @@ -283,7 +283,7 @@ Z_INTERNAL block_state deflate_medium(deflate_state *s, int flush) { if (UNLIKELY(bflush)) FLUSH_BLOCK(s, 0); } - s->insert = s->strstart < STD_MIN_MATCH-1 ? s->strstart : STD_MIN_MATCH-1; + s->insert = s->strstart < (STD_MIN_MATCH - 1) ? s->strstart : (STD_MIN_MATCH - 1); if (flush == Z_FINISH) { FLUSH_BLOCK(s, 1); return finish_done; diff --git a/deflate_quick.c b/deflate_quick.c index 50e861cc..8b983971 100644 --- a/deflate_quick.c +++ b/deflate_quick.c @@ -110,7 +110,7 @@ Z_INTERNAL block_state deflate_quick(deflate_state *s, int flush) { s->lookahead--; } - s->insert = s->strstart < STD_MIN_MATCH-1 ? s->strstart : STD_MIN_MATCH-1; + s->insert = s->strstart < (STD_MIN_MATCH - 1) ? s->strstart : (STD_MIN_MATCH - 1); if (UNLIKELY(last)) { QUICK_END_BLOCK(s, 1); return finish_done; diff --git a/deflate_slow.c b/deflate_slow.c index d97eb2c9..ac7e87ee 100644 --- a/deflate_slow.c +++ b/deflate_slow.c @@ -47,7 +47,7 @@ Z_INTERNAL block_state deflate_slow(deflate_state *s, int flush) { /* Find the longest match, discarding those <= prev_length. */ s->prev_match = (Pos)s->match_start; - match_len = STD_MIN_MATCH-1; + match_len = STD_MIN_MATCH - 1; dist = (int64_t)s->strstart - hash_head; if (dist <= MAX_DIST(s) && dist > 0 && s->prev_length < s->max_lazy_match && hash_head != 0) { @@ -62,7 +62,7 @@ Z_INTERNAL block_state deflate_slow(deflate_state *s, int flush) { /* If prev_match is also WANT_MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. */ - match_len = STD_MIN_MATCH-1; + match_len = STD_MIN_MATCH - 1; } } /* If there was a match at the previous step and the current @@ -126,7 +126,7 @@ Z_INTERNAL block_state deflate_slow(deflate_state *s, int flush) { (void) zng_tr_tally_lit(s, s->window[s->strstart-1]); s->match_available = 0; } - s->insert = s->strstart < STD_MIN_MATCH-1 ? s->strstart : STD_MIN_MATCH-1; + s->insert = s->strstart < (STD_MIN_MATCH - 1) ? s->strstart : (STD_MIN_MATCH - 1); if (UNLIKELY(flush == Z_FINISH)) { FLUSH_BLOCK(s, 1); return finish_done;