summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-09-22 16:38:17 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-09-22 16:38:17 (GMT)
commitabb6f7806a9753504776a7d4a9c1bbb4841f91c8 (patch)
treec6febde026adc92e9f8ed54b8607053fd5474548
parent6e1049872ae2606cfb3820464c850c694275ae59 (diff)
downloadlz4-abb6f7806a9753504776a7d4a9c1bbb4841f91c8.zip
lz4-abb6f7806a9753504776a7d4a9c1bbb4841f91c8.tar.gz
lz4-abb6f7806a9753504776a7d4a9c1bbb4841f91c8.tar.bz2
Added : suooirt for s390x, thanks to Nobuhiro Iwamatsu
Multiple warning fixes for Visual Studio 2012
-rw-r--r--NEWS1
-rw-r--r--lz4.c3
-rw-r--r--lz4frame.c72
-rw-r--r--lz4hc.c3
-rw-r--r--programs/frametest.c14
-rw-r--r--programs/fullbench.c12
-rw-r--r--programs/fuzzer.c1
7 files changed, 55 insertions, 51 deletions
diff --git a/NEWS b/NEWS
index ee4e40b..41d5762 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
r123:
Added : experimental lz4frame API, thanks to Takayuki Matsuoka and Christopher Jackson for testings
+Fix : s390x support, thanks to Nobuhiro Iwamatsu
Fix : test mode (-t) no longer requires confirmation, thanks to Thary Nguyen
r122:
diff --git a/lz4.c b/lz4.c
index 1c8e416..39f176f 100644
--- a/lz4.c
+++ b/lz4.c
@@ -51,7 +51,8 @@
|| defined(__powerpc64__) || defined(__powerpc64le__) \
|| defined(__ppc64__) || defined(__ppc64le__) \
|| defined(__PPC64__) || defined(__PPC64LE__) \
- || defined(__ia64) || defined(__itanium__) || defined(_M_IA64) ) /* Detects 64 bits mode */
+ || defined(__ia64) || defined(__itanium__) || defined(_M_IA64) \
+ || defined(__s390x__) ) /* Detects 64 bits mode */
# define LZ4_ARCH64 1
#else
# define LZ4_ARCH64 0
diff --git a/lz4frame.c b/lz4frame.c
index 47ad655..35e5b0b 100644
--- a/lz4frame.c
+++ b/lz4frame.c
@@ -177,7 +177,7 @@ int LZ4F_isError(LZ4F_errorCode_t code)
const char* LZ4F_getErrorName(LZ4F_errorCode_t code)
{
static const char* codeError = "Unspecified error code";
- if (LZ4F_isError(code)) return LZ4F_errorStrings[-code];
+ if (LZ4F_isError(code)) return LZ4F_errorStrings[-(int)(code)];
return codeError;
}
@@ -191,7 +191,7 @@ static size_t LZ4F_getBlockSize(unsigned blockSizeID)
if (blockSizeID == 0) blockSizeID = LZ4F_BLOCKSIZEID_DEFAULT;
blockSizeID -= 4;
- if (blockSizeID > 3) return -ERROR_maxBlockSize_invalid;
+ if (blockSizeID > 3) return (size_t)-ERROR_maxBlockSize_invalid;
return blockSizes[blockSizeID];
}
@@ -217,7 +217,7 @@ static U32 LZ4F_readLE32 (const BYTE* srcPtr)
static BYTE LZ4F_headerChecksum (const BYTE* header, size_t length)
{
- U32 xxh = XXH32(header, length, 0);
+ U32 xxh = XXH32(header, (U32)length, 0);
return (BYTE)(xxh >> 8);
}
@@ -286,7 +286,7 @@ size_t LZ4F_compressFrame(void* dstBuffer, size_t dstMaxSize, const void* srcBuf
options.stableSrc = 1;
if (dstMaxSize < LZ4F_compressFrameBound(srcSize, &prefs))
- return -ERROR_dstMaxSize_tooSmall;
+ return (size_t)-ERROR_dstMaxSize_tooSmall;
errorCode = LZ4F_compressBegin(&cctxI, dstBuffer, dstMaxSize, &prefs); /* write header */
if (LZ4F_isError(errorCode)) return errorCode;
@@ -322,7 +322,7 @@ LZ4F_errorCode_t LZ4F_createCompressionContext(LZ4F_compressionContext_t* LZ4F_c
LZ4F_cctx_internal_t* cctxPtr;
cctxPtr = ALLOCATOR(sizeof(LZ4F_cctx_internal_t));
- if (cctxPtr==NULL) return -ERROR_allocation_failed;
+ if (cctxPtr==NULL) return (LZ4F_errorCode_t)-ERROR_allocation_failed;
cctxPtr->version = version;
cctxPtr->cStage = 0; /* Next stage : write header */
@@ -359,8 +359,8 @@ size_t LZ4F_compressBegin(LZ4F_compressionContext_t compressionContext, void* ds
BYTE* headerStart;
size_t requiredBuffSize;
- if (dstMaxSize < LZ4F_MAXHEADERFRAME_SIZE) return -ERROR_dstMaxSize_tooSmall;
- if (cctxPtr->cStage != 0) return -ERROR_GENERIC;
+ if (dstMaxSize < LZ4F_MAXHEADERFRAME_SIZE) return (size_t)-ERROR_dstMaxSize_tooSmall;
+ if (cctxPtr->cStage != 0) return (size_t)-ERROR_GENERIC;
if (preferencesPtr == NULL) preferencesPtr = &prefNull;
/* Buffer Management */
@@ -377,7 +377,7 @@ size_t LZ4F_compressBegin(LZ4F_compressionContext_t compressionContext, void* ds
cctxPtr->maxBufferSize = requiredBuffSize;
FREEMEM(cctxPtr->tmpBuff);
cctxPtr->tmpBuff = ALLOCATOR(requiredBuffSize);
- if (cctxPtr->tmpBuff == NULL) return -ERROR_allocation_failed;
+ if (cctxPtr->tmpBuff == NULL) return (size_t)-ERROR_allocation_failed;
}
cctxPtr->tmpIn = cctxPtr->tmpBuff;
cctxPtr->tmpInSize = 0;
@@ -414,7 +414,7 @@ size_t LZ4F_compressBound(size_t srcSize, const LZ4F_preferences_t* preferencesP
LZ4F_frameInfo_t* frameInfoPtr = (LZ4F_frameInfo_t*)preferencesPtr; /* works because prefs starts with frameInfo */
blockSizeID_t bid = (frameInfoPtr==NULL) ? LZ4F_BLOCKSIZEID_DEFAULT : frameInfoPtr->blockSizeID;
size_t blockSize = LZ4F_getBlockSize(bid);
- unsigned nbBlocks = (srcSize / blockSize) + 1;
+ unsigned nbBlocks = (unsigned)(srcSize / blockSize) + 1;
size_t lastBlockSize = preferencesPtr->autoFlush ? srcSize % blockSize : blockSize;
size_t blockInfo = 4; /* default, without block CRC option */
size_t frameEnd = 4 + (frameInfoPtr->contentChecksumFlag*4);
@@ -435,8 +435,8 @@ static size_t LZ4F_compressBlock(void* dst, const void* src, size_t srcSize, com
LZ4F_writeLE32(cSizePtr, cSize);
if (cSize == 0) /* compression failed */
{
- cSize = srcSize;
- LZ4F_writeLE32(cSizePtr, srcSize + LZ4F_BLOCKUNCOMPRESSED_FLAG);
+ cSize = (U32)srcSize;
+ LZ4F_writeLE32(cSizePtr, cSize + LZ4F_BLOCKUNCOMPRESSED_FLAG);
memcpy(cSizePtr+4, src, srcSize);
}
return cSize + 4;
@@ -467,8 +467,8 @@ size_t LZ4F_compressUpdate(LZ4F_compressionContext_t compressionContext, void* d
compressFunc_t compress;
- if (cctxPtr->cStage != 1) return -ERROR_GENERIC;
- if (dstMaxSize < LZ4F_compressBound(srcSize, &(cctxPtr->prefs))) return -ERROR_dstMaxSize_tooSmall;
+ if (cctxPtr->cStage != 1) return (size_t)-ERROR_GENERIC;
+ if (dstMaxSize < LZ4F_compressBound(srcSize, &(cctxPtr->prefs))) return (size_t)-ERROR_dstMaxSize_tooSmall;
if (compressOptionsPtr == NULL) compressOptionsPtr = &cOptionsNull;
/* select compression function */
@@ -529,7 +529,7 @@ size_t LZ4F_compressUpdate(LZ4F_compressionContext_t compressionContext, void* d
{
int realDictSize;
realDictSize = LZ4_saveDict (&(cctxPtr->lz4ctx), (char*)(cctxPtr->tmpBuff), 64 KB);
- if (realDictSize==0) return -ERROR_GENERIC;
+ if (realDictSize==0) return (size_t)-ERROR_GENERIC;
cctxPtr->tmpIn = cctxPtr->tmpBuff + realDictSize;
}
}
@@ -575,8 +575,8 @@ size_t LZ4F_flush(LZ4F_compressionContext_t compressionContext, void* dstBuffer,
if (cctxPtr->tmpInSize == 0) return 0; /* nothing to flush */
- if (cctxPtr->cStage != 1) return -ERROR_GENERIC;
- if (dstMaxSize < (cctxPtr->tmpInSize + 16)) return -ERROR_dstMaxSize_tooSmall;
+ if (cctxPtr->cStage != 1) return (size_t)-ERROR_GENERIC;
+ if (dstMaxSize < (cctxPtr->tmpInSize + 16)) return (size_t)-ERROR_dstMaxSize_tooSmall;
if (compressOptionsPtr == NULL) compressOptionsPtr = &cOptionsNull;
/* select compression function */
@@ -653,7 +653,7 @@ LZ4F_errorCode_t LZ4F_createDecompressionContext(LZ4F_compressionContext_t* LZ4F
LZ4F_dctx_internal_t* dctxPtr;
dctxPtr = ALLOCATOR(sizeof(LZ4F_dctx_internal_t));
- if (dctxPtr==NULL) return -ERROR_GENERIC;
+ if (dctxPtr==NULL) return (LZ4F_errorCode_t)-ERROR_GENERIC;
dctxPtr->version = versionNumber;
*LZ4F_decompressionContextPtr = (LZ4F_compressionContext_t)dctxPtr;
@@ -679,10 +679,10 @@ static size_t LZ4F_decodeHeader(LZ4F_dctx_internal_t* dctxPtr, const BYTE* srcPt
size_t bufferNeeded;
/* need to decode header to get frameInfo */
- if (srcSize < 7) return -ERROR_GENERIC; /* minimal header size */
+ if (srcSize < 7) return (size_t)-ERROR_GENERIC; /* minimal header size */
/* control magic number */
- if (LZ4F_readLE32(srcPtr) != LZ4F_MAGICNUMBER) return -ERROR_GENERIC;
+ if (LZ4F_readLE32(srcPtr) != LZ4F_MAGICNUMBER) return (size_t)-ERROR_GENERIC;
srcPtr += 4;
/* Flags */
@@ -698,17 +698,17 @@ static size_t LZ4F_decodeHeader(LZ4F_dctx_internal_t* dctxPtr, const BYTE* srcPt
/* check */
HC = LZ4F_headerChecksum(srcPtr, 2);
- if (HC != srcPtr[2]) return -ERROR_GENERIC; /* Bad header checksum error */
+ if (HC != srcPtr[2]) return (size_t)-ERROR_GENERIC; /* Bad header checksum error */
/* validate */
- if (version != 1) return -ERROR_GENERIC; /* Version Number, only supported value */
- if (blockChecksumFlag != 0) return -ERROR_GENERIC; /* Only supported value for the time being */
- if (contentSizeFlag != 0) return -ERROR_GENERIC; /* Only supported value for the time being */
- if (((FLG>>1)&_1BIT) != 0) return -ERROR_GENERIC; /* Reserved bit */
- if (dictFlag != 0) return -ERROR_GENERIC; /* Only supported value for the time being */
- if (((BD>>7)&_1BIT) != 0) return -ERROR_GENERIC; /* Reserved bit */
- if (blockSizeID < 4) return -ERROR_GENERIC; /* Only supported values for the time being */
- if (((BD>>0)&_4BITS) != 0) return -ERROR_GENERIC; /* Reserved bits */
+ if (version != 1) return (size_t)-ERROR_GENERIC; /* Version Number, only supported value */
+ if (blockChecksumFlag != 0) return (size_t)-ERROR_GENERIC; /* Only supported value for the time being */
+ if (contentSizeFlag != 0) return (size_t)-ERROR_GENERIC; /* Only supported value for the time being */
+ if (((FLG>>1)&_1BIT) != 0) return (size_t)-ERROR_GENERIC; /* Reserved bit */
+ if (dictFlag != 0) return (size_t)-ERROR_GENERIC; /* Only supported value for the time being */
+ if (((BD>>7)&_1BIT) != 0) return (size_t)-ERROR_GENERIC; /* Reserved bit */
+ if (blockSizeID < 4) return (size_t)-ERROR_GENERIC; /* Only supported values for the time being */
+ if (((BD>>0)&_4BITS) != 0) return (size_t)-ERROR_GENERIC; /* Reserved bits */
/* save */
dctxPtr->frameInfo.blockMode = blockMode;
@@ -727,9 +727,9 @@ static size_t LZ4F_decodeHeader(LZ4F_dctx_internal_t* dctxPtr, const BYTE* srcPt
FREEMEM(dctxPtr->tmpOutBuffer);
dctxPtr->maxBufferSize = bufferNeeded;
dctxPtr->tmpIn = ALLOCATOR(dctxPtr->maxBlockSize);
- if (dctxPtr->tmpIn == NULL) return -ERROR_GENERIC;
+ if (dctxPtr->tmpIn == NULL) return (size_t)-ERROR_GENERIC;
dctxPtr->tmpOutBuffer= ALLOCATOR(dctxPtr->maxBufferSize);
- if (dctxPtr->tmpOutBuffer== NULL) return -ERROR_GENERIC;
+ if (dctxPtr->tmpOutBuffer== NULL) return (size_t)-ERROR_GENERIC;
}
dctxPtr->tmpInSize = 0;
dctxPtr->tmpInTarget = 0;
@@ -908,7 +908,7 @@ size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext,
/* expect to continue decoding src buffer where it left previously */
if (dctxPtr->srcExpect != NULL)
{
- if (srcStart != dctxPtr->srcExpect) return -ERROR_GENERIC;
+ if (srcStart != dctxPtr->srcExpect) return (size_t)-ERROR_GENERIC;
}
/* programmed as a state machine */
@@ -1000,7 +1000,7 @@ size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext,
dctxPtr->dStage = dstage_getSuffix;
break;
}
- if (nextCBlockSize > dctxPtr->maxBlockSize) return -ERROR_GENERIC; /* invalid cBlockSize */
+ if (nextCBlockSize > dctxPtr->maxBlockSize) return (size_t)-ERROR_GENERIC; /* invalid cBlockSize */
dctxPtr->tmpInTarget = nextCBlockSize;
if (LZ4F_readLE32(selectedIn) & LZ4F_BLOCKUNCOMPRESSED_FLAG)
{
@@ -1022,7 +1022,7 @@ size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext,
if ((size_t)(srcEnd-srcPtr) < sizeToCopy) sizeToCopy = srcEnd - srcPtr; /* not enough input to read full block */
if ((size_t)(dstEnd-dstPtr) < sizeToCopy) sizeToCopy = dstEnd - dstPtr;
memcpy(dstPtr, srcPtr, sizeToCopy);
- if (dctxPtr->frameInfo.contentChecksumFlag) XXH32_update(&(dctxPtr->xxh), srcPtr, sizeToCopy);
+ if (dctxPtr->frameInfo.contentChecksumFlag) XXH32_update(&(dctxPtr->xxh), srcPtr, (U32)sizeToCopy);
/* dictionary management */
if (dctxPtr->frameInfo.blockMode==blockLinked)
@@ -1093,7 +1093,7 @@ size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext,
decoder = LZ4F_decompress_safe;
decodedSize = decoder((const char*)selectedIn, (char*)dstPtr, (int)dctxPtr->tmpInTarget, (int)dctxPtr->maxBlockSize, (const char*)dctxPtr->dict, (int)dctxPtr->dictSize);
- if (decodedSize < 0) return -ERROR_GENERIC; /* decompression failed */
+ if (decodedSize < 0) return (size_t)-ERROR_GENERIC; /* decompression failed */
if (dctxPtr->frameInfo.contentChecksumFlag) XXH32_update(&(dctxPtr->xxh), dstPtr, decodedSize);
/* dictionary management */
@@ -1138,7 +1138,7 @@ size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext,
/* Decode */
decodedSize = decoder((const char*)selectedIn, (char*)dctxPtr->tmpOut, (int)dctxPtr->tmpInTarget, (int)dctxPtr->maxBlockSize, (const char*)dctxPtr->dict, (int)dctxPtr->dictSize);
- if (decodedSize < 0) return -ERROR_decompressionFailed; /* decompression failed */
+ if (decodedSize < 0) return (size_t)-ERROR_decompressionFailed; /* decompression failed */
if (dctxPtr->frameInfo.contentChecksumFlag) XXH32_update(&(dctxPtr->xxh), dctxPtr->tmpOut, decodedSize);
dctxPtr->tmpOutSize = decodedSize;
dctxPtr->tmpOutStart = 0;
@@ -1214,7 +1214,7 @@ size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext,
{
U32 readCRC = LZ4F_readLE32(selectedIn);
U32 resultCRC = XXH32_intermediateDigest(&(dctxPtr->xxh));
- if (readCRC != resultCRC) return -ERROR_checksum_invalid;
+ if (readCRC != resultCRC) return (size_t)-ERROR_checksum_invalid;
nextSrcSizeHint = 0;
dctxPtr->dStage = dstage_getHeader;
doAnotherStage = 0;
diff --git a/lz4hc.c b/lz4hc.c
index 441a1d6..34a6173 100644
--- a/lz4hc.c
+++ b/lz4hc.c
@@ -58,7 +58,8 @@
|| defined(__powerpc64__) || defined(__powerpc64le__) \
|| defined(__ppc64__) || defined(__ppc64le__) \
|| defined(__PPC64__) || defined(__PPC64LE__) \
- || defined(__ia64) || defined(__itanium__) || defined(_M_IA64) ) /* Detects 64 bits mode */
+ || defined(__ia64) || defined(__itanium__) || defined(_M_IA64) \
+ || defined(__s390x__) ) /* Detects 64 bits mode */
# define LZ4_ARCH64 1
#else
# define LZ4_ARCH64 0
diff --git a/programs/frametest.c b/programs/frametest.c
index aa1a727..19e8e82 100644
--- a/programs/frametest.c
+++ b/programs/frametest.c
@@ -279,7 +279,7 @@ int basicTests(U32 seed, double compressibility)
DISPLAYLEVEL(3, "Decompression test : \n");
{
size_t decodedBufferSize = COMPRESSIBLE_NOISE_LENGTH;
- unsigned maxBits = FUZ_highbit(decodedBufferSize);
+ unsigned maxBits = FUZ_highbit((U32)decodedBufferSize);
BYTE* op = (BYTE*)decodedBuffer;
BYTE* const oend = (BYTE*)decodedBuffer + COMPRESSIBLE_NOISE_LENGTH;
BYTE* ip = (BYTE*)compressedBuffer;
@@ -377,8 +377,8 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi
void* compressedBuffer = NULL;
void* decodedBuffer = NULL;
U32 coreRand = seed;
- LZ4F_decompressionContext_t dCtx;
- LZ4F_compressionContext_t cCtx;
+ LZ4F_decompressionContext_t dCtx = NULL;
+ LZ4F_compressionContext_t cCtx = NULL;
size_t result;
XXH64_stateSpace_t xxh64;
# define CHECK(cond, ...) if (cond) { DISPLAY("Error => "); DISPLAY(__VA_ARGS__); \
@@ -424,13 +424,13 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi
prefs.autoFlush = autoflush;
DISPLAYUPDATE(2, "\r%5i ", testNb);
- crcOrig = XXH64((BYTE*)srcBuffer+srcStart, srcSize, 1);
+ crcOrig = XXH64((BYTE*)srcBuffer+srcStart, (U32)srcSize, 1);
if ((FUZ_rand(&randState)&0xF) == 2)
{
LZ4F_preferences_t* framePrefs = &prefs;
if ((FUZ_rand(&randState)&7) == 1) framePrefs = NULL;
- cSize = LZ4F_compressFrame(compressedBuffer, LZ4F_compressFrameBound(srcSize, framePrefs), srcBuffer + srcStart, srcSize, framePrefs);
+ cSize = LZ4F_compressFrame(compressedBuffer, LZ4F_compressFrameBound(srcSize, framePrefs), (char*)srcBuffer + srcStart, srcSize, framePrefs);
CHECK(LZ4F_isError(cSize), "LZ4F_compressFrame failed : error %i (%s)", (int)cSize, LZ4F_getErrorName(cSize));
}
else
@@ -439,7 +439,7 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi
const BYTE* const iend = ip + srcSize;
BYTE* op = compressedBuffer;
BYTE* const oend = op + LZ4F_compressFrameBound(srcDataLength, NULL);
- unsigned maxBits = FUZ_highbit(srcSize);
+ unsigned maxBits = FUZ_highbit((U32)srcSize);
result = LZ4F_compressBegin(cCtx, op, oend-op, &prefs);
CHECK(LZ4F_isError(result), "Compression header failed (error %i)", (int)result);
op += result;
@@ -475,7 +475,7 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi
const BYTE* const iend = ip + cSize;
BYTE* op = decodedBuffer;
BYTE* const oend = op + srcDataLength;
- unsigned maxBits = FUZ_highbit(cSize);
+ unsigned maxBits = FUZ_highbit((U32)cSize);
unsigned nonContiguousDst = (FUZ_rand(&randState) & 3) == 1;
nonContiguousDst += FUZ_rand(&randState) & nonContiguousDst; /* 0=>0; 1=>1,2 */
XXH64_resetState(&xxh64, 1);
diff --git a/programs/fullbench.c b/programs/fullbench.c
index 5ee1710..f34c68c 100644
--- a/programs/fullbench.c
+++ b/programs/fullbench.c
@@ -268,7 +268,7 @@ static int local_LZ4_compress_limitedOutput_withState(const char* in, char* out,
return LZ4_compress_limitedOutput_withState(stateLZ4, in, out, inSize, LZ4_compressBound(inSize));
}
-static void* ctx;
+static LZ4_stream_t* ctx;
static int local_LZ4_compress_continue(const char* in, char* out, int inSize)
{
return LZ4_compress_continue(ctx, in, out, inSize);
@@ -323,7 +323,7 @@ static int local_LZ4_compressHC_limitedOutput_continue(const char* in, char* out
static int local_LZ4F_compressFrame(const char* in, char* out, int inSize)
{
- return LZ4F_compressFrame(out, 2*inSize + 16, in, inSize, NULL);
+ return (int)LZ4F_compressFrame(out, 2*inSize + 16, in, inSize, NULL);
}
static int local_LZ4_decompress_fast(const char* in, char* out, int inSize, int outSize)
@@ -378,7 +378,7 @@ static int local_LZ4F_decompress(const char* in, char* out, int inSize, int outS
result = LZ4F_decompress(g_dCtx, out, &dstSize, in, &srcSize, NULL);
if (result!=0) { DISPLAY("Error decompressing frame : unfinished frame\n"); exit(8); }
if (srcSize != (size_t)inSize) { DISPLAY("Error decompressing frame : read size incorrect\n"); exit(9); }
- return dstSize;
+ return (int)dstSize;
}
@@ -526,7 +526,7 @@ int fullSpeedBench(char** fileNamesTable, int nbFiles)
case 12: compressionFunction = local_LZ4_compressHC_limitedOutput_continue; initFunction = LZ4_createHC; compressorName = "LZ4_compressHC_limitedOutput_continue"; break;
case 13: compressionFunction = local_LZ4_compress_forceDict; initFunction = local_LZ4_resetDictT; compressorName = "LZ4_compress_forceDict"; break;
case 14: compressionFunction = local_LZ4F_compressFrame; compressorName = "LZ4F_compressFrame";
- chunkP[0].origSize = benchedSize; nbChunks=1;
+ chunkP[0].origSize = (int)benchedSize; nbChunks=1;
break;
default : DISPLAY("ERROR ! Bad algorithm Id !! \n"); free(chunkP); return 1;
}
@@ -602,8 +602,8 @@ int fullSpeedBench(char** fileNamesTable, int nbFiles)
case 9: decompressionFunction = local_LZ4F_decompress; dName = "LZ4F_decompress";
errorCode = LZ4F_compressFrame(compressed_buff, compressedBuffSize, orig_buff, benchedSize, NULL);
if (LZ4F_isError(errorCode)) { DISPLAY("Preparation error compressing frame\n"); return 1; }
- chunkP[0].origSize = benchedSize;
- chunkP[0].compressedSize = errorCode;
+ chunkP[0].origSize = (int)benchedSize;
+ chunkP[0].compressedSize = (int)errorCode;
nbChunks = 1;
break;
default : DISPLAY("ERROR ! Bad decompression algorithm Id !! \n"); free(chunkP); return 1;
diff --git a/programs/fuzzer.c b/programs/fuzzer.c
index f19382c..c98333d 100644
--- a/programs/fuzzer.c
+++ b/programs/fuzzer.c
@@ -29,6 +29,7 @@
#ifdef _MSC_VER /* Visual Studio */
# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
# pragma warning(disable : 4146) /* disable: C4146: minus unsigned expression */
+# pragma warning(disable : 4310) /* disable: C4310: constant char value > 127 */
#endif