1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-30 22:23:13 +03:00

Added Wcast-qual compilation flag

Updated xxHash
Removed log traces
This commit is contained in:
Yann Collet
2015-06-20 19:37:53 -08:00
parent fc774d31d1
commit 078a9a2804
3 changed files with 23 additions and 30 deletions

View File

@ -30,12 +30,12 @@
# fullbench32: Same as fullbench, but forced to compile in 32-bits mode
# ##########################################################################
RELEASE?= r1
RELEASE?= v0.0.2
DESTDIR?=
PREFIX ?= /usr
CFLAGS ?= -O3
CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -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)
BINDIR=$(PREFIX)/bin
@ -142,13 +142,14 @@ test-fuzzer32: fuzzer32
./fuzzer32
test-mem: zstd datagen fuzzer fullbench
valgrind --leak-check=yes ./datagen -g50M > /dev/null
@echo "\n ---- valgrind tests : memory analyzer ----"
valgrind --leak-check=yes --error-exitcode=1 ./datagen -g50M > /dev/null
./datagen -g16KB > tmp
valgrind --leak-check=yes ./zstd -vf tmp /dev/null
valgrind --leak-check=yes --error-exitcode=1 ./zstd -vf tmp /dev/null
./datagen -g128MB > tmp
valgrind --leak-check=yes ./zstd -vf tmp /dev/null
valgrind --leak-check=yes --error-exitcode=1 ./zstd -vf tmp /dev/null
@rm tmp
valgrind --leak-check=yes ./fuzzer -i128 -t1
valgrind --leak-check=yes ./fullbench -i1
valgrind --leak-check=yes --error-exitcode=1 ./fuzzer -i128 -t1
valgrind --leak-check=yes --error-exitcode=1 ./fullbench -i1
endif

View File

@ -265,7 +265,6 @@ unsigned long long FIO_compressFilename(const char* output_filename, const char*
/* Fill input Buffer */
if (inSlot + blockSize > inEnd) inSlot = inBuff;
inSize = fread(inSlot, (size_t)1, blockSize, finput);
DISPLAY("Read block of size %u at pos %u \n", (U32)inSize, (U32)(inSlot-inBuff));
if (inSize==0) break;
filesize += inSize;
DISPLAYUPDATE(2, "\rRead : %u MB ", (U32)(filesize>>20));
@ -353,7 +352,6 @@ unsigned long long FIO_decompressFilename(const char* output_filename, const cha
while (toRead)
{
size_t readSize, decodedSize;
static U32 nbReads = 0;
/* Fill input buffer */
readSize = fread(inBuff, 1, toRead, finput);
@ -361,15 +359,11 @@ unsigned long long FIO_decompressFilename(const char* output_filename, const cha
EXM_THROW(34, "Read error");
/* Decode block */
if (nbReads==55)
DISPLAY("!");
decodedSize = ZSTD_decompressContinue(dctx, op, oend-op, inBuff, readSize);
DISPLAY("nbReads : %u \n", nbReads++);
if (decodedSize) /* not a header */
{
/* Write block */
DISPLAY("writing %u bytes from pos %u \n", (U32)decodedSize, (U32)(op-outBuff));
sizeCheck = fwrite(op, 1, decodedSize, foutput);
if (sizeCheck != decodedSize) EXM_THROW(35, "Write error : unable to write data block to destination file");
filesize += decodedSize;