Fixed minor clang warnings

This commit is contained in:
Yann Collet 2015-07-07 00:14:27 -08:00
parent 7083b8a54a
commit 17867ced03
3 changed files with 4 additions and 3 deletions

View File

@ -456,7 +456,7 @@ static unsigned ZSTD_NbCommonBytes (register size_t val)
_BitScanReverse( &r, (unsigned long)val ); _BitScanReverse( &r, (unsigned long)val );
return (unsigned)(r>>3); return (unsigned)(r>>3);
# elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT) # elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT)
return (__builtin_clz(val) >> 3); return (__builtin_clz((U32)val) >> 3);
# else # else
unsigned r; unsigned r;
if (!(val>>16)) { r=2; val>>=8; } else { r=0; val>>=24; } if (!(val>>16)) { r=2; val>>=8; } else { r=0; val>>=24; }

View File

@ -36,7 +36,8 @@ DESTDIR?=
PREFIX ?= /usr PREFIX ?= /usr
CFLAGS ?= -O3 CFLAGS ?= -O3
CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -DZSTD_VERSION=\"$(RELEASE)\" CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -DZSTD_VERSION=\"$(RELEASE)\"
FLAGS = -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) LDFLAGS = -I../lib
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MOREFLAGS)
BINDIR=$(PREFIX)/bin BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/share/man/man1 MANDIR=$(PREFIX)/share/man/man1

View File

@ -174,7 +174,7 @@ int main(int argc, char** argv)
char extension[] = ZSTD_EXTENSION; char extension[] = ZSTD_EXTENSION;
/* Pick out basename component. Don't rely on stdlib because of conflicting behaviour. */ /* Pick out basename component. Don't rely on stdlib because of conflicting behaviour. */
for (i = strlen(programName); i > 0; i--) for (i = (int)strlen(programName); i > 0; i--)
{ {
if (programName[i] == '/') if (programName[i] == '/')
{ {