From: Yann Collet Date: Fri, 2 Aug 2019 16:02:54 +0000 (+0200) Subject: fixed minor conversion warning in datagen X-Git-Tag: v1.4.3^2~5^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=387e20d4f00714a72613221b880d302087c3062b;p=thirdparty%2Fzstd.git fixed minor conversion warning in datagen --- diff --git a/programs/datagen.c b/programs/datagen.c index 88f48731b..ead9b2d24 100644 --- a/programs/datagen.c +++ b/programs/datagen.c @@ -64,7 +64,7 @@ static void RDG_fillLiteralDistrib(BYTE* ldt, fixedPoint_24_8 ld) BYTE character = (ld<=0.0) ? 0 : '0'; U32 u; - if (ld<=0.0) ld = 0.0; + if (ld<=0) ld = 0; for (u=0; u> 8) + 1; U32 const end = MIN ( u + weight , LTSIZE); diff --git a/tests/fuzzer.c b/tests/fuzzer.c index e23bdec90..fd3987567 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -123,7 +123,7 @@ static U32 FUZ_highbit32(U32 v32) exit(1); \ } } -#define CHECK_VAR(var, fn) var = fn; if (ZSTD_isError(var)) goto _output_error +#define CHECK_VAR(var, fn) var = fn; if (ZSTD_isError(var)) { DISPLAYLEVEL(1, "%s : fails : %s \n", #fn, ZSTD_getErrorName(var)); goto _output_error; } #define CHECK_NEWV(var, fn) size_t const CHECK_VAR(var, fn) #define CHECK(fn) { CHECK_NEWV(err, fn); } #define CHECKPLUS(var, fn, more) { CHECK_NEWV(var, fn); more; } @@ -1920,11 +1920,17 @@ static int basicUnitTests(U32 const seed, double compressibility) DISPLAYLEVEL(3, "test%3i : Dictionary Block decompression test : ", testNb++); CHECK( ZSTD_decompressBegin_usingDict(dctx, CNBuffer, dictSize) ); - { CHECK_NEWV( r, ZSTD_decompressBlock(dctx, decodedBuffer, CNBuffSize, compressedBuffer, cSize) ); - if (r != blockSize) goto _output_error; } + { CHECK_NEWV( r, ZSTD_decompressBlock(dctx, decodedBuffer, CNBuffSize, compressedBuffer, cSize) ); + if (r != blockSize) { + DISPLAYLEVEL(1, "ZSTD_decompressBlock() with _usingDict() fails : %s \n", ZSTD_getErrorName(r)); + goto _output_error; + } } ZSTD_insertBlock(dctx, (char*)decodedBuffer+blockSize, blockSize); /* insert non-compressed block into dctx history */ - { CHECK_NEWV( r, ZSTD_decompressBlock(dctx, (char*)decodedBuffer+2*blockSize, CNBuffSize, (char*)compressedBuffer+cSize+blockSize, cSize2) ); - if (r != blockSize) goto _output_error; } + { CHECK_NEWV( r, ZSTD_decompressBlock(dctx, (char*)decodedBuffer+2*blockSize, CNBuffSize, (char*)compressedBuffer+cSize+blockSize, cSize2) ); + if (r != blockSize) { + DISPLAYLEVEL(1, "ZSTD_decompressBlock() with _usingDict() and after insertBlock() fails : %s \n", ZSTD_getErrorName(r)); + goto _output_error; + } } DISPLAYLEVEL(3, "OK \n"); DISPLAYLEVEL(3, "test%3i : Block compression with CDict : ", testNb++);