From e34c000e44444b9f8bd62e5af0a355ee186eb21f Mon Sep 17 00:00:00 2001 From: Duc Ngo Date: Fri, 8 Jun 2018 11:29:51 -0700 Subject: [PATCH 1/3] Expose ZSTD_CLEVEL_DEFAULT and update documentation --- lib/compress/zstd_compress.c | 9 --------- lib/zstd.h | 10 +++++++++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index e0c29ac4..ba70308d 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -8,15 +8,6 @@ * You may select, at your option, one of the above-listed licenses. */ - -/*-************************************* -* Tuning parameters -***************************************/ -#ifndef ZSTD_CLEVEL_DEFAULT -# define ZSTD_CLEVEL_DEFAULT 3 -#endif - - /*-************************************* * Dependencies ***************************************/ diff --git a/lib/zstd.h b/lib/zstd.h index 8f42ff81..e49cc815 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -35,6 +35,14 @@ extern "C" { #endif +/*-************************************* +* Tuning parameters +***************************************/ +#ifndef ZSTD_CLEVEL_DEFAULT +# define ZSTD_CLEVEL_DEFAULT 3 +#endif + + /******************************************************************************************************* Introduction @@ -949,7 +957,7 @@ typedef enum { /* compression parameters */ ZSTD_p_compressionLevel=100, /* Update all compression parameters according to pre-defined cLevel table * Default level is ZSTD_CLEVEL_DEFAULT==3. - * Special: value 0 means "do not change cLevel". + * Special: value 0 means default, which is controlled by ZSTD_CLEVEL_DEFAULT. * Note 1 : it's possible to pass a negative compression level by casting it to unsigned type. * Note 2 : setting a level sets all default values of other compression parameters. * Note 3 : setting compressionLevel automatically updates ZSTD_p_compressLiterals. */ From e8ef725e1346b6551e8733c80b87f80894794ee5 Mon Sep 17 00:00:00 2001 From: Duc Ngo Date: Mon, 11 Jun 2018 10:01:35 -0700 Subject: [PATCH 2/3] Address comments --- lib/zstd.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/zstd.h b/lib/zstd.h index e49cc815..99505cba 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -34,15 +34,6 @@ extern "C" { # define ZSTDLIB_API ZSTDLIB_VISIBILITY #endif - -/*-************************************* -* Tuning parameters -***************************************/ -#ifndef ZSTD_CLEVEL_DEFAULT -# define ZSTD_CLEVEL_DEFAULT 3 -#endif - - /******************************************************************************************************* Introduction @@ -78,6 +69,12 @@ ZSTDLIB_API unsigned ZSTD_versionNumber(void); /**< useful to check dll versio #define ZSTD_VERSION_STRING ZSTD_EXPAND_AND_QUOTE(ZSTD_LIB_VERSION) ZSTDLIB_API const char* ZSTD_versionString(void); /* added in v1.3.0 */ +/*************************************** +* Default constant +***************************************/ +#ifndef ZSTD_CLEVEL_DEFAULT +# define ZSTD_CLEVEL_DEFAULT 3 +#endif /*************************************** * Simple API From 869e2718f688c867251e4f2aa76fe8b90ba078c0 Mon Sep 17 00:00:00 2001 From: Duc Ngo Date: Mon, 11 Jun 2018 10:02:15 -0700 Subject: [PATCH 3/3] Line break --- lib/zstd.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/zstd.h b/lib/zstd.h index 99505cba..526f5caf 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -34,6 +34,7 @@ extern "C" { # define ZSTDLIB_API ZSTDLIB_VISIBILITY #endif + /******************************************************************************************************* Introduction