From 1f3a51fb52034af5bd2a662b27977dfe0d9bf2e4 Mon Sep 17 00:00:00 2001 From: Sen Huang Date: Sun, 20 Oct 2019 22:01:08 -0400 Subject: [PATCH] Updated forceAttachDict param bounds --- lib/compress/zstd_compress.c | 4 ++-- lib/zstd.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 84af6feea..3aa111ddb 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -387,7 +387,7 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param) case ZSTD_c_forceAttachDict: ZSTD_STATIC_ASSERT(ZSTD_dictDefaultAttach < ZSTD_dictForceCopy); 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; case ZSTD_c_literalCompressionMode: @@ -3358,7 +3358,7 @@ size_t ZSTD_compressBegin_usingCDict_advanced( RETURN_ERROR_IF(cdict==NULL, dictionary_wrong); { ZSTD_CCtx_params params = cctx->requestedParams; params.cParams = ( (pledgedSrcSize < ZSTD_USE_CDICT_PARAMS_CUTOFF) || (cdict->compressionLevel == 0) ) - && (params->attachDictPref != ZSTD_dictForceSource) ? + && (params.attachDictPref != ZSTD_dictForceSource) ? ZSTD_getCParamsFromCDict(cdict) : ZSTD_getCParams(cdict->compressionLevel, pledgedSrcSize, diff --git a/lib/zstd.h b/lib/zstd.h index c0521c1b8..5468c34cc 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -1177,7 +1177,7 @@ typedef enum { ZSTD_dictDefaultAttach = 0, /* Use the default heuristic. */ ZSTD_dictForceAttach = 1, /* Never copy the dictionary. */ ZSTD_dictForceCopy = 2, /* Always copy the dictionary. */ - ZSTD_dictForceSource = 3, /* Always use src input to determine tables */ + ZSTD_dictForceSource = 3, /* Always use src input to determine tables */ } ZSTD_dictAttachPref_e; typedef enum {