fix minor conversion warnings
This commit is contained in:
+10
-10
@@ -1505,7 +1505,7 @@ static int basicUnitTests(U32 seed, double compressibility, int bigTests)
|
|||||||
DISPLAYLEVEL(3, "test%3i : compress %u bytes with multiple threads + dictionary : ", testNb++, (unsigned)srcSize);
|
DISPLAYLEVEL(3, "test%3i : compress %u bytes with multiple threads + dictionary : ", testNb++, (unsigned)srcSize);
|
||||||
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_compressionLevel, 3) );
|
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_compressionLevel, 3) );
|
||||||
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_nbWorkers, nbWorkers) );
|
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_nbWorkers, nbWorkers) );
|
||||||
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_jobSize, jobSize) );
|
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_jobSize, (int)jobSize) );
|
||||||
assert(start > offset);
|
assert(start > offset);
|
||||||
assert(start + segLength < COMPRESSIBLE_NOISE_LENGTH);
|
assert(start + segLength < COMPRESSIBLE_NOISE_LENGTH);
|
||||||
memcpy(dst, srcToCopy, segLength); /* create a long repetition at long distance for job 2 */
|
memcpy(dst, srcToCopy, segLength); /* create a long repetition at long distance for job 2 */
|
||||||
@@ -1654,7 +1654,7 @@ static int basicUnitTests(U32 seed, double compressibility, int bigTests)
|
|||||||
int windowLog;
|
int windowLog;
|
||||||
int const kMaxWindowLog = bigTests ? 29 : 26;
|
int const kMaxWindowLog = bigTests ? 29 : 26;
|
||||||
size_t const kNbSequences = 10000;
|
size_t const kNbSequences = 10000;
|
||||||
size_t const kMaxSrcSize = (1u << kMaxWindowLog) + 10 * kNbSequences;
|
size_t const kMaxSrcSize = ((size_t)1 << kMaxWindowLog) + 10 * kNbSequences;
|
||||||
char* src = calloc(kMaxSrcSize, 1);
|
char* src = calloc(kMaxSrcSize, 1);
|
||||||
ZSTD_Sequence* sequences = malloc(sizeof(ZSTD_Sequence) * kNbSequences);
|
ZSTD_Sequence* sequences = malloc(sizeof(ZSTD_Sequence) * kNbSequences);
|
||||||
for (windowLog = ZSTD_WINDOWLOG_MIN; windowLog <= kMaxWindowLog; ++windowLog) {
|
for (windowLog = ZSTD_WINDOWLOG_MIN; windowLog <= kMaxWindowLog; ++windowLog) {
|
||||||
@@ -1902,7 +1902,7 @@ static int basicUnitTests(U32 seed, double compressibility, int bigTests)
|
|||||||
|
|
||||||
CHECK_Z(ZSTD_compressStream2(zc, &out, &in, ZSTD_e_flush));
|
CHECK_Z(ZSTD_compressStream2(zc, &out, &in, ZSTD_e_flush));
|
||||||
CHECK(in.pos != in.size, "input not fully consumed");
|
CHECK(in.pos != in.size, "input not fully consumed");
|
||||||
remainingInput -= kSmallBlockSize;
|
remainingInput -= (int)kSmallBlockSize;
|
||||||
}
|
}
|
||||||
/* Write several very long offset matches into the dictionary */
|
/* Write several very long offset matches into the dictionary */
|
||||||
for (offset = 1024; offset >= 0; offset -= 128) {
|
for (offset = 1024; offset >= 0; offset -= 128) {
|
||||||
@@ -2582,13 +2582,13 @@ static int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double co
|
|||||||
static const U32 maxSampleLog = 19;
|
static const U32 maxSampleLog = 19;
|
||||||
size_t const srcBufferSize = (size_t)1<<maxSrcLog;
|
size_t const srcBufferSize = (size_t)1<<maxSrcLog;
|
||||||
BYTE* cNoiseBuffer[5];
|
BYTE* cNoiseBuffer[5];
|
||||||
size_t const copyBufferSize = srcBufferSize + (1<<maxSampleLog);
|
size_t const copyBufferSize = srcBufferSize + ((size_t)1 << maxSampleLog);
|
||||||
BYTE* const copyBuffer = (BYTE*)malloc (copyBufferSize);
|
BYTE* const copyBuffer = (BYTE*)malloc (copyBufferSize);
|
||||||
size_t const cBufferSize = ZSTD_compressBound(srcBufferSize);
|
size_t const cBufferSize = ZSTD_compressBound(srcBufferSize);
|
||||||
BYTE* const cBuffer = (BYTE*)malloc (cBufferSize);
|
BYTE* const cBuffer = (BYTE*)malloc (cBufferSize);
|
||||||
size_t const dstBufferSize = srcBufferSize;
|
size_t const dstBufferSize = srcBufferSize;
|
||||||
BYTE* const dstBuffer = (BYTE*)malloc (dstBufferSize);
|
BYTE* const dstBuffer = (BYTE*)malloc (dstBufferSize);
|
||||||
U32 result = 0;
|
int result = 0;
|
||||||
unsigned testNb = 0;
|
unsigned testNb = 0;
|
||||||
U32 coreSeed = seed;
|
U32 coreSeed = seed;
|
||||||
ZSTD_CStream* zc = ZSTD_createCStream(); /* will be re-created sometimes */
|
ZSTD_CStream* zc = ZSTD_createCStream(); /* will be re-created sometimes */
|
||||||
@@ -2685,7 +2685,7 @@ static int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double co
|
|||||||
U32 const testLog = FUZ_rand(&lseed) % maxSrcLog;
|
U32 const testLog = FUZ_rand(&lseed) % maxSrcLog;
|
||||||
U32 const dictLog = FUZ_rand(&lseed) % maxSrcLog;
|
U32 const dictLog = FUZ_rand(&lseed) % maxSrcLog;
|
||||||
U32 const cLevelCandidate = ( FUZ_rand(&lseed) %
|
U32 const cLevelCandidate = ( FUZ_rand(&lseed) %
|
||||||
(ZSTD_maxCLevel() -
|
((unsigned)ZSTD_maxCLevel() -
|
||||||
(MAX(testLog, dictLog) / 3)))
|
(MAX(testLog, dictLog) / 3)))
|
||||||
+ 1;
|
+ 1;
|
||||||
U32 const cLevel = MIN(cLevelCandidate, cLevelMax);
|
U32 const cLevel = MIN(cLevelCandidate, cLevelMax);
|
||||||
@@ -2698,7 +2698,7 @@ static int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double co
|
|||||||
}
|
}
|
||||||
{ U64 const pledgedSrcSize = (FUZ_rand(&lseed) & 3) ? ZSTD_CONTENTSIZE_UNKNOWN : maxTestSize;
|
{ U64 const pledgedSrcSize = (FUZ_rand(&lseed) & 3) ? ZSTD_CONTENTSIZE_UNKNOWN : maxTestSize;
|
||||||
CHECK_Z( ZSTD_CCtx_reset(zc, ZSTD_reset_session_only) );
|
CHECK_Z( ZSTD_CCtx_reset(zc, ZSTD_reset_session_only) );
|
||||||
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_compressionLevel, cLevel) );
|
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_compressionLevel, (int)cLevel) );
|
||||||
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_checksumFlag, FUZ_rand(&lseed) & 1) );
|
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_checksumFlag, FUZ_rand(&lseed) & 1) );
|
||||||
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_contentSizeFlag, FUZ_rand(&lseed) & 1) );
|
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_contentSizeFlag, FUZ_rand(&lseed) & 1) );
|
||||||
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_dictIDFlag, FUZ_rand(&lseed) & 1) );
|
CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_dictIDFlag, FUZ_rand(&lseed) & 1) );
|
||||||
@@ -2837,9 +2837,9 @@ static size_t setCCtxParameter(ZSTD_CCtx* zc, ZSTD_CCtx_params* cctxParams,
|
|||||||
int useOpaqueAPI)
|
int useOpaqueAPI)
|
||||||
{
|
{
|
||||||
if (useOpaqueAPI) {
|
if (useOpaqueAPI) {
|
||||||
return ZSTD_CCtxParams_setParameter(cctxParams, param, value);
|
return ZSTD_CCtxParams_setParameter(cctxParams, param, (int)value);
|
||||||
} else {
|
} else {
|
||||||
return ZSTD_CCtx_setParameter(zc, param, value);
|
return ZSTD_CCtx_setParameter(zc, param, (int)value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2851,7 +2851,7 @@ static int fuzzerTests_newAPI(U32 seed, int nbTests, int startTest,
|
|||||||
static const U32 maxSampleLog = 19;
|
static const U32 maxSampleLog = 19;
|
||||||
size_t const srcBufferSize = (size_t)1<<maxSrcLog;
|
size_t const srcBufferSize = (size_t)1<<maxSrcLog;
|
||||||
BYTE* cNoiseBuffer[5];
|
BYTE* cNoiseBuffer[5];
|
||||||
size_t const copyBufferSize= srcBufferSize + (1<<maxSampleLog);
|
size_t const copyBufferSize= srcBufferSize + ((size_t)1 << maxSampleLog);
|
||||||
BYTE* const copyBuffer = (BYTE*)malloc (copyBufferSize);
|
BYTE* const copyBuffer = (BYTE*)malloc (copyBufferSize);
|
||||||
size_t const cBufferSize = ZSTD_compressBound(srcBufferSize);
|
size_t const cBufferSize = ZSTD_compressBound(srcBufferSize);
|
||||||
BYTE* const cBuffer = (BYTE*)malloc (cBufferSize);
|
BYTE* const cBuffer = (BYTE*)malloc (cBufferSize);
|
||||||
|
|||||||
Reference in New Issue
Block a user