From 3d456bdf2a72aa617a66eb32e5c7a54f7cd5cb0c Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Fri, 11 Nov 2016 15:40:58 -0800 Subject: [PATCH] fixed conversion warnings --- lib/lz4frame.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lz4frame.c b/lib/lz4frame.c index 0a29a94..f2424a5 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -204,7 +204,7 @@ const char* LZ4F_getErrorName(LZ4F_errorCode_t code) LZ4F_errorCodes LZ4F_getErrorCode(size_t functionResult) { if (!LZ4F_isError(functionResult)) return LZ4F_OK_NoError; - return (LZ4F_errorCode_t)(-functionResult); + return (LZ4F_errorCodes)(-(ptrdiff_t)functionResult); } static LZ4F_errorCode_t err0r(LZ4F_errorCodes code) @@ -499,7 +499,7 @@ static size_t LZ4F_compressBlock(void* dst, const void* src, size_t srcSize, com LZ4F_writeLE32(cSizePtr, cSize); if (cSize == 0) { /* compression failed */ cSize = (U32)srcSize; - LZ4F_writeLE32(cSizePtr, srcSize | LZ4F_BLOCKUNCOMPRESSED_FLAG); + LZ4F_writeLE32(cSizePtr, cSize | LZ4F_BLOCKUNCOMPRESSED_FLAG); memcpy(cSizePtr+4, src, srcSize); } return cSize + 4;