From f11afafe234ea45a6d80f8b21df1d603ace4e025 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Tue, 21 Apr 2015 18:31:35 +0100 Subject: [PATCH] Removed LZ4_compress() (obsolete) from lz4 --- lib/lz4.c | 2 +- lib/lz4.h | 2 +- programs/bench.c | 10 +++++----- programs/lz4io.c | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/lz4.c b/lib/lz4.c index 53cd4a9..490f9ce 100644 --- a/lib/lz4.c +++ b/lib/lz4.c @@ -685,7 +685,7 @@ int LZ4_compress_safe(const char* source, char* dest, int inputSize, int maxOutp #if (HEAPMODE) void* ctx = ALLOCATOR(LZ4_STREAMSIZE_U64, 8); /* malloc-calloc aligned on 8-bytes boundaries */ #else - U64 ctx[LZ4_STREAMSIZE_U64] = {0}; /* Ensure data is aligned on 8-bytes boundaries */ + U64 ctx[LZ4_STREAMSIZE_U64]; /* Ensure data is aligned on 8-bytes boundaries */ #endif int result = LZ4_compress_safe_extState(ctx, source, dest, inputSize, maxOutputSize); diff --git a/lib/lz4.h b/lib/lz4.h index 98296e9..cf06a8e 100644 --- a/lib/lz4.h +++ b/lib/lz4.h @@ -302,7 +302,7 @@ int LZ4_decompress_fast_usingDict (const char* source, char* dest, int originalS #endif // LZ4_DEPRECATE_WARNING_DEFBLOCK /* Obsolete compression functions */ -/* These functions are planned to generate warnings by r131 approximately */ +/* These functions are planned to start generate warnings by r131 approximately */ int LZ4_compress (const char* source, char* dest, int sourceSize); int LZ4_compress_limitedOutput (const char* source, char* dest, int sourceSize, int maxOutputSize); int LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize); diff --git a/programs/bench.c b/programs/bench.c index d3b060c..384a425 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -58,9 +58,9 @@ #include "lz4.h" #define COMPRESSOR0 LZ4_compress_local -static int LZ4_compress_local(const char* src, char* dst, int size, int clevel) { (void)clevel; return LZ4_compress(src, dst, size); } +static int LZ4_compress_local(const char* src, char* dst, int srcSize, int dstSize, int clevel) { (void)clevel; return LZ4_compress_safe(src, dst, srcSize, dstSize); } #include "lz4hc.h" -#define COMPRESSOR1 LZ4_compressHC2 +#define COMPRESSOR1 LZ4_compressHC_safe #define DEFAULTCOMPRESSOR COMPRESSOR0 #include "xxhash.h" @@ -121,8 +121,8 @@ struct chunkParameters struct compressionParameters { - int (*compressionFunction)(const char*, char*, int, int); - int (*decompressionFunction)(const char*, char*, int); + int (*compressionFunction)(const char* src, char* dst, int srcSize, int dstSize, int cLevel); + int (*decompressionFunction)(const char* src, char* dst, int dstSize); }; @@ -371,7 +371,7 @@ int BMK_benchFiles(const char** fileNamesTable, int nbFiles, int cLevel) while(BMK_GetMilliSpan(milliTime) < TIMELOOP) { for (chunkNb=0; chunkNb %.2f%% ", (int)(filesize>>20), (double)compressedfilesize/filesize*100); + DISPLAYUPDATE(2, "\rRead : %i MB ==> %.2f%% ", (int)(filesize>>20), (double)compressedfilesize/filesize*100); /* Write Block */ LZ4IO_writeLE32(out_buff, outSize);