-# ################################################################
+# ##########################################################################
# LZ4 programs - Makefile
# Copyright (C) Yann Collet 2011-2014
# GPL v2 License
# You can contact the author at :
# - LZ4 source repository : http://code.google.com/p/lz4/
# - LZ4 forum froup : https://groups.google.com/forum/#!forum/lz4c
-# ################################################################
+# ##########################################################################
# lz4 : Command Line Utility, supporting gzip-like arguments
# lz4c : CLU, supporting also legacy lz4demo arguments
# lz4c32: Same as lz4c, but forced to compile in 32-bits mode
# fuzzer32: Same as fuzzer, but forced to compile in 32-bits mode
# fullbench : Precisely measure speed for each LZ4 function variant
# fullbench32: Same as fullbench, but forced to compile in 32-bits mode
-# ################################################################
+# ##########################################################################
RELEASE=rc120
DESTDIR=
PREFIX=/usr
CC:=$(CC)
-CFLAGS+= -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION=\"$(RELEASE)\"
+CFLAGS+= -std=c99 -O3 -Wall -Wextra -Wundef -Wshadow -DLZ4_VERSION=\"$(RELEASE)\"
FLAGS= -I.. $(CFLAGS)
BINDIR=$(PREFIX)/bin
//**************************************
static int displayLevel = 0; // 0 : no display // 1: errors // 2 : + result + interaction + warnings ; // 3 : + progression; // 4 : + information
static int overwrite = 1;
-static int blockSizeId = LZ4S_BLOCKSIZEID_DEFAULT;
+static int globalBlockSizeId = LZ4S_BLOCKSIZEID_DEFAULT;
static int blockChecksum = 0;
static int streamChecksum = 1;
static int blockIndependence = 1;
{
static const int blockSizeTable[] = { 64 KB, 256 KB, 1 MB, 4 MB };
if ((bsid < minBlockSizeID) || (bsid > maxBlockSizeID)) return -1;
- blockSizeId = bsid;
- return blockSizeTable[blockSizeId-minBlockSizeID];
+ globalBlockSizeId = bsid;
+ return blockSizeTable[globalBlockSizeId-minBlockSizeID];
}
char* out_buff;
FILE* finput;
FILE* foutput;
- int displayLevel = (compressionlevel>0);
clock_t start, end;
size_t sizeCheck;
}
get_fileHandle(input_filename, output_filename, &finput, &foutput);
- blockSize = LZ4S_GetBlockSize_FromBlockId (blockSizeId);
+ blockSize = LZ4S_GetBlockSize_FromBlockId (globalBlockSizeId);
// Allocate Memory
inputBufferSize = 64 KB + blockSize;
*(out_buff+4) |= (blockIndependence & _1BIT) << 5;
*(out_buff+4) |= (blockChecksum & _1BIT) << 4;
*(out_buff+4) |= (streamChecksum & _1BIT) << 2;
- *(out_buff+5) = (char)((blockSizeId & _3BITS) << 4);
+ *(out_buff+5) = (char)((globalBlockSizeId & _3BITS) << 4);
checkbits = XXH32((out_buff+4), 2, LZ4S_CHECKSUM_SEED);
checkbits = LZ4S_GetCheckBits_FromXXH(checkbits);
*(out_buff+6) = (unsigned char) checkbits;
if (compressionLevel <= 3) compressionFunction = LZ4_compress_limitedOutput_local;
else { compressionFunction = LZ4_compressHC2_limitedOutput; }
get_fileHandle(input_filename, output_filename, &finput, &foutput);
- blockSize = LZ4S_GetBlockSize_FromBlockId (blockSizeId);
+ blockSize = LZ4S_GetBlockSize_FromBlockId (globalBlockSizeId);
// Allocate Memory
in_buff = (char*)malloc(blockSize);
*(headerBuffer+4) |= (blockIndependence & _1BIT) << 5;
*(headerBuffer+4) |= (blockChecksum & _1BIT) << 4;
*(headerBuffer+4) |= (streamChecksum & _1BIT) << 2;
- *(headerBuffer+5) = (char)((blockSizeId & _3BITS) << 4);
+ *(headerBuffer+5) = (char)((globalBlockSizeId & _3BITS) << 4);
checkbits = XXH32((headerBuffer+4), 2, LZ4S_CHECKSUM_SEED);
checkbits = LZ4S_GetCheckBits_FromXXH(checkbits);
*(headerBuffer+6) = (unsigned char) checkbits;