From: Nathan Moinvaziri Date: Fri, 2 Oct 2020 05:47:22 +0000 (-0700) Subject: Fixed match_start uint32_t to uint16_t casting warnings in deflate_medium.c X-Git-Tag: v2.0.0-RC1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d33736b031b10c4499bade95cdd22b0a1fb4ddb;p=thirdparty%2Fzlib-ng.git Fixed match_start uint32_t to uint16_t casting warnings in deflate_medium.c 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 --- diff --git a/deflate_medium.c b/deflate_medium.c index 27ca1905..8335942a 100644 --- a/deflate_medium.c +++ b/deflate_medium.c @@ -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;