mirror of
https://github.com/facebook/zstd.git
synced 2025-10-09 00:05:28 -04:00
fixed conversion warning
This commit is contained in:
parent
44f684ded3
commit
69c2cdb45c
@ -152,7 +152,7 @@ ZSTD_CCtx* ZSTD_createCCtx(void)
|
|||||||
|
|
||||||
ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem)
|
ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem)
|
||||||
{
|
{
|
||||||
ZSTD_CCtx* ctx;
|
ZSTD_CCtx* cctx;
|
||||||
|
|
||||||
if (!customMem.customAlloc && !customMem.customFree)
|
if (!customMem.customAlloc && !customMem.customFree)
|
||||||
customMem = defaultCustomMem;
|
customMem = defaultCustomMem;
|
||||||
@ -160,11 +160,11 @@ ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem)
|
|||||||
if (!customMem.customAlloc || !customMem.customFree)
|
if (!customMem.customAlloc || !customMem.customFree)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ctx = (ZSTD_CCtx*) customMem.customAlloc(customMem.opaque, sizeof(ZSTD_CCtx));
|
cctx = (ZSTD_CCtx*) customMem.customAlloc(customMem.opaque, sizeof(ZSTD_CCtx));
|
||||||
if (!ctx) return NULL;
|
if (!cctx) return NULL;
|
||||||
memset(ctx, 0, sizeof(ZSTD_CCtx));
|
memset(cctx, 0, sizeof(ZSTD_CCtx));
|
||||||
memcpy(&ctx->customMem, &customMem, sizeof(ZSTD_customMem));
|
memcpy(&(cctx->customMem), &customMem, sizeof(ZSTD_customMem));
|
||||||
return ctx;
|
return cctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx)
|
size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx)
|
||||||
@ -2321,8 +2321,15 @@ _storeSequence:
|
|||||||
/* Save reps for next block */
|
/* Save reps for next block */
|
||||||
ctx->savedRep[0] = offset_1; ctx->savedRep[1] = offset_2;
|
ctx->savedRep[0] = offset_1; ctx->savedRep[1] = offset_2;
|
||||||
|
|
||||||
|
static unsigned nbBlocks = 0;
|
||||||
|
printf("nbBlocks : %u \n", ++nbBlocks);
|
||||||
|
if (nbBlocks == 185)
|
||||||
|
printf("@");
|
||||||
|
|
||||||
/* Last Literals */
|
/* Last Literals */
|
||||||
{ size_t const lastLLSize = iend - anchor;
|
{ size_t const lastLLSize = iend - anchor;
|
||||||
|
if (lastLLSize == 4181)
|
||||||
|
printf("~");
|
||||||
memcpy(seqStorePtr->lit, anchor, lastLLSize);
|
memcpy(seqStorePtr->lit, anchor, lastLLSize);
|
||||||
seqStorePtr->lit += lastLLSize;
|
seqStorePtr->lit += lastLLSize;
|
||||||
}
|
}
|
||||||
|
@ -710,8 +710,7 @@ static size_t ZDICT_analyzeEntropy(void* dstBuffer, size_t maxDstSize,
|
|||||||
goto _cleanup;
|
goto _cleanup;
|
||||||
}
|
}
|
||||||
if (compressionLevel==0) compressionLevel=g_compressionLevel_default;
|
if (compressionLevel==0) compressionLevel=g_compressionLevel_default;
|
||||||
params.cParams = ZSTD_getCParams(compressionLevel, averageSampleSize, dictBufferSize);
|
params = ZSTD_getParams(compressionLevel, averageSampleSize, dictBufferSize);
|
||||||
params.fParams.contentSizeFlag = 0;
|
|
||||||
{ size_t const beginResult = ZSTD_compressBegin_advanced(esr.ref, dictBuffer, dictBufferSize, params, 0);
|
{ size_t const beginResult = ZSTD_compressBegin_advanced(esr.ref, dictBuffer, dictBufferSize, params, 0);
|
||||||
if (ZSTD_isError(beginResult)) {
|
if (ZSTD_isError(beginResult)) {
|
||||||
eSize = ERROR(GENERIC);
|
eSize = ERROR(GENERIC);
|
||||||
|
@ -222,7 +222,7 @@ static size_t BMK_benchParam(BMK_result_t* resultPtr,
|
|||||||
double fastestC = 100000000., fastestD = 100000000.;
|
double fastestC = 100000000., fastestD = 100000000.;
|
||||||
double ratio = 0.;
|
double ratio = 0.;
|
||||||
U64 crcCheck = 0;
|
U64 crcCheck = 0;
|
||||||
time_t const benchStart = clock();
|
clock_t const benchStart = clock();
|
||||||
|
|
||||||
DISPLAY("\r%79s\r", "");
|
DISPLAY("\r%79s\r", "");
|
||||||
memset(¶ms, 0, sizeof(params));
|
memset(¶ms, 0, sizeof(params));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user