]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix VS Build: Explicitly Cast to Narrow Ints
authorW. Felix Handte <w@felixhandte.com>
Mon, 30 Aug 2021 16:27:49 +0000 (12:27 -0400)
committerW. Felix Handte <w@felixhandte.com>
Wed, 1 Sep 2021 18:15:04 +0000 (14:15 -0400)
lib/compress/zstd_fast.c

index 33a392dfa017c3655747b4ec5ea2d8e00e9be5df..2555e07204432c3f6004695724b6a9d3bef061c2 100644 (file)
@@ -166,7 +166,7 @@ _start: /* Requires: ip0 */
         const U32 rval = MEM_read32(ip2 - rep_offset1);
 
         /* write back hash table entry */
-        current0 = ip0 - base;
+        current0 = (U32)(ip0 - base);
         hashTable[hash0] = current0;
 
         /* check repcode at ip[2] */
@@ -207,7 +207,7 @@ _start: /* Requires: ip0 */
         ip2 = ip3;
 
         /* write back hash table entry */
-        current0 = ip0 - base;
+        current0 = (U32)(ip0 - base);
         hashTable[hash0] = current0;
 
         /* load match for ip[0] */
@@ -285,7 +285,7 @@ _match: /* Requires: ip0, match0, offcode */
 
     /* write next hash table entry */
     if (ip1 < ip0) {
-        hashTable[hash1] = ip1 - base;
+        hashTable[hash1] = (U32)(ip1 - base);
     }
 
     /* Fill table and check for immediate repcode. */