finalized retrofit of ZSTD_CCtx_reset()

updated all depending sources
This commit is contained in:
Yann Collet
2018-11-14 13:05:35 -08:00
parent 5adbad4059
commit 7b0391e37e
6 changed files with 440 additions and 422 deletions
+2 -2
View File
@@ -527,13 +527,13 @@ static int basicUnitTests(U32 seed, double compressibility)
CHECK_Z(ZSTD_CCtx_getParameter(cctx, ZSTD_p_hashLog, &value));
CHECK_EQ(value, ZSTD_HASHLOG_MIN);
/* Reset the CCtx */
ZSTD_CCtx_reset(cctx);
ZSTD_CCtx_reset(cctx, ZSTD_CCtx_reset_session_only);
CHECK_Z(ZSTD_CCtx_getParameter(cctx, ZSTD_p_compressionLevel, &value));
CHECK_EQ(value, 7);
CHECK_Z(ZSTD_CCtx_getParameter(cctx, ZSTD_p_hashLog, &value));
CHECK_EQ(value, ZSTD_HASHLOG_MIN);
/* Reset the parameters */
ZSTD_CCtx_resetParameters(cctx);
ZSTD_CCtx_reset(cctx, ZSTD_CCtx_reset_parameters);
CHECK_Z(ZSTD_CCtx_getParameter(cctx, ZSTD_p_compressionLevel, &value));
CHECK_EQ(value, 3);
CHECK_Z(ZSTD_CCtx_getParameter(cctx, ZSTD_p_hashLog, &value));
+1 -2
View File
@@ -893,8 +893,7 @@ typedef struct {
static size_t local_initCCtx(void* payload) {
const BMK_initCCtxArgs* ag = (const BMK_initCCtxArgs*)payload;
varInds_t i;
ZSTD_CCtx_reset(ag->cctx);
ZSTD_CCtx_resetParameters(ag->cctx);
ZSTD_CCtx_reset(ag->cctx, ZSTD_CCtx_reset_session_and_parameters);
ZSTD_CCtx_setParameter(ag->cctx, ZSTD_p_compressionLevel, ag->cLevel);
for(i = 0; i < NUM_PARAMS; i++) {
+2 -3
View File
@@ -930,7 +930,7 @@ static int basicUnitTests(U32 seed, double compressibility)
if (!cdict || !ddict) goto _output_error;
ZSTD_CCtx_reset(zc);
ZSTD_CCtx_reset(zc, ZSTD_CCtx_reset_session_only);
ZSTD_resetDStream(zd);
CHECK_Z(ZSTD_CCtx_refCDict(zc, cdict));
CHECK_Z(ZSTD_initDStream_usingDDict(zd, ddict));
@@ -1077,8 +1077,7 @@ static int basicUnitTests(U32 seed, double compressibility)
int remainingInput = 256 * 1024;
int offset;
ZSTD_CCtx_reset(zc);
CHECK_Z(ZSTD_CCtx_resetParameters(zc));
CHECK_Z(ZSTD_CCtx_reset(zc, ZSTD_CCtx_reset_session_and_parameters));
CHECK_Z(ZSTD_CCtx_refCDict(zc, cdict));
CHECK_Z(ZSTD_CCtx_setParameter(zc, ZSTD_p_checksumFlag, 1));
/* Write a bunch of 6 byte blocks */