]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed str uint32_t to uint16_t casting warnings in inflate_string_tpl.h
authorNathan Moinvaziri <nathan@nathanm.com>
Fri, 2 Oct 2020 05:49:28 +0000 (22:49 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 2 Nov 2020 16:01:58 +0000 (17:01 +0100)
  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

insert_string_tpl.h

index 653bb96c0dfe01142d8ea318f5a57913fcf0d0fa..9796e5196cc4fb2fc741bebdbdde78e1a3c061ae 100644 (file)
@@ -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