Changed ZSTD_createCDict_advanced()
It now only uses compressionParameters as argument. It produces many changes throughout user code, though hopefully they tend to be simple : just provide the cParams part from existing ZSTD_parameters. Some programs might depend on ZSTD_createCDict_advanced() to pass frame parameters. This change will force them to revisit this strategy and fix it, since frame parameters are effectively silently ignored in current version.
This commit is contained in:
+1
-1
@@ -407,7 +407,7 @@ static int basicUnitTests(U32 seed, double compressibility)
|
||||
DISPLAYLEVEL(4, "test%3i : compress with preprocessed dictionary : ", testNb++);
|
||||
{ ZSTD_parameters params = ZSTD_getParams(1, CNBuffSize, dictSize);
|
||||
{ ZSTD_customMem customMem = { NULL, NULL, NULL };
|
||||
ZSTD_CDict* cdict = ZSTD_createCDict_advanced(dictBuffer, dictSize, 1, params, customMem);
|
||||
ZSTD_CDict* cdict = ZSTD_createCDict_advanced(dictBuffer, dictSize, 1, params.cParams, customMem);
|
||||
cSize = ZSTD_compress_usingCDict(cctx, compressedBuffer, ZSTD_compressBound(CNBuffSize),
|
||||
CNBuffer, CNBuffSize, cdict);
|
||||
ZSTD_freeCDict(cdict);
|
||||
|
||||
+1
-1
@@ -453,7 +453,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo
|
||||
ZSTD_CDict* cdict;
|
||||
params.fParams.noDictIDFlag = 1;
|
||||
params.fParams.contentSizeFlag = 1; /* test contentSize, should be disabled with initCStream_usingCDict */
|
||||
cdict = ZSTD_createCDict_advanced(dictionary.start, dictionary.filled, 1, params, customMem);
|
||||
cdict = ZSTD_createCDict_advanced(dictionary.start, dictionary.filled, 1, params.cParams, customMem);
|
||||
{ size_t const initError = ZSTD_initCStream_usingCDict(zc, cdict);
|
||||
if (ZSTD_isError(initError)) goto _output_error; }
|
||||
cSize = 0;
|
||||
|
||||
Reference in New Issue
Block a user