From: Stella Lau Date: Wed, 30 Aug 2017 01:03:06 +0000 (-0700) Subject: Rename applyCCtxParams() X-Git-Tag: fuzz-corpora2~29^2^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82d636b76adfcfc7f253fee4663d7a1acaab37d8;p=thirdparty%2Fzstd.git Rename applyCCtxParams() --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 4251bbb01..436e73cee 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -465,7 +465,8 @@ size_t ZSTD_CCtxParam_setParameter( * * Pledged srcSize is treated as unknown. */ -size_t ZSTD_CCtx_applyCCtxParams(ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params) +size_t ZSTD_CCtx_setParametersUsingCCtxParams( + ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params) { if (cctx->streamStage != zcss_init) return ERROR(stage_wrong); if (cctx->cdict) return ERROR(stage_wrong); diff --git a/lib/zstd.h b/lib/zstd.h index 8ac564884..e062f6d2b 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -1109,7 +1109,7 @@ size_t ZSTD_compress_generic_simpleArgs ( * - ZSTD_CCtxParam_setParameter() : Push parameters one by one into an * existing ZSTD_CCtx_params structure. This is similar to * ZSTD_CCtx_setParameter(). - * - ZSTD_CCtx_applyCCtxParams() : Apply parameters to an existing CCtx. These + * - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to an existing CCtx. These * parameters will be applied to all subsequent compression jobs. * - ZSTD_compress_generic() : Do compression using the CCtx. * - ZSTD_freeCCtxParams() : Free the memory. @@ -1141,19 +1141,20 @@ ZSTDLIB_API size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params); /*! ZSTD_CCtxParam_setParameter() : * Similar to ZSTD_CCtx_setParameter. * Set one compression parameter, selected by enum ZSTD_cParameter. - * Parameters must be applied to a ZSTD_CCtx using ZSTD_CCtx_applyCCtxParams(). + * Parameters must be applied to a ZSTD_CCtx using ZSTD_CCtx_setParametersUsingCCtxParams(). * Note : when `value` is an enum, cast it to unsigned for proper type checking. * @result : 0, or an error code (which can be tested with ZSTD_isError()). */ ZSTDLIB_API size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned value); -/*! ZSTD_CCtx_applyCCtxParams() : +/*! ZSTD_CCtx_setParametersUsingCCtxParams() : * Apply a set of ZSTD_CCtx_params to the compression context. * This must be done before the dictionary is loaded. * The pledgedSrcSize is treated as unknown. * Multithreading parameters are applied only if nbThreads > 1. */ -ZSTDLIB_API size_t ZSTD_CCtx_applyCCtxParams(ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params); +ZSTDLIB_API size_t ZSTD_CCtx_setParametersUsingCCtxParams( + ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params); /** Block functions diff --git a/tests/roundTripCrash.c b/tests/roundTripCrash.c index cb0221c58..41e5d4472 100644 --- a/tests/roundTripCrash.c +++ b/tests/roundTripCrash.c @@ -98,7 +98,7 @@ static size_t cctxParamRoundTripTest(void* resultBuff, size_t resultBuffCapacity /* Apply parameters */ - CHECK_Z( ZSTD_CCtx_applyCCtxParams(cctx, cctxParams) ); + CHECK_Z( ZSTD_CCtx_setParametersUsingCCtxParams(cctx, cctxParams) ); CHECK_Z (ZSTD_compress_generic(cctx, &outBuffer, &inBuffer, ZSTD_e_end) ); diff --git a/tests/zstreamtest.c b/tests/zstreamtest.c index 5d6ef4168..f8683ac78 100644 --- a/tests/zstreamtest.c +++ b/tests/zstreamtest.c @@ -1381,7 +1381,7 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double /* Apply parameters */ if (useOpaqueAPI) { - CHECK_Z (ZSTD_CCtx_applyCCtxParams(zc, cctxParams) ); + CHECK_Z (ZSTD_CCtx_setParametersUsingCCtxParams(zc, cctxParams) ); } if (FUZ_rand(&lseed) & 1) { @@ -1393,8 +1393,8 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double if (dict && dictSize) { /* test that compression parameters are rejected (correctly) after loading a non-NULL dictionary */ if (useOpaqueAPI) { - size_t const setError = ZSTD_CCtx_applyCCtxParams(zc, cctxParams); - CHECK(!ZSTD_isError(setError), "ZSTD_CCtx_applyCCtxParams should have failed"); + size_t const setError = ZSTD_CCtx_setParametersUsingCCtxParams(zc, cctxParams); + CHECK(!ZSTD_isError(setError), "ZSTD_CCtx_setParametersUsingCCtxParams should have failed"); } else { size_t const setError = ZSTD_CCtx_setParameter(zc, ZSTD_p_windowLog, cParams.windowLog-1); CHECK(!ZSTD_isError(setError), "ZSTD_CCtx_setParameter should have failed");