]> git.ipfire.org Git - thirdparty/zstd.git/commit
[libzstd] Clean up parameter code
authorNick Terrell <terrelln@fb.com>
Sat, 16 Feb 2019 00:15:20 +0000 (16:15 -0800)
committerNick Terrell <terrelln@fb.com>
Tue, 19 Feb 2019 21:22:37 +0000 (13:22 -0800)
commitf4abba02ba34113f53d05cae504ae832f098ec1c
tree21abe9afe2634ff9b78fe80087644a94a8096c48
parent54e9412ddd02ca4c6663d09dbf44f5a209a9a7ce
[libzstd] Clean up parameter code

* Move all ZSTDMT parameter setting code to ZSTD_CCtxParams_*Parameter().
  ZSTDMT now calls these functions, so we can keep all the logic in the
  same place.
* Clean up `ZSTD_CCtx_setParameter()` to only add extra checks where needed.
* Clean up `ZSTDMT_initJobCCtxParams()` by copying all parameters by default,
  and then zeroing the ones that need to be zeroed. We've missed adding several
  parameters here, and it makes more sense to only have to update it if you
  change something in ZSTDMT.
* Add `ZSTDMT_cParam_clampBounds()` to clamp a parameter into its valid
  range. Use this to keep backwards compatibility when setting ZSTDMT parameters,
  which clamp into the valid range.
lib/compress/zstd_compress.c
lib/compress/zstdmt_compress.c
tests/regression/config.c
tests/regression/results.csv