mirror of
https://github.com/facebook/zstd.git
synced 2025-12-09 14:01:11 +03:00
fixed conversion warnings
This commit is contained in:
@@ -467,17 +467,16 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
|
||||
switch((litBlockType_t)(istart[0] & 3))
|
||||
{
|
||||
case lbt_huffman:
|
||||
if (srcSize < 5) return ERROR(corruption_detected); /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for lhSize, + cSize (+nbSeq) */
|
||||
{ size_t lhSize, litSize, litCSize;
|
||||
U32 singleStream=0;
|
||||
U32 const lhlCode = (istart[0] >> 2) & 3;
|
||||
U32 const lhc = MEM_read32(istart);
|
||||
if (srcSize < 5) return ERROR(corruption_detected); /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for lhSize, + cSize (+nbSeq) */
|
||||
switch(lhlCode)
|
||||
{
|
||||
case 0: case 1: default: /* note : default is impossible, since lhlCode into [0..3] */
|
||||
/* 2 - 2 - 10 - 10 */
|
||||
{ //U32 const lhc = MEM_readLE32(istart);
|
||||
singleStream = lhlCode;
|
||||
{ singleStream = lhlCode;
|
||||
lhSize = 3;
|
||||
litSize = (lhc >> 4) & 0x3FF;
|
||||
litCSize = (lhc >> 14) & 0x3FF;
|
||||
@@ -485,16 +484,14 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
|
||||
}
|
||||
case 2:
|
||||
/* 2 - 2 - 14 - 14 */
|
||||
{ //U32 const lhc = MEM_readLE32(istart);
|
||||
lhSize = 4;
|
||||
{ lhSize = 4;
|
||||
litSize = (lhc >> 4) & 0x3FFF;
|
||||
litCSize = lhc >> 18;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
/* 2 - 2 - 18 - 18 */
|
||||
{ //U32 const lhc = MEM_readLE32(istart);
|
||||
lhSize = 5;
|
||||
{ lhSize = 5;
|
||||
litSize = (lhc >> 4) & 0x3FFFF;
|
||||
litCSize = (lhc >> 22) + (istart[4] << 10);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user