]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Minor formatting changes related to MIN_MATCH/MAX_MATCH
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Mon, 10 May 2021 15:11:54 +0000 (17:11 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 13 Jun 2021 18:55:01 +0000 (20:55 +0200)
deflate.c
deflate_fast.c
deflate_medium.c
deflate_quick.c
deflate_slow.c

index f95c6859afdf0e649fdfa7e7a4af45c1b629355f..73cd58a448404e2843b8d4af69205cb0a8e7cf03 100644 (file)
--- 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;
 }
index 4d335a3dc68b4b24f0fd00c35828ef2851148855..074e9676be98e57e99b7515f55b40057ee139511 100644 (file)
@@ -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;
index 25f3a0b1834f2c638bbead379830e1a6869d8704..71eb48350e250dac731380ffcfdcce5b61e4556f 100644 (file)
@@ -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;
index 50e861cceb51c3783430e06724d49704eb1cd91a..8b983971616be6e5f1c5953950a98f7bc7848a58 100644 (file)
@@ -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;
index d97eb2c974dce2b2adc9329a9114ae8a62216f20..ac7e87ee50bd37bf85799278df643d87f6e330bf 100644 (file)
@@ -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;