From: Yann Collet Date: Tue, 29 Oct 2024 18:04:11 +0000 (-0700) Subject: changed variable name to ZSTD_c_blockSplitterLevel X-Git-Tag: v1.5.7^2~68^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f93206d62f306040a8e35033312e16986d0aeab;p=thirdparty%2Fzstd.git changed variable name to ZSTD_c_blockSplitterLevel suggested by @terrelln --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index ea7a45fa7..cf3e08dca 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -603,7 +603,7 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param) bounds.upperBound = (int)ZSTD_ps_disable; return bounds; - case ZSTD_c_blockSplitter_level: + case ZSTD_c_blockSplitterLevel: bounds.lowerBound = 0; bounds.upperBound = ZSTD_BLOCKSPLITTER_LEVEL_MAX; return bounds; @@ -674,7 +674,7 @@ static int ZSTD_isUpdateAuthorized(ZSTD_cParameter param) case ZSTD_c_minMatch: case ZSTD_c_targetLength: case ZSTD_c_strategy: - case ZSTD_c_blockSplitter_level: + case ZSTD_c_blockSplitterLevel: return 1; case ZSTD_c_format: @@ -761,7 +761,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value) case ZSTD_c_blockDelimiters: case ZSTD_c_validateSequences: case ZSTD_c_useBlockSplitter: - case ZSTD_c_blockSplitter_level: + case ZSTD_c_blockSplitterLevel: case ZSTD_c_useRowMatchFinder: case ZSTD_c_deterministicRefPrefix: case ZSTD_c_prefetchCDictTables: @@ -987,8 +987,8 @@ size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* CCtxParams, CCtxParams->postBlockSplitter = (ZSTD_paramSwitch_e)value; return CCtxParams->postBlockSplitter; - case ZSTD_c_blockSplitter_level: - BOUNDCHECK(ZSTD_c_blockSplitter_level, value); + case ZSTD_c_blockSplitterLevel: + BOUNDCHECK(ZSTD_c_blockSplitterLevel, value); CCtxParams->preBlockSplitter_level = value; return (size_t)CCtxParams->preBlockSplitter_level; @@ -1150,7 +1150,7 @@ size_t ZSTD_CCtxParams_getParameter( case ZSTD_c_useBlockSplitter : *value = (int)CCtxParams->postBlockSplitter; break; - case ZSTD_c_blockSplitter_level : + case ZSTD_c_blockSplitterLevel : *value = CCtxParams->preBlockSplitter_level; break; case ZSTD_c_useRowMatchFinder : diff --git a/lib/zstd.h b/lib/zstd.h index c1ad26a8d..cc5bb9879 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -496,7 +496,7 @@ typedef enum { * ZSTD_c_prefetchCDictTables * ZSTD_c_enableSeqProducerFallback * ZSTD_c_maxBlockSize - * ZSTD_c_blockSplitter_level + * ZSTD_c_blockSplitterLevel * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them. * note : never ever use experimentalParam? names directly; * also, the enums values themselves are unstable and can still change. @@ -2265,7 +2265,7 @@ ZSTDLIB_STATIC_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const vo */ #define ZSTD_c_searchForExternalRepcodes ZSTD_c_experimentalParam19 -/* ZSTD_c_blockSplitter_level +/* ZSTD_c_blockSplitterLevel * note: this parameter only influences the first splitter stage, * which is active before producing the sequences. * ZSTD_c_useBlockSplitter influence the next splitter stage, @@ -2281,7 +2281,7 @@ ZSTDLIB_STATIC_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const vo * to ensure expansion guarantees in presence of incompressible data. */ #define ZSTD_BLOCKSPLITTER_LEVEL_MAX 6 -#define ZSTD_c_blockSplitter_level ZSTD_c_experimentalParam20 +#define ZSTD_c_blockSplitterLevel ZSTD_c_experimentalParam20 /*! ZSTD_CCtx_getParameter() : * Get the requested compression parameter value, selected by enum ZSTD_cParameter, diff --git a/tests/fuzzer.c b/tests/fuzzer.c index c1bff7a5a..08c2662fb 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -595,11 +595,11 @@ static void test_blockSplitter_incompressibleExpansionProtection(unsigned testNb } /* run first without splitting */ - ZSTD_CCtx_setParameter(cctx, ZSTD_c_blockSplitter_level, 1 /* no split */); + ZSTD_CCtx_setParameter(cctx, ZSTD_c_blockSplitterLevel, 1 /* no split */); cSizeNoSplit = ZSTD_compress2(cctx, cBuffer, dstCapacity, incompressible, srcSize); /* run with sample43 splitter, check it's still the same */ - ZSTD_CCtx_setParameter(cctx, ZSTD_c_blockSplitter_level, 3 /* sample43, fastest _byChunk variant */); + ZSTD_CCtx_setParameter(cctx, ZSTD_c_blockSplitterLevel, 3 /* sample43, fastest _byChunk variant */); cSizeWithSplit = ZSTD_compress2(cctx, cBuffer, dstCapacity, incompressible, srcSize); if (cSizeWithSplit != cSizeNoSplit) {