Add explicit conversion of size_t to U32

This commit is contained in:
senhuang42 2020-10-02 13:47:54 -04:00
parent b8bfc4e63d
commit d8b43a4202

View File

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