From 28cb94f53a4293ffd278f9d9cc72b164055ee623 Mon Sep 17 00:00:00 2001 From: Takayuki Matsuoka Date: Sun, 30 May 2021 09:02:36 +0900 Subject: [PATCH] Fix -Wshorten-64-to-32 warning Fix -Wshorten-64-to-32 warning The following CI test (macOS) reports "-Wshorten-64-to-32" warning make V=1 clean test MOREFLAGS='-Werror -Wconversion -Wno-sign-conversion' ``` blockStreaming_lineByLine.c:68:54: error: implicit conversion loses integer precision: 'const size_t' (aka 'const unsigned long') to 'int' [-Werror,-Wshorten-64-to-32] lz4Stream, inpPtr, cmpBuf, inpBytes, cmpBufBytes, 1); ^~~~~~~~~~~ ``` --- examples/blockStreaming_lineByLine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/blockStreaming_lineByLine.c b/examples/blockStreaming_lineByLine.c index 19c3345..3047a3a 100644 --- a/examples/blockStreaming_lineByLine.c +++ b/examples/blockStreaming_lineByLine.c @@ -65,7 +65,7 @@ static void test_compress( { const int cmpBytes = LZ4_compress_fast_continue( - lz4Stream, inpPtr, cmpBuf, inpBytes, cmpBufBytes, 1); + lz4Stream, inpPtr, cmpBuf, inpBytes, (int) cmpBufBytes, 1); if (cmpBytes <= 0) break; write_uint16(outFp, (uint16_t) cmpBytes); write_bin(outFp, cmpBuf, cmpBytes);