diff options
author | Yann Collet <cyan@fb.com> | 2018-09-19 01:08:59 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2018-09-19 19:12:49 (GMT) |
commit | b2215f2a8996e0cfd0d1950968c1ab43733be161 (patch) | |
tree | 5abbcfea7cc2ac9323bd2a4f302abcc3cd264fd0 /tests/frametest.c | |
parent | e75d04791fdb53056a1ae7892e9e41c89e34640e (diff) | |
download | lz4-b2215f2a8996e0cfd0d1950968c1ab43733be161.zip lz4-b2215f2a8996e0cfd0d1950968c1ab43733be161.tar.gz lz4-b2215f2a8996e0cfd0d1950968c1ab43733be161.tar.bz2 |
tried to clean another bunch of cppcheck warnings
so "funny" thing with cppcheck
is that no 2 versions give the same list of warnings.
On Mac, I'm using v1.81, which had all warnings fixed.
On Travis CI, it's v1.61, and it complains about a dozen more/different things.
On Linux, it's v1.72, and it finds a completely different list of a half dozen warnings.
Some of these seems to be bugs/limitations in cppcheck itself.
The TravisCI version v1.61 seems unable to understand %zu correctly, and seems to assume it means %u.
Diffstat (limited to 'tests/frametest.c')
-rw-r--r-- | tests/frametest.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/frametest.c b/tests/frametest.c index 5714732..f8498b7 100644 --- a/tests/frametest.c +++ b/tests/frametest.c @@ -343,9 +343,10 @@ int basicTests(U32 seed, double compressibility) op += oSize; ip += iSize; } - { U64 const crcDest = XXH64(decodedBuffer, COMPRESSIBLE_NOISE_LENGTH, 1); - if (crcDest != crcOrig) goto _output_error; } - DISPLAYLEVEL(3, "Regenerated %u/%u bytes \n", (unsigned)(op-ostart), COMPRESSIBLE_NOISE_LENGTH); + { U64 const crcDest = XXH64(decodedBuffer, COMPRESSIBLE_NOISE_LENGTH, 1); + if (crcDest != crcOrig) goto _output_error; + } + DISPLAYLEVEL(3, "Regenerated %u/%u bytes \n", (unsigned)(op-ostart), (unsigned)COMPRESSIBLE_NOISE_LENGTH); } } @@ -840,8 +841,8 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi size_t const iSize = MIN(sampleMax, (size_t)(iend-ip)); size_t const oSize = LZ4F_compressBound(iSize, prefsPtr); cOptions.stableSrc = ((FUZ_rand(&randState) & 3) == 1); - DISPLAYLEVEL(6, "Sending %zu bytes to compress (stableSrc:%u) \n", - iSize, cOptions.stableSrc); + DISPLAYLEVEL(6, "Sending %u bytes to compress (stableSrc:%u) \n", + (unsigned)iSize, cOptions.stableSrc); result = LZ4F_compressUpdate(cCtx, op, oSize, ip, iSize, &cOptions); CHECK(LZ4F_isError(result), "Compression failed (error %i : %s)", (int)result, LZ4F_getErrorName(result)); |