From 19e585cc462759427f8d125fca3278b8762b3099 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Wed, 29 Jun 2016 18:18:34 +0200 Subject: modified : some more deprecated functions from lz4hc.h generate warnings --- lib/lz4.h | 5 ++++- lib/lz4hc.h | 59 ++++++++++++++++++++++++++++------------------------- programs/.gitignore | 3 +++ 3 files changed, 38 insertions(+), 29 deletions(-) diff --git a/lib/lz4.h b/lib/lz4.h index e173e81..9146178 100644 --- a/lib/lz4.h +++ b/lib/lz4.h @@ -32,7 +32,8 @@ - LZ4 homepage : http://www.lz4.org - LZ4 source repository : https://github.com/Cyan4973/lz4 */ -#pragma once +#ifndef LZ4_H_2983827168210 +#define LZ4_H_2983827168210 #if defined (__cplusplus) extern "C" { @@ -360,3 +361,5 @@ LZ4_DEPRECATED("use LZ4_decompress_fast_usingDict() instead") int LZ4_decompress #if defined (__cplusplus) } #endif + +#endif /* LZ4_H_2983827168210 */ diff --git a/lib/lz4hc.h b/lib/lz4hc.h index 431f7c8..da40e05 100644 --- a/lib/lz4hc.h +++ b/lib/lz4hc.h @@ -31,45 +31,44 @@ - LZ4 source repository : https://github.com/Cyan4973/lz4 - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c */ -#pragma once +#ifndef LZ4_HC_H_19834876238432 +#define LZ4_HC_H_19834876238432 #if defined (__cplusplus) extern "C" { #endif -/***************************** +/*-*************************** * Includes *****************************/ #include /* size_t */ -/************************************** +/*-************************************ * Block Compression **************************************/ -int LZ4_compress_HC (const char* src, char* dst, int srcSize, int maxDstSize, int compressionLevel); -/* -LZ4_compress_HC : - Destination buffer 'dst' must be already allocated. - Compression completion is guaranteed if 'dst' buffer is sized to handle worst circumstances (data not compressible) +/*! +LZ4_compress_HC() : + Destination buffer `dst` must be already allocated. + Compression success is guaranteed if `dst` buffer is sized to handle worst circumstances (data not compressible) Worst size evaluation is provided by function LZ4_compressBound() (see "lz4.h") - srcSize : Max supported value is LZ4_MAX_INPUT_SIZE (see "lz4.h") - compressionLevel : Recommended values are between 4 and 9, although any value between 0 and 16 will work. - 0 means "use default value" (see lz4hc.c). - Values >16 behave the same as 16. - return : the number of bytes written into buffer 'dst' - or 0 if compression fails. + `srcSize` : Max supported value is LZ4_MAX_INPUT_SIZE (see "lz4.h") + `compressionLevel` : Recommended values are between 4 and 9, although any value between 0 and 16 will work. + 0 means "use default value" (see lz4hc.c). + Values >16 behave the same as 16. + @return : the number of bytes written into buffer 'dst' + or 0 if compression fails. */ +int LZ4_compress_HC (const char* src, char* dst, int srcSize, int maxDstSize, int compressionLevel); /* Note : - Decompression functions are provided within LZ4 source code (see "lz4.h") (BSD license) + Decompression functions are provided within "lz4.h" (BSD license) */ -int LZ4_sizeofStateHC(void); -int LZ4_compress_HC_extStateHC(void* state, const char* src, char* dst, int srcSize, int maxDstSize, int compressionLevel); -/* +/*! LZ4_compress_HC_extStateHC() : Use this function if you prefer to manually allocate memory for compression tables. To know how much memory must be allocated for the compression tables, use : @@ -81,9 +80,11 @@ LZ4_compress_HC_extStateHC() : LZ4_compress_HC_extStateHC() is equivalent to previously described function. It just uses externally allocated memory for stateHC. */ +int LZ4_compress_HC_extStateHC(void* state, const char* src, char* dst, int srcSize, int maxDstSize, int compressionLevel); +int LZ4_sizeofStateHC(void); -/************************************** +/*-************************************ * Streaming Compression **************************************/ #define LZ4_STREAMHCSIZE 262192 @@ -137,7 +138,7 @@ int LZ4_saveDictHC (LZ4_streamHC_t* streamHCPtr, char* safeBuffer, int maxDictSi -/************************************** +/*-************************************ * Deprecated Functions **************************************/ /* Deprecate Warnings */ @@ -159,22 +160,22 @@ int LZ4_saveDictHC (LZ4_streamHC_t* streamHCPtr, char* safeBuffer, int maxDictSi # pragma message("WARNING: You need to implement LZ4_DEPRECATED for this compiler") # define LZ4_DEPRECATED(message) # endif -#endif // LZ4_DEPRECATE_WARNING_DEFBLOCK +#endif /* LZ4_DEPRECATE_WARNING_DEFBLOCK */ -/* compression functions */ -/* these functions are planned to trigger warning messages by r131 approximately */ +/* deprecated compression functions */ +/* these functions will trigger warning messages in future releases */ int LZ4_compressHC (const char* source, char* dest, int inputSize); int LZ4_compressHC_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize); -int LZ4_compressHC2 (const char* source, char* dest, int inputSize, int compressionLevel); -int LZ4_compressHC2_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_compress_HC() instead") int LZ4_compressHC2 (const char* source, char* dest, int inputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_compress_HC() instead") int LZ4_compressHC2_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); int LZ4_compressHC_withStateHC (void* state, const char* source, char* dest, int inputSize); int LZ4_compressHC_limitedOutput_withStateHC (void* state, const char* source, char* dest, int inputSize, int maxOutputSize); -int LZ4_compressHC2_withStateHC (void* state, const char* source, char* dest, int inputSize, int compressionLevel); -int LZ4_compressHC2_limitedOutput_withStateHC(void* state, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") int LZ4_compressHC2_withStateHC (void* state, const char* source, char* dest, int inputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") int LZ4_compressHC2_limitedOutput_withStateHC(void* state, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); int LZ4_compressHC_continue (LZ4_streamHC_t* LZ4_streamHCPtr, const char* source, char* dest, int inputSize); int LZ4_compressHC_limitedOutput_continue (LZ4_streamHC_t* LZ4_streamHCPtr, const char* source, char* dest, int inputSize, int maxOutputSize); -/* Streaming functions following the older model; should no longer be used */ +/* Deprecated Streaming functions using older model; should no longer be used */ LZ4_DEPRECATED("use LZ4_createStreamHC() instead") void* LZ4_createHC (char* inputBuffer); LZ4_DEPRECATED("use LZ4_saveDictHC() instead") char* LZ4_slideInputBufferHC (void* LZ4HC_Data); LZ4_DEPRECATED("use LZ4_freeStreamHC() instead") int LZ4_freeHC (void* LZ4HC_Data); @@ -187,3 +188,5 @@ LZ4_DEPRECATED("use LZ4_resetStreamHC() instead") int LZ4_resetStreamStateHC( #if defined (__cplusplus) } #endif + +#endif /* LZ4_HC_H_19834876238432 */ diff --git a/programs/.gitignore b/programs/.gitignore index 418f49c..7110922 100644 --- a/programs/.gitignore +++ b/programs/.gitignore @@ -4,8 +4,11 @@ lz4c lz4c32 datagen frametest +frametest32 fullbench +fullbench32 fuzzer +fuzzer32 *.exe # tests files -- cgit v0.12