mirror of
https://github.com/facebook/zstd.git
synced 2025-08-07 06:23:00 +03:00
[zstdcli] Fix option detection for --auto-threads
The option `--auto-threads` should still be accepted and parsed, even if `ZSTD_MULTITHREAD` is not defined. It doesn't mean anything, but we should still accept the option. Since we want scripts to be able to work generically. This bug was caught by tests I added to the new testing framework.
This commit is contained in:
@@ -802,9 +802,7 @@ int main(int argCount, const char* argv[])
|
|||||||
separateFiles = 0,
|
separateFiles = 0,
|
||||||
setRealTimePrio = 0,
|
setRealTimePrio = 0,
|
||||||
singleThread = 0,
|
singleThread = 0,
|
||||||
#ifdef ZSTD_MULTITHREAD
|
|
||||||
defaultLogicalCores = 0,
|
defaultLogicalCores = 0,
|
||||||
#endif
|
|
||||||
showDefaultCParams = 0,
|
showDefaultCParams = 0,
|
||||||
ultra=0,
|
ultra=0,
|
||||||
contentSize=1;
|
contentSize=1;
|
||||||
@@ -996,7 +994,6 @@ int main(int argCount, const char* argv[])
|
|||||||
if (longCommandWArg(&argument, "--target-compressed-block-size=")) { targetCBlockSize = readSizeTFromChar(&argument); continue; }
|
if (longCommandWArg(&argument, "--target-compressed-block-size=")) { targetCBlockSize = readSizeTFromChar(&argument); continue; }
|
||||||
if (longCommandWArg(&argument, "--size-hint=")) { srcSizeHint = readSizeTFromChar(&argument); continue; }
|
if (longCommandWArg(&argument, "--size-hint=")) { srcSizeHint = readSizeTFromChar(&argument); continue; }
|
||||||
if (longCommandWArg(&argument, "--output-dir-flat")) { NEXT_FIELD(outDirName); continue; }
|
if (longCommandWArg(&argument, "--output-dir-flat")) { NEXT_FIELD(outDirName); continue; }
|
||||||
#ifdef ZSTD_MULTITHREAD
|
|
||||||
if (longCommandWArg(&argument, "--auto-threads")) {
|
if (longCommandWArg(&argument, "--auto-threads")) {
|
||||||
const char* threadDefault = NULL;
|
const char* threadDefault = NULL;
|
||||||
NEXT_FIELD(threadDefault);
|
NEXT_FIELD(threadDefault);
|
||||||
@@ -1004,7 +1001,6 @@ int main(int argCount, const char* argv[])
|
|||||||
defaultLogicalCores = 1;
|
defaultLogicalCores = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#ifdef UTIL_HAS_MIRRORFILELIST
|
#ifdef UTIL_HAS_MIRRORFILELIST
|
||||||
if (longCommandWArg(&argument, "--output-dir-mirror")) { NEXT_FIELD(outMirroredDirName); continue; }
|
if (longCommandWArg(&argument, "--output-dir-mirror")) { NEXT_FIELD(outMirroredDirName); continue; }
|
||||||
#endif
|
#endif
|
||||||
@@ -1220,7 +1216,7 @@ int main(int argCount, const char* argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
(void)singleThread; (void)nbWorkers;
|
(void)singleThread; (void)nbWorkers; (void)defaultLogicalCores;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_utilDisplayLevel = g_displayLevel;
|
g_utilDisplayLevel = g_displayLevel;
|
||||||
|
Reference in New Issue
Block a user