From a3a9b80dffc4d2c8e2496b851f78b78f0948c4bf Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Wed, 21 Mar 2018 11:39:41 -0400 Subject: [PATCH 1/2] Better Describe Functionality of Obsolete Streaming Functions --- lib/lz4.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/lz4.h b/lib/lz4.h index d0ec204..80f040f 100644 --- a/lib/lz4.h +++ b/lib/lz4.h @@ -492,15 +492,19 @@ LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") LZ4LIB_API int LZ4_co LZ4_DEPRECATED("use LZ4_decompress_fast() instead") LZ4LIB_API int LZ4_uncompress (const char* source, char* dest, int outputSize); LZ4_DEPRECATED("use LZ4_decompress_safe() instead") LZ4LIB_API int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize); -/* Broken, obsolete streaming functions; do not use! +/* Obsolete streaming functions; degraded functionality; do not use! * - * These functions depended on data that is no longer tracked in the state. They - * are therefore broken--they don't retain any history across compressions. + * In order to perform streaming compression, these functions depended on data + * that is no longer tracked in the state. They have been preserved as well as + * possible: using them will still produce a correct output. However, they don't + * actually retain any history between compression calls. The compression ratio + * achieved will therefore be no better than compressing each chunk + * independently. */ -LZ4_DEPRECATED("Broken!!! Use LZ4_createStream() instead") LZ4LIB_API void* LZ4_create (char* inputBuffer); +LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API void* LZ4_create (char* inputBuffer); LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API int LZ4_sizeofStreamState(void); -LZ4_DEPRECATED("Broken!!! Use LZ4_resetStream() instead") LZ4LIB_API int LZ4_resetStreamState(void* state, char* inputBuffer); -LZ4_DEPRECATED("Broken!!! Use LZ4_saveDict() instead") LZ4LIB_API char* LZ4_slideInputBuffer (void* state); +LZ4_DEPRECATED("Use LZ4_resetStream() instead") LZ4LIB_API int LZ4_resetStreamState(void* state, char* inputBuffer); +LZ4_DEPRECATED("Use LZ4_saveDict() instead") LZ4LIB_API char* LZ4_slideInputBuffer (void* state); /* Obsolete streaming decoding functions */ LZ4_DEPRECATED("use LZ4_decompress_safe_usingDict() instead") LZ4LIB_API int LZ4_decompress_safe_withPrefix64k (const char* src, char* dst, int compressedSize, int maxDstSize); From 126f18d3e09d92c06d06d33d9cb7a1ec51962525 Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Wed, 21 Mar 2018 11:48:35 -0400 Subject: [PATCH 2/2] Also Fix a Comment --- lib/lz4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lz4.c b/lib/lz4.c index 37782f5..0fdbe5e 100644 --- a/lib/lz4.c +++ b/lib/lz4.c @@ -1722,7 +1722,7 @@ void* LZ4_create (char* inputBuffer) char* LZ4_slideInputBuffer (void* state) { - // avoid const char * -> char * conversion warning + /* avoid const char * -> char * conversion warning */ return (char *)(uptrval)((LZ4_stream_t*)state)->internal_donotuse.dictionary; }