static const size_t minFHSize = 7;
static const size_t maxFHSize = 15;
static const size_t BHSize = 4;
-static const U32 minHClevel = 3;
+static const int minHClevel = 3;
/**************************************
* Structures and local types
if (prefs.frameInfo.contentSize != 0)
prefs.frameInfo.contentSize = (U64)srcSize; /* auto-correct content size if selected (!=0) */
- if (prefs.compressionLevel < minHClevel)
+ if (prefs.compressionLevel < (int)minHClevel)
{
cctxI.lz4CtxPtr = &lz4ctx;
cctxI.lz4CtxLevel = 1;
if (LZ4F_isError(errorCode)) return errorCode;
dstPtr += errorCode;
- if (prefs.compressionLevel >= minHClevel) /* no allocation necessary with lz4 fast */
+ if (prefs.compressionLevel >= (int)minHClevel) /* no allocation necessary with lz4 fast */
FREEMEM(cctxI.lz4CtxPtr);
return (dstPtr - dstStart);
/* ctx Management */
{
- U32 tableID = cctxPtr->prefs.compressionLevel<minHClevel ? 1 : 2; /* 0:nothing ; 1:LZ4 table ; 2:HC tables */
+ U32 tableID = (cctxPtr->prefs.compressionLevel < minHClevel) ? 1 : 2; /* 0:nothing ; 1:LZ4 table ; 2:HC tables */
if (cctxPtr->lz4CtxLevel < tableID)
{
FREEMEM(cctxPtr->lz4CtxPtr);
- if (cctxPtr->prefs.compressionLevel<minHClevel)
+ if (cctxPtr->prefs.compressionLevel < minHClevel)
cctxPtr->lz4CtxPtr = (void*)LZ4_createStream();
else
cctxPtr->lz4CtxPtr = (void*)LZ4_createStreamHC();
return LZ4_compressHC_limitedOutput_continue((LZ4_streamHC_t*)ctx, src, dst, srcSize, dstSize);
}
-static compressFunc_t LZ4F_selectCompression(LZ4F_blockMode_t blockMode, U32 level)
+static compressFunc_t LZ4F_selectCompression(LZ4F_blockMode_t blockMode, int level)
{
if (level < minHClevel)
{
typedef struct {
LZ4F_frameInfo_t frameInfo;
- unsigned compressionLevel; /* 0 == default (fast mode); values above 16 count as 16 */
- unsigned autoFlush; /* 1 == always flush (reduce need for tmp buffer) */
- unsigned reserved[4]; /* must be zero for forward compatibility */
+ int compressionLevel; /* 0 == default (fast mode); values above 16 count as 16; values below 0 count as 0 */
+ unsigned autoFlush; /* 1 == always flush (reduce need for tmp buffer) */
+ unsigned reserved[4]; /* must be zero for forward compatibility */
} LZ4F_preferences_t;