Switch Enum to Only Non-Negative Values, Update Comments

This commit is contained in:
W. Felix Handte
2018-11-12 12:47:47 -08:00
parent 596f7d1256
commit 4127de5fa6
3 changed files with 40 additions and 32 deletions
+2 -5
View File
@@ -413,11 +413,8 @@ size_t ZSTD_CCtxParam_setParameter(
return CCtxParams->forceWindow;
case ZSTD_p_forceAttachDict : {
int signed_val = (int)value;
CCtxParams->attachDictPref = signed_val ?
(signed_val > 0 ? ZSTD_dictForceAttach :
ZSTD_dictForceCopy) :
ZSTD_dictDefaultAttach;
CLAMPCHECK(value, ZSTD_dictDefaultAttach, ZSTD_dictForceCopy);
CCtxParams->attachDictPref = value;
return CCtxParams->attachDictPref;
}
-6
View File
@@ -48,12 +48,6 @@ extern "C" {
typedef enum { ZSTDcs_created=0, ZSTDcs_init, ZSTDcs_ongoing, ZSTDcs_ending } ZSTD_compressionStage_e;
typedef enum { zcss_init=0, zcss_load, zcss_flush } ZSTD_cStreamStage;
typedef enum {
ZSTD_dictDefaultAttach = 0,
ZSTD_dictForceAttach = 1,
ZSTD_dictForceCopy = -1,
} ZSTD_dictAttachPref_e;
typedef struct ZSTD_prefixDict_s {
const void* dict;
size_t dictSize;