]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add explicit conversion of size_t to U32
authorsenhuang42 <senhuang96@fb.com>
Fri, 2 Oct 2020 17:47:54 +0000 (13:47 -0400)
committersenhuang42 <senhuang96@fb.com>
Wed, 7 Oct 2020 17:56:25 +0000 (13:56 -0400)
lib/compress/zstd_opt.c

index 5211fc9172f41ab2c6afa16e95da7d9c33a8b449..dcd9e1929e8308d23dbf2547e9ed85dcbb2fdf4c 100644 (file)
@@ -784,7 +784,7 @@ static void ZSTD_opt_skipBytesInLdmSeqStore(rawSeqStore_t* ldmSeqStore, size_t n
             ldmSeqStore->posInSequence += currSeq.litLength;
             nbBytes -= currSeq.litLength;
         }
-        
+
         if (nbBytes < currSeq.matchLength) {
             ldmSeqStore->posInSequence += nbBytes;
             return;
@@ -823,10 +823,10 @@ static void ZSTD_opt_getNextLdmAndUpdateSeqStore(rawSeqStore_t* ldmSeqStore,
     assert(ldmSeqStore->posInSequence <= currSeq.litLength + currSeq.matchLength);
     currBlockEndPos = currPosInBlock + blockBytesRemaining;
     literalsBytesRemaining = (ldmSeqStore->posInSequence < currSeq.litLength) ?
-            currSeq.litLength - ldmSeqStore->posInSequence :
+            currSeq.litLength - (U32)ldmSeqStore->posInSequence :
             0;
     matchBytesRemaining = (literalsBytesRemaining == 0) ?
-            currSeq.matchLength - (ldmSeqStore->posInSequence - currSeq.litLength) :
+            currSeq.matchLength - ((U32)ldmSeqStore->posInSequence - currSeq.litLength) :
             currSeq.matchLength;
 
     /* If there are more literal bytes than bytes remaining in block, no ldm is possible */