mirror of
https://github.com/facebook/zstd.git
synced 2025-08-08 17:22:10 +03:00
Merge pull request #1332 from facebook/minclevel
defined a minimum negative level
This commit is contained in:
@@ -37,8 +37,8 @@
|
||||
#ifndef ZSTD_NODICT
|
||||
# include "dibio.h" /* ZDICT_cover_params_t, DiB_trainFromFiles() */
|
||||
#endif
|
||||
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_maxCLevel */
|
||||
#include "zstd.h" /* ZSTD_VERSION_STRING */
|
||||
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_minCLevel */
|
||||
#include "zstd.h" /* ZSTD_VERSION_STRING, ZSTD_maxCLevel */
|
||||
|
||||
|
||||
/*-************************************
|
||||
@@ -629,12 +629,15 @@ int main(int argCount, const char* argv[])
|
||||
compressionParams.windowLog = ldmWindowLog;
|
||||
continue;
|
||||
}
|
||||
#ifndef ZSTD_NOCOMPRESS /* linking ZSTD_minCLevel() requires compression support */
|
||||
if (longCommandWArg(&argument, "--fast")) {
|
||||
/* Parse optional acceleration factor */
|
||||
if (*argument == '=') {
|
||||
U32 const maxFast = (U32)-ZSTD_minCLevel();
|
||||
U32 fastLevel;
|
||||
++argument;
|
||||
fastLevel = readU32FromChar(&argument);
|
||||
if (fastLevel > maxFast) fastLevel = maxFast;
|
||||
if (fastLevel) {
|
||||
dictCLevel = cLevel = -(int)fastLevel;
|
||||
} else {
|
||||
@@ -648,6 +651,7 @@ int main(int argCount, const char* argv[])
|
||||
}
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
/* fall-through, will trigger bad_usage() later on */
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user