]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Updated forceAttachDict param bounds
authorSen Huang <senhuang96@fb.com>
Mon, 21 Oct 2019 02:01:08 +0000 (22:01 -0400)
committerSen Huang <senhuang96@fb.com>
Mon, 21 Oct 2019 02:01:08 +0000 (22:01 -0400)
lib/compress/zstd_compress.c
lib/zstd.h

index 51e8f59c0b9851fe5c7ccc1641de3c542f33f760..98d06439789d35178dcc0a1ced642b27bc1a74c5 100644 (file)
@@ -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:
@@ -3349,7 +3349,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,
index c0521c1b8fa0393dacc61ab3f70e8092c96a1fae..5468c34ccf8870e8c397253e43939ffeed5094c9 100644 (file)
@@ -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 {