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 /examples/frameCompress.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 'examples/frameCompress.c')
-rw-r--r-- | examples/frameCompress.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/frameCompress.c b/examples/frameCompress.c index 2cc4649..a189329 100644 --- a/examples/frameCompress.c +++ b/examples/frameCompress.c @@ -70,11 +70,12 @@ compress_file_internal(FILE* f_in, FILE* f_out, /* write frame header */ { size_t const headerSize = LZ4F_compressBegin(ctx, outBuff, outCapacity, &kPrefs); if (LZ4F_isError(headerSize)) { - printf("Failed to start compression: error %zu\n", headerSize); + printf("Failed to start compression: error %u \n", (unsigned)headerSize); return result; } count_out = headerSize; - printf("Buffer size is %zu bytes, header size %zu bytes\n", outCapacity, headerSize); + printf("Buffer size is %u bytes, header size %u bytes \n", + (unsigned)outCapacity, (unsigned)headerSize); safe_fwrite(outBuff, 1, headerSize, f_out); } @@ -89,11 +90,11 @@ compress_file_internal(FILE* f_in, FILE* f_out, inBuff, readSize, NULL); if (LZ4F_isError(compressedSize)) { - printf("Compression failed: error %zu\n", compressedSize); + printf("Compression failed: error %u \n", (unsigned)compressedSize); return result; } - printf("Writing %zu bytes\n", compressedSize); + printf("Writing %u bytes\n", (unsigned)compressedSize); safe_fwrite(outBuff, 1, compressedSize, f_out); count_out += compressedSize; } @@ -103,11 +104,11 @@ compress_file_internal(FILE* f_in, FILE* f_out, outBuff, outCapacity, NULL); if (LZ4F_isError(compressedSize)) { - printf("Failed to end compression: error %zu\n", compressedSize); + printf("Failed to end compression: error %u \n", (unsigned)compressedSize); return result; } - printf("Writing %zu bytes\n", compressedSize); + printf("Writing %u bytes \n", (unsigned)compressedSize); safe_fwrite(outBuff, 1, compressedSize, f_out); count_out += compressedSize; } |