Move Asserts into Function to Avoid Unused Function Warning

This commit is contained in:
W. Felix Handte 2018-08-23 14:09:18 -07:00
parent 7212b5e5c2
commit 1f188ae655

View File

@ -936,16 +936,16 @@ static U32 ZSTD_equivalentCParams(ZSTD_compressionParameters cParams1,
& ((cParams1.searchLength==3) == (cParams2.searchLength==3)); /* hashlog3 space */
}
static U32 ZSTD_equalCParams(ZSTD_compressionParameters cParams1,
ZSTD_compressionParameters cParams2)
static void ZSTD_assertEqualCParams(ZSTD_compressionParameters cParams1,
ZSTD_compressionParameters cParams2)
{
return (cParams1.windowLog == cParams2.windowLog)
& (cParams1.chainLog == cParams2.chainLog)
& (cParams1.hashLog == cParams2.hashLog)
& (cParams1.searchLog == cParams2.searchLog)
& (cParams1.searchLength == cParams2.searchLength)
& (cParams1.targetLength == cParams2.targetLength)
& (cParams1.strategy == cParams2.strategy);
assert(cParams1.windowLog == cParams2.windowLog);
assert(cParams1.chainLog == cParams2.chainLog);
assert(cParams1.hashLog == cParams2.hashLog);
assert(cParams1.searchLog == cParams2.searchLog);
assert(cParams1.searchLength == cParams2.searchLength);
assert(cParams1.targetLength == cParams2.targetLength);
assert(cParams1.strategy == cParams2.strategy);
}
/** The parameters are equivalent if ldm is not enabled in both sets or
@ -2370,7 +2370,7 @@ static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc,
assert(srcSize <= ZSTD_BLOCKSIZE_MAX);
/* Assert that we have correctly flushed the ctx params into the ms's copy */
assert(ZSTD_equalCParams(zc->appliedParams.cParams, ms->cParams));
ZSTD_assertEqualCParams(zc->appliedParams.cParams, ms->cParams);
if (srcSize < MIN_CBLOCK_SIZE+ZSTD_blockHeaderSize+1) {
ZSTD_ldm_skipSequences(&zc->externSeqStore, srcSize, zc->appliedParams.cParams.searchLength);
@ -2711,7 +2711,7 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms,
ms->loadedDictEnd = params->forceWindow ? 0 : (U32)(iend - ms->window.base);
/* Assert that we the ms params match the params we're being given */
assert(ZSTD_equalCParams(params->cParams, ms->cParams));
ZSTD_assertEqualCParams(params->cParams, ms->cParams);
if (srcSize <= HASH_READ_SIZE) return 0;