From: Nathan Moinvaziri Date: Fri, 2 Oct 2020 05:49:28 +0000 (-0700) Subject: Fixed str uint32_t to uint16_t casting warnings in inflate_string_tpl.h X-Git-Tag: v2.0.0-RC1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=020b5be33e379c16ee6f42733b8f3a0ea93ec3ff;p=thirdparty%2Fzlib-ng.git Fixed str uint32_t to uint16_t casting warnings in inflate_string_tpl.h insert_string_tpl.h(50,26): warning C4244: '=': conversion from 'const uint32_t' to 'Pos', possible loss of data insert_string_tpl.h(67,1): warning C4244: 'initializing': conversion from 'const uint32_t' to 'Pos', possible loss of data --- diff --git a/insert_string_tpl.h b/insert_string_tpl.h index 653bb96c0..9796e5196 100644 --- a/insert_string_tpl.h +++ b/insert_string_tpl.h @@ -47,7 +47,7 @@ Z_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, const uint32_t str) { head = s->head[hm]; if (LIKELY(head != str)) { s->prev[str & s->w_mask] = head; - s->head[hm] = str; + s->head[hm] = (Pos)str; } return head; } @@ -64,7 +64,7 @@ Z_INTERNAL void INSERT_STRING(deflate_state *const s, const uint32_t str, uint32 uint8_t *strstart = s->window + str; uint8_t *strend = strstart + count - 1; /* last position */ - for (Pos idx = str; strstart <= strend; idx++, strstart++) { + for (Pos idx = (Pos)str; strstart <= strend; idx++, strstart++) { uint32_t val, hm, h = 0; #ifdef UNALIGNED_OK