Fix compiler warnings

This commit is contained in:
Nick Terrell 2020-08-24 16:09:45 -07:00
parent 6d2f750b37
commit 52f33a1da5
2 changed files with 12 additions and 4 deletions

View File

@ -490,7 +490,7 @@ static void ZSTD_buildFSETable_body_default(ZSTD_seqSymbol* dt,
const U32* baseValue, const U32* nbAdditionalBits,
unsigned tableLog, void* wksp, size_t wkspSize)
{
return ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
}
@ -500,7 +500,7 @@ TARGET_ATTRIBUTE("bmi2") static void ZSTD_buildFSETable_body_bmi2(ZSTD_seqSymbol
const U32* baseValue, const U32* nbAdditionalBits,
unsigned tableLog, void* wksp, size_t wkspSize)
{
return ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
}
#endif
@ -512,12 +512,13 @@ void ZSTD_buildFSETable(ZSTD_seqSymbol* dt,
{
#if DYNAMIC_BMI2
if (bmi2) {
return ZSTD_buildFSETable_body_bmi2(dt, normalizedCounter, maxSymbolValue,
ZSTD_buildFSETable_body_bmi2(dt, normalizedCounter, maxSymbolValue,
baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
return;
}
#endif
(void)bmi2;
return ZSTD_buildFSETable_body_default(dt, normalizedCounter, maxSymbolValue,
ZSTD_buildFSETable_body_default(dt, normalizedCounter, maxSymbolValue,
baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
}

View File

@ -171,11 +171,18 @@ FORCE_NOINLINE size_t ZSTD_decodeLiteralsHeader(ZSTD_DCtx* dctx, void const* src
}
RETURN_ERROR_IF(litSize > ZSTD_BLOCKSIZE_MAX, corruption_detected, "");
RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, "");
#ifndef HUF_FORCE_DECOMPRESS_X2
return HUF_readDTableX1_wksp_bmi2(
dctx->entropy.hufTable,
istart+lhSize, litCSize,
dctx->workspace, sizeof(dctx->workspace),
dctx->bmi2);
#else
return HUF_readDTableX2_wksp(
dctx->entropy.hufTable,
istart+lhSize, litCSize,
dctx->workspace, sizeof(dctx->workspace));
#endif
}
}
}