From: Nathan Moinvaziri Date: Sat, 4 Jul 2020 03:31:36 +0000 (-0700) Subject: Fixed possible loss of data warning in LONGEST_MATCH. X-Git-Tag: 1.9.9-b1~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2928d96e2a950f81ade2ff198a11800d2168b983;p=thirdparty%2Fzlib-ng.git 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 --- 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);