fix minor compilation condition

harness.c is not designed to pass  -Wdeclaration-after-statement
This commit is contained in:
Yann Collet 2019-09-06 16:51:16 -07:00
parent 2b0a271ed2
commit a3815d233c
3 changed files with 5 additions and 4 deletions

View File

@ -6,10 +6,10 @@ CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
-I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
CFLAGS ?= -O3 CFLAGS ?= -O3
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
-Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ -Wstrict-aliasing=1 -Wswitch-enum \
-Wstrict-prototypes -Wundef \ -Wredundant-decls -Wstrict-prototypes -Wundef \
-Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
-Wredundant-decls -std=c99
CFLAGS += $(DEBUGFLAGS) CFLAGS += $(DEBUGFLAGS)
CFLAGS += $(MOREFLAGS) CFLAGS += $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MULTITHREAD_LDFLAGS) FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MULTITHREAD_LDFLAGS)

View File

@ -33,7 +33,7 @@ size_t read_file(const char *path, u8 **ptr) {
} }
fseek(f, 0L, SEEK_END); fseek(f, 0L, SEEK_END);
size_t size = ftell(f); size_t size = (size_t)ftell(f);
rewind(f); rewind(f);
*ptr = malloc(size); *ptr = malloc(size);

View File

@ -833,6 +833,7 @@ static size_t decode_literals_compressed(frame_context_t *const ctx,
// bits (0-1023)." // bits (0-1023)."
num_streams = 1; num_streams = 1;
// Fall through as it has the same size format // Fall through as it has the same size format
/* fallthrough */
case 1: case 1:
// "4 streams. Both Compressed_Size and Regenerated_Size use 10 bits // "4 streams. Both Compressed_Size and Regenerated_Size use 10 bits
// (0-1023)." // (0-1023)."