some more minor conversion warnings fixes
This commit is contained in:
parent
c5bcb4d68b
commit
76116495bf
2
Makefile
2
Makefile
@ -49,7 +49,7 @@ allmost: lib lz4
|
||||
.PHONY: lib lib-release liblz4.a
|
||||
lib: liblz4.a
|
||||
lib lib-release liblz4.a:
|
||||
@$(MAKE) -C $(LZ4DIR) $@
|
||||
@CFLAGS="$(CFLAGS)" $(MAKE) -C $(LZ4DIR) $@
|
||||
|
||||
.PHONY: lz4 lz4-release
|
||||
lz4 : liblz4.a
|
||||
|
@ -462,7 +462,7 @@ static unsigned LZ4_NbCommonBytes (reg_t val)
|
||||
_BitScanForward64( &r, (U64)val );
|
||||
return (int)(r>>3);
|
||||
# elif (defined(__clang__) || (defined(__GNUC__) && (__GNUC__>=3))) && !defined(LZ4_FORCE_SW_BITCOUNT)
|
||||
return (__builtin_ctzll((U64)val) >> 3);
|
||||
return (unsigned)__builtin_ctzll((U64)val) >> 3;
|
||||
# else
|
||||
static const int DeBruijnBytePos[64] = { 0, 0, 0, 0, 0, 1, 1, 2,
|
||||
0, 3, 1, 3, 1, 4, 2, 7,
|
||||
@ -480,7 +480,7 @@ static unsigned LZ4_NbCommonBytes (reg_t val)
|
||||
_BitScanForward( &r, (U32)val );
|
||||
return (int)(r>>3);
|
||||
# elif (defined(__clang__) || (defined(__GNUC__) && (__GNUC__>=3))) && !defined(LZ4_FORCE_SW_BITCOUNT)
|
||||
return (__builtin_ctz((U32)val) >> 3);
|
||||
return (unsigned)__builtin_ctz((U32)val) >> 3;
|
||||
# else
|
||||
static const int DeBruijnBytePos[32] = { 0, 0, 3, 0, 3, 1, 3, 0,
|
||||
3, 2, 2, 1, 3, 2, 0, 1,
|
||||
@ -496,7 +496,7 @@ static unsigned LZ4_NbCommonBytes (reg_t val)
|
||||
_BitScanReverse64( &r, val );
|
||||
return (unsigned)(r>>3);
|
||||
# elif (defined(__clang__) || (defined(__GNUC__) && (__GNUC__>=3))) && !defined(LZ4_FORCE_SW_BITCOUNT)
|
||||
return (__builtin_clzll((U64)val) >> 3);
|
||||
return (unsigned)__builtin_clzll((U64)val) >> 3;
|
||||
# else
|
||||
static const U32 by32 = sizeof(val)*4; /* 32 on 64 bits (goal), 16 on 32 bits.
|
||||
Just to avoid some static analyzer complaining about shift by 32 on 32-bits target.
|
||||
@ -513,7 +513,7 @@ static unsigned LZ4_NbCommonBytes (reg_t val)
|
||||
_BitScanReverse( &r, (unsigned long)val );
|
||||
return (unsigned)(r>>3);
|
||||
# elif (defined(__clang__) || (defined(__GNUC__) && (__GNUC__>=3))) && !defined(LZ4_FORCE_SW_BITCOUNT)
|
||||
return (__builtin_clz((U32)val) >> 3);
|
||||
return (unsigned)__builtin_clz((U32)val) >> 3;
|
||||
# else
|
||||
unsigned r;
|
||||
if (!(val>>16)) { r=2; val>>=8; } else { r=0; val>>=24; }
|
||||
|
@ -1015,10 +1015,10 @@ static void FUZ_unitTests(int compressionLevel)
|
||||
|
||||
/* in-place compression test */
|
||||
DISPLAYLEVEL(3, "in-place compression using LZ4_compress_default() :");
|
||||
{ size_t const sampleSize = 65 KB;
|
||||
size_t const maxCSize = LZ4_COMPRESSBOUND(sampleSize);
|
||||
size_t const outSize = LZ4_COMPRESS_INPLACE_BUFFER_SIZE(maxCSize);
|
||||
size_t const startIndex = outSize - sampleSize;
|
||||
{ int const sampleSize = 65 KB;
|
||||
int const maxCSize = LZ4_COMPRESSBOUND(sampleSize);
|
||||
int const outSize = LZ4_COMPRESS_INPLACE_BUFFER_SIZE(maxCSize);
|
||||
int const startIndex = outSize - sampleSize;
|
||||
char* const startInput = testCompressed + startIndex;
|
||||
XXH32_hash_t const crcOrig = XXH32(testInput, sampleSize, 0);
|
||||
int cSize;
|
||||
@ -1028,7 +1028,7 @@ static void FUZ_unitTests(int compressionLevel)
|
||||
cSize = LZ4_compress_default(startInput, testCompressed, sampleSize, maxCSize);
|
||||
assert(cSize != 0); /* ensure compression is successful */
|
||||
assert(maxCSize < INT_MAX);
|
||||
assert(cSize <= (int)maxCSize);
|
||||
assert(cSize <= maxCSize);
|
||||
/* decompress and verify */
|
||||
{ int const dSize = LZ4_decompress_safe(testCompressed, testVerify, cSize, testInputSize);
|
||||
assert(dSize == (int)sampleSize); /* correct size */
|
||||
|
Loading…
Reference in New Issue
Block a user