]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed match_start uint32_t to uint16_t casting warnings in deflate_medium.c
authorNathan Moinvaziri <nathan@nathanm.com>
Fri, 2 Oct 2020 05:47:22 +0000 (22:47 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 2 Nov 2020 16:01:58 +0000 (17:01 +0100)
  deflate_medium.c(204,49): warning C4244: '=': conversion from 'unsigned int' to 'uint16_t', possible loss of data
  deflate_medium.c(217,59): warning C4244: '=': conversion from 'unsigned int' to 'uint16_t', possible loss of data
  deflate_medium.c(238,46): warning C4244: '=': conversion from 'unsigned int' to 'uint16_t', possible loss of data
  deflate_medium.c(250,56): warning C4244: '=': conversion from 'unsigned int' to 'uint16_t', possible loss of data

deflate_medium.c

index 27ca1905ef25429bc7187c9eba3305e073803cfa..8335942a3dedac30d921754ef16d1723167e84ec 100644 (file)
@@ -202,7 +202,7 @@ Z_INTERNAL block_state deflate_medium(deflate_state *s, int flush) {
                 hash_head = functable.quick_insert_string(s, s->strstart);
             }
 
-            current_match.strstart = s->strstart;
+            current_match.strstart = (uint16_t)s->strstart;
             current_match.orgstart = current_match.strstart;
 
             /* Find the longest match, discarding those <= prev_length.
@@ -216,7 +216,7 @@ Z_INTERNAL block_state deflate_medium(deflate_state *s, int flush) {
                  * of the string with itself at the start of the input file).
                  */
                 current_match.match_length = (uint16_t)functable.longest_match(s, hash_head);
-                current_match.match_start = s->match_start;
+                current_match.match_start = (uint16_t)s->match_start;
                 if (UNLIKELY(current_match.match_length < MIN_MATCH))
                     current_match.match_length = 1;
                 if (UNLIKELY(current_match.match_start >= current_match.strstart)) {
@@ -237,7 +237,7 @@ Z_INTERNAL block_state deflate_medium(deflate_state *s, int flush) {
             s->strstart = current_match.strstart + current_match.match_length;
             hash_head = functable.quick_insert_string(s, s->strstart);
 
-            next_match.strstart = s->strstart;
+            next_match.strstart = (uint16_t)s->strstart;
             next_match.orgstart = next_match.strstart;
 
             /* Find the longest match, discarding those <= prev_length.
@@ -251,7 +251,7 @@ Z_INTERNAL block_state deflate_medium(deflate_state *s, int flush) {
                  * of the string with itself at the start of the input file).
                  */
                 next_match.match_length = (uint16_t)functable.longest_match(s, hash_head);
-                next_match.match_start = s->match_start;
+                next_match.match_start = (uint16_t)s->match_start;
                 if (UNLIKELY(next_match.match_start >= next_match.strstart)) {
                     /* this can happen due to some restarts */
                     next_match.match_length = 1;