1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-16 12:14:18 +02:00

fixed conversion warnings

This commit is contained in:
Yann Collet
2016-07-22 04:45:06 +02:00
parent ae68f8ddb3
commit 32faf6c8e7
4 changed files with 26 additions and 23 deletions

View File

@ -575,11 +575,11 @@ static size_t ZSTD_noCompressLiterals (void* dst, size_t dstCapacity, const void
ostart[0] = (BYTE)((U32)lbt_raw + (srcSize<<3));
break;
case 2: /* 2 - 2 - 12 */
MEM_writeLE16(ostart, (U32)lbt_raw + (1<<2) + (srcSize<<4));
MEM_writeLE16(ostart, (U16)((U32)lbt_raw + (1<<2) + (srcSize<<4)));
break;
default: /*note : should not be necessary : flSize is within {1,2,3} */
case 3: /* 2 - 2 - 20 */
MEM_writeLE32(ostart, (U32)lbt_raw + (3<<2) + (srcSize<<4));
MEM_writeLE32(ostart, (U32)((U32)lbt_raw + (3<<2) + (srcSize<<4)));
break;
}
@ -600,11 +600,11 @@ static size_t ZSTD_compressRleLiteralsBlock (void* dst, size_t dstCapacity, cons
ostart[0] = (BYTE)((U32)lbt_rle + (srcSize<<3));
break;
case 2: /* 2 - 2 - 12 */
MEM_writeLE16(ostart, (U32)lbt_rle + (1<<2) + (srcSize<<4));
MEM_writeLE16(ostart, (U16)((U32)lbt_rle + (1<<2) + (srcSize<<4)));
break;
default: /*note : should not be necessary : flSize is necessarily within {1,2,3} */
case 3: /* 2 - 2 - 20 */
MEM_writeLE32(ostart, (U32)lbt_rle + (3<<2) + (srcSize<<4));
MEM_writeLE32(ostart, (U32)((U32)lbt_rle + (3<<2) + (srcSize<<4)));
break;
}
@ -652,18 +652,18 @@ static size_t ZSTD_compressLiterals (ZSTD_CCtx* zc,
switch(lhSize)
{
case 3: /* 2 - 2 - 10 - 10 */
{ U32 const lhc = hType + (singleStream << 2) + (srcSize<<4) + (cLitSize<<14);
{ U32 const lhc = hType + (singleStream << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<14);
MEM_writeLE24(ostart, lhc);
break;
}
case 4: /* 2 - 2 - 14 - 14 */
{ U32 const lhc = hType + (2 << 2) + (srcSize<<4) + (cLitSize<<18);
{ U32 const lhc = hType + (2 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<18);
MEM_writeLE32(ostart, lhc);
break;
}
default: /* should not be necessary, lhSize is only {3,4,5} */
case 5: /* 2 - 2 - 18 - 18 */
{ U32 const lhc = hType + (3 << 2) + (srcSize<<4) + (cLitSize<<22);
{ U32 const lhc = hType + (3 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<22);
MEM_writeLE32(ostart, lhc);
ostart[4] = (BYTE)(cLitSize >> 10);
break;