From 294925292304b3c5b5e975f9036a684881dba469 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Wed, 5 Feb 2025 17:01:19 -0800 Subject: [PATCH] fix minor conversion warnings --- tests/zstreamtest.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/zstreamtest.c b/tests/zstreamtest.c index b50984f3f..760d9f26c 100644 --- a/tests/zstreamtest.c +++ b/tests/zstreamtest.c @@ -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); 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_jobSize, jobSize) ); + CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_c_jobSize, (int)jobSize) ); assert(start > offset); assert(start + segLength < COMPRESSIBLE_NOISE_LENGTH); 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 const kMaxWindowLog = bigTests ? 29 : 26; 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); ZSTD_Sequence* sequences = malloc(sizeof(ZSTD_Sequence) * kNbSequences); 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(in.pos != in.size, "input not fully consumed"); - remainingInput -= kSmallBlockSize; + remainingInput -= (int)kSmallBlockSize; } /* Write several very long offset matches into the dictionary */ 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; size_t const srcBufferSize = (size_t)1<