]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed conversion warning
authorYann Collet <yann.collet.73@gmail.com>
Tue, 12 Jul 2016 13:11:40 +0000 (15:11 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Tue, 12 Jul 2016 13:11:40 +0000 (15:11 +0200)
lib/compress/zstd_compress.c

index 08157c1e1167bd9250416c91a133986c81541919..2f995169c244d87e57b5bbd368d229e4349bd874 100644 (file)
@@ -1409,14 +1409,14 @@ void ZSTD_compressBlock_doubleFast_generic(ZSTD_CCtx* cctx,
             ip++;
             ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH);
         } else {
-            size_t offset;
+            U32 offset;
             if ( (matchIndexL > lowestIndex) && (MEM_read64(matchLong) == MEM_read64(ip)) ) {
                 mLength = ZSTD_count(ip+8, matchLong+8, iend) + 8;
-                offset = ip-matchLong;
+                offset = (U32)(ip-matchLong);
                 while (((ip>anchor) & (matchLong>lowest)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; } /* catch up */
             } else if ( (matchIndexS > lowestIndex) && (MEM_read32(match) == MEM_read32(ip)) ) {
                 mLength = ZSTD_count(ip+4, match+4, iend) + 4;
-                offset = ip-match;
+                offset = (U32)(ip-match);
                 while (((ip>anchor) & (match>lowest)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */
             } else {
                 ip += ((ip-anchor) >> g_searchStrength) + 1;
@@ -1446,7 +1446,7 @@ void ZSTD_compressBlock_doubleFast_generic(ZSTD_CCtx* cctx,
                  & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) {
                 /* store sequence */
                 size_t const rLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4;
-                { size_t const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff; } /* swap offset_2 <=> offset_1 */
+                { U32 const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff; } /* swap offset_2 <=> offset_1 */
                 hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = (U32)(ip-base);
                 hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = (U32)(ip-base);
                 ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, rLength-MINMATCH);