]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
minor comments clarifications
authorYann Collet <yann.collet.73@gmail.com>
Tue, 19 Jul 2016 13:06:55 +0000 (15:06 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Wed, 20 Jul 2016 11:35:14 +0000 (13:35 +0200)
NEWS
lib/common/entropy_common.c
lib/compress/fse_compress.c
lib/legacy/zstd_v02.c
lib/zstd.h

diff --git a/NEWS b/NEWS
index e3dd19102fcc2ad4f710cce059c83bb5f3b616fe..50aadcbdb6e0d3afb8c99bdc4371e44625607844 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,12 @@
 v0.7.5
 Fixed : premature end of frame when zero-sized raw block, reported by Eric Biggers
+Fixed : legacy mode with ZSTD_HEAPMODE=0, by Christopher Bergqvist
 Modified : minor compression level adaptations
 Update : specification, to v0.1.2 : max huffman depth at 11 bits
 changed : zstd.h moved to /lib directory
 
 v0.7.4
-Added : homebrew for Mac
+Added : homebrew for Mac, by Daniel Cade
 Added : more examples
 Fixed : segfault when using small dictionaries, reported by Felix Handte
 Modified : default compression level for CLI is now 3
index b42acb4a3ca717329d4caa4599ef9533928ccb07..ae6a2fb96ff448b377d2723f89ab922ca41774ce 100644 (file)
@@ -63,7 +63,7 @@ const char* HUF_getErrorName(size_t code) { return ERR_getErrorName(code); }
 /*-**************************************************************
 *  FSE NCount encoding-decoding
 ****************************************************************/
-static short FSE_abs(short a) { return a<0 ? -a : a; }
+static short FSE_abs(short a) { return (short)(a<0 ? -a : a); }
 
 size_t FSE_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,
                  const void* headerBuffer, size_t hbSize)
index 192d55026d38a70a63b648738c265e63d52284cf..386b2c01085b56f5af937d50bf15f714c8860910 100644 (file)
@@ -190,7 +190,7 @@ size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog)
     return maxSymbolValue ? maxHeaderSize : FSE_NCOUNTBOUND;  /* maxSymbolValue==0 ? use default */
 }
 
-static short FSE_abs(short a) { return a<0 ? -a : a; }
+static short FSE_abs(short a) { return (short)(a<0 ? -a : a); }
 
 static size_t FSE_writeNCount_generic (void* header, size_t headerBufferSize,
                                        const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog,
index 89501111edd94740b7a20f292ce37591fe3dca4d..2d4cfa59c43a10a55d5e5defa95977c425f443b0 100644 (file)
@@ -1350,7 +1350,7 @@ static unsigned FSE_isError(size_t code) { return ERR_isError(code); }
 ****************************************************************/
 static short FSE_abs(short a)
 {
-    return a<0 ? -a : a;
+    return (short)(a<0 ? -a : a);
 }
 
 static size_t FSE_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,
index c5efa5d31cc62f00a491d0adc8c6577740b6ffea..36935f77cea235307702d9f5953b1bea11a06244 100644 (file)
@@ -72,7 +72,7 @@ ZSTDLIB_API unsigned ZSTD_versionNumber (void);
 /*! ZSTD_compress() :
     Compresses `src` buffer into already allocated `dst`.
     Hint : compression runs faster if `dstCapacity` >=  `ZSTD_compressBound(srcSize)`.
-    @return : the number of bytes written into `dst`,
+    @return : the number of bytes written into `dst` (<= `dstCapacity),
               or an error code if it fails (which can be tested using ZSTD_isError()) */
 ZSTDLIB_API size_t ZSTD_compress( void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize,
@@ -80,7 +80,9 @@ ZSTDLIB_API size_t ZSTD_compress( void* dst, size_t dstCapacity,
 
 /*! ZSTD_getDecompressedSize() :
 *   @return : decompressed size if known, 0 otherwise.
-       note : if `0`, follow up with ZSTD_getFrameParams() to know precise failure cause */
+       note 1 : if `0`, follow up with ZSTD_getFrameParams() to know precise failure cause.
+       note 2 : decompressed size could be wrong or intentionally modified !
+                always ensure results fit within application's authorized limits */
 unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
 
 /*! ZSTD_decompress() :
@@ -106,7 +108,7 @@ ZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx(void);
 ZSTDLIB_API size_t     ZSTD_freeCCtx(ZSTD_CCtx* cctx);      /*!< @return : errorCode */
 
 /** ZSTD_compressCCtx() :
-    Same as ZSTD_compress(), but requires an allocated ZSTD_CCtx (see ZSTD_createCCtx()) */
+    Same as ZSTD_compress(), requires an allocated ZSTD_CCtx (see ZSTD_createCCtx()) */
 ZSTDLIB_API size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel);
 
 /** Decompression context */
@@ -115,7 +117,7 @@ ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx(void);
 ZSTDLIB_API size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);      /*!< @return : errorCode */
 
 /** ZSTD_decompressDCtx() :
-*   Same as ZSTD_decompress(), but requires an allocated ZSTD_DCtx (see ZSTD_createDCtx()) */
+*   Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx (see ZSTD_createDCtx()) */
 ZSTDLIB_API size_t ZSTD_decompressDCtx(ZSTD_DCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
 
 
@@ -439,14 +441,13 @@ ZSTDLIB_API size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t ds
       + ZSTD_decompressBlock() doesn't accept uncompressed data as input !!!
       + In case of multiple successive blocks, decoder must be informed of uncompressed block existence to follow proper history.
         Use ZSTD_insertBlock() in such a case.
-        Insert block once it's copied into its final position.
 */
 
 #define ZSTD_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
 ZSTDLIB_API size_t ZSTD_getBlockSizeMax(ZSTD_CCtx* cctx);
 ZSTDLIB_API size_t ZSTD_compressBlock  (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
 ZSTDLIB_API size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
-ZSTDLIB_API size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize);  /**< insert block into `dctx` history. Useful to track uncompressed blocks */
+ZSTDLIB_API size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize);  /**< insert block into `dctx` history. Useful for uncompressed blocks */
 
 
 #endif   /* ZSTD_STATIC_LINKING_ONLY */