diff options
author | Yann Collet <cyan@fb.com> | 2018-04-27 00:02:20 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2018-04-27 01:08:28 (GMT) |
commit | 0fb3a3b199ed0a92a402c5979c514a329b85462a (patch) | |
tree | 80ff4f7a1fd0933bc69d5552f646b628b225a08d /lib | |
parent | 5c7d3812d90aeaf072d14f6b5d935711da6f14c7 (diff) | |
download | lz4-0fb3a3b199ed0a92a402c5979c514a329b85462a.zip lz4-0fb3a3b199ed0a92a402c5979c514a329b85462a.tar.gz lz4-0fb3a3b199ed0a92a402c5979c514a329b85462a.tar.bz2 |
fixed a number of minor cast warnings
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lz4frame.c | 2 | ||||
-rw-r--r-- | lib/lz4hc.c | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c index 9d88644..0338266 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -613,7 +613,7 @@ size_t LZ4F_compressBegin_usingCDict(LZ4F_cctx* cctxPtr, LZ4F_applyCDict(cctxPtr->lz4CtxPtr, cdict, cctxPtr->prefs.compressionLevel); } if (preferencesPtr->compressionLevel >= LZ4HC_CLEVEL_MIN) { - LZ4_favorDecompressionSpeed(cctxPtr->lz4CtxPtr, (int)preferencesPtr->favorDecSpeed); + LZ4_favorDecompressionSpeed((LZ4_streamHC_t*)cctxPtr->lz4CtxPtr, (int)preferencesPtr->favorDecSpeed); } /* Magic Number */ diff --git a/lib/lz4hc.c b/lib/lz4hc.c index 39ab5fb..35eac1a 100644 --- a/lib/lz4hc.c +++ b/lib/lz4hc.c @@ -708,6 +708,7 @@ LZ4_FORCE_INLINE int LZ4HC_compress_generic_internal ( assert(cLevel >= 0); assert(cLevel <= LZ4HC_CLEVEL_MAX); { cParams_t const cParam = clTable[cLevel]; + HCfavor_e const favor = ctx->favorDecSpeed ? favorDecompressionSpeed : favorCompressionRatio; if (cParam.strat == lz4hc) return LZ4HC_compress_hashChain(ctx, src, dst, srcSizePtr, dstCapacity, @@ -717,8 +718,7 @@ LZ4_FORCE_INLINE int LZ4HC_compress_generic_internal ( src, dst, srcSizePtr, dstCapacity, cParam.nbSearches, cParam.targetLength, limit, cLevel == LZ4HC_CLEVEL_MAX, /* ultra mode */ - dict, - ctx->favorDecSpeed); + dict, favor); } } @@ -756,7 +756,7 @@ static int LZ4HC_compress_generic_dictCtx ( } else if (position == 0 && *srcSizePtr > 4 KB) { memcpy(ctx, ctx->dictCtx, sizeof(LZ4HC_CCtx_internal)); LZ4HC_setExternalDict(ctx, (const BYTE *)src); - ctx->compressionLevel = cLevel; + ctx->compressionLevel = (short)cLevel; return LZ4HC_compress_generic_noDictCtx(ctx, src, dst, srcSizePtr, dstCapacity, cLevel, limit); } else { return LZ4HC_compress_generic_internal(ctx, src, dst, srcSizePtr, dstCapacity, cLevel, limit, usingDictCtx); @@ -873,7 +873,7 @@ void LZ4_setCompressionLevel(LZ4_streamHC_t* LZ4_streamHCPtr, int compressionLev { if (compressionLevel < 1) compressionLevel = LZ4HC_CLEVEL_DEFAULT; if (compressionLevel > LZ4HC_CLEVEL_MAX) compressionLevel = LZ4HC_CLEVEL_MAX; - LZ4_streamHCPtr->internal_donotuse.compressionLevel = compressionLevel; + LZ4_streamHCPtr->internal_donotuse.compressionLevel = (short)compressionLevel; } void LZ4_favorDecompressionSpeed(LZ4_streamHC_t* LZ4_streamHCPtr, int favor) @@ -1274,7 +1274,6 @@ static int LZ4HC_compress_optimal ( price = opt[cur].price + LZ4HC_sequencePrice(0, ml); } - assert(opt[pos].price > 1); assert((U32)favorDecSpeed <= 1); if (pos > last_match_pos+TRAILING_LITERALS || price <= opt[pos].price - (int)favorDecSpeed) { |