From 943fa6244a3985541bc93250d35ea4f4517fb266 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Tue, 4 Sep 2018 17:37:56 -0700 Subject: fix minor cast warning for C++ compilation --- tests/.gitignore | 5 ++++- tests/roundTripTest.c | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/.gitignore b/tests/.gitignore index 58947f7..9aa42a0 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,5 +1,5 @@ -# test build artefacts +# build artefacts datagen frametest frametest32 @@ -14,3 +14,6 @@ checkTag # test artefacts tmp* versionsTest + +# local tests +afl diff --git a/tests/roundTripTest.c b/tests/roundTripTest.c index 2f161d8..2caa2bc 100644 --- a/tests/roundTripTest.c +++ b/tests/roundTripTest.c @@ -82,10 +82,10 @@ static void roundTripTest(void* resultBuff, size_t resultBuffCapacity, int const randL = h32 % (cLevelSpan+1); int const cLevel = minCLevel + randL; int const realCLevel = (cLevel * 0) + 9; /* <=== Currently : only test level 9 */ - int const cSize = LZ4_compress_HC(srcBuff, compressedBuff, srcSize, compressedBuffCapacity, realCLevel); + int const cSize = LZ4_compress_HC((const char*)srcBuff, (char*)compressedBuff, (int)srcSize, (int)compressedBuffCapacity, realCLevel); CONTROL_MSG(cSize == 0, "Compression error !"); - { int const dSize = LZ4_decompress_safe(compressedBuff, resultBuff, cSize, resultBuffCapacity); + { int const dSize = LZ4_decompress_safe((const char*)compressedBuff, (char*)resultBuff, cSize, (int)resultBuffCapacity); CONTROL_MSG(dSize < 0, "Decompression detected an error !"); CONTROL_MSG(dSize != (int)srcSize, "Decompression corruption error : wrong decompressed size !"); } @@ -102,7 +102,7 @@ static void roundTripTest(void* resultBuff, size_t resultBuffCapacity, static void roundTripCheck(const void* srcBuff, size_t srcSize) { - size_t const cBuffSize = LZ4_compressBound(srcSize); + size_t const cBuffSize = LZ4_compressBound((int)srcSize); void* const cBuff = malloc(cBuffSize); void* const rBuff = malloc(cBuffSize); -- cgit v0.12