From 2928d96e2a950f81ade2ff198a11800d2168b983 Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Fri, 3 Jul 2020 20:31:36 -0700 Subject: [PATCH] Fixed possible loss of data warning in LONGEST_MATCH. match_tpl.h(69,64): warning C4244: '=': conversion from 'unsigned int' to 'Pos', possible loss of data --- match_tpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/match_tpl.h b/match_tpl.h index ddfaf408..24bf01de 100644 --- a/match_tpl.h +++ b/match_tpl.h @@ -66,7 +66,7 @@ ZLIB_INTERNAL int32_t LONGEST_MATCH(deflate_state *const s, Pos cur_match) { * Stop when cur_match becomes <= limit. To simplify the code, * we prevent matches with the string of window index 0 */ - limit = strstart > MAX_DIST(s) ? strstart - MAX_DIST(s) : 0; + limit = strstart > MAX_DIST(s) ? (Pos)(strstart - MAX_DIST(s)) : 0; scan_start = *(bestcmp_t *)(scan); scan_end = *(bestcmp_t *)(scan+best_len-1); -- 2.47.2