summaryrefslogtreecommitdiff
path: root/deflate_medium.c
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2020-10-01 22:47:22 -0700
committerHans Kristian Rosbach <hk-github@circlestorm.org>2020-11-02 17:01:58 +0100
commit8d33736b031b10c4499bade95cdd22b0a1fb4ddb (patch)
treef04f44c700fe6c3f12ac964d5a87e4bd45b9f203 /deflate_medium.c
parent48c08916e8a86da4786c738b311dacfbbcd87681 (diff)
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
Diffstat (limited to 'deflate_medium.c')
-rw-r--r--deflate_medium.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/deflate_medium.c b/deflate_medium.c
index 27ca190..8335942 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;