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;
}