]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added a few comments for clarifications
authorYann Collet <cyan@fb.com>
Fri, 26 Oct 2018 22:21:52 +0000 (15:21 -0700)
committerYann Collet <cyan@fb.com>
Fri, 26 Oct 2018 22:21:52 +0000 (15:21 -0700)
lib/compress/zstd_compress_internal.h
lib/decompress/zstd_decompress_block.c
lib/decompress/zstd_decompress_block.h

index 43f7c1486a9c8d850e21802f2500738c956e089b..ec38e5d4b781075a2190355fcb239cfd3f65fb12 100644 (file)
@@ -139,7 +139,7 @@ struct ZSTD_matchState_t {
     U32* hashTable3;
     U32* chainTable;
     optState_t opt;         /* optimal parser state */
-    const ZSTD_matchState_t *dictMatchState;
+    const ZSTD_matchState_t * dictMatchState;
     ZSTD_compressionParameters cParams;
 };
 
index abfb82119a2828791d9d5aa6a0d9a121985d46f9..652ddd19489245fe04df3c392ecf61e047c46407 100644 (file)
@@ -323,7 +323,9 @@ static void ZSTD_buildSeqTable_rle(ZSTD_seqSymbol* dt, U32 baseValue, U32 nbAddB
 
 
 /* ZSTD_buildFSETable() :
- * generate FSE decoding table for one symbol (ll, ml or off) */
+ * generate FSE decoding table for one symbol (ll, ml or off)
+ * cannot fail if input is valid =>
+ * all inputs are presumed validated at this stage */
 void
 ZSTD_buildFSETable(ZSTD_seqSymbol* dt,
             const short* normalizedCounter, unsigned maxSymbolValue,
index 4b1cf23713490fedad3df810f067b0629c04565f..7e929604102319a338df136c923c45e16947c70b 100644 (file)
@@ -18,6 +18,7 @@
 #include <stddef.h>   /* size_t */
 #include "zstd.h"    /* DCtx, and some public functions */
 #include "zstd_internal.h"  /* blockProperties_t, and some public functions */
+#include "zstd_decompress_internal.h"  /* ZSTD_seqSymbol */
 
 
 /* ===   Prototypes   === */
@@ -44,7 +45,10 @@ size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,
 
 /* ZSTD_buildFSETable() :
  * generate FSE decoding table for one symbol (ll, ml or off)
- * this function cannot fail
+ * this function must be called with valid parameters only
+ * (dt is large enough, normalizedCounter distribution total is a power of 2, max is within range, etc.)
+ * in which case it cannot fail.
+ * Internal use only.
  */
 void ZSTD_buildFSETable(ZSTD_seqSymbol* dt,
              const short* normalizedCounter, unsigned maxSymbolValue,