Updated forceAttachDict param bounds

This commit is contained in:
Sen Huang 2019-10-20 22:01:08 -04:00
parent 6d297265f9
commit e8aa3e486d
2 changed files with 3 additions and 3 deletions

View File

@ -387,7 +387,7 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param)
case ZSTD_c_forceAttachDict: case ZSTD_c_forceAttachDict:
ZSTD_STATIC_ASSERT(ZSTD_dictDefaultAttach < ZSTD_dictForceCopy); ZSTD_STATIC_ASSERT(ZSTD_dictDefaultAttach < ZSTD_dictForceCopy);
bounds.lowerBound = ZSTD_dictDefaultAttach; bounds.lowerBound = ZSTD_dictDefaultAttach;
bounds.upperBound = ZSTD_dictForceCopy; /* note : how to ensure at compile time that this is the highest value enum ? */ bounds.upperBound = ZSTD_dictForceSource; /* note : how to ensure at compile time that this is the highest value enum ? */
return bounds; return bounds;
case ZSTD_c_literalCompressionMode: case ZSTD_c_literalCompressionMode:
@ -3349,7 +3349,7 @@ size_t ZSTD_compressBegin_usingCDict_advanced(
RETURN_ERROR_IF(cdict==NULL, dictionary_wrong); RETURN_ERROR_IF(cdict==NULL, dictionary_wrong);
{ ZSTD_CCtx_params params = cctx->requestedParams; { ZSTD_CCtx_params params = cctx->requestedParams;
params.cParams = ( (pledgedSrcSize < ZSTD_USE_CDICT_PARAMS_CUTOFF) || (cdict->compressionLevel == 0) ) params.cParams = ( (pledgedSrcSize < ZSTD_USE_CDICT_PARAMS_CUTOFF) || (cdict->compressionLevel == 0) )
&& (params->attachDictPref != ZSTD_dictForceSource) ? && (params.attachDictPref != ZSTD_dictForceSource) ?
ZSTD_getCParamsFromCDict(cdict) ZSTD_getCParamsFromCDict(cdict)
: ZSTD_getCParams(cdict->compressionLevel, : ZSTD_getCParams(cdict->compressionLevel,
pledgedSrcSize, pledgedSrcSize,