]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Use const for static tree descriptions in deflate.
authorMark Adler <madler@alumni.caltech.edu>
Sun, 16 Aug 2015 01:04:50 +0000 (18:04 -0700)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Tue, 3 Nov 2015 18:12:22 +0000 (19:12 +0100)
This is in order to permit shared memory for these structures.

 Conflicts:
deflate.h

deflate.h
trees.c

index fedb29eacbf1c7f3def9bcbf3ee29ee5de7ee1a6..c6ce024668052cffe7af418e5b9818d3bd107bfa 100644 (file)
--- a/deflate.h
+++ b/deflate.h
@@ -89,7 +89,7 @@ typedef struct static_tree_desc_s  static_tree_desc;
 typedef struct tree_desc_s {
     ct_data *dyn_tree;           /* the dynamic tree */
     int     max_code;            /* largest code with non zero frequency */
-    static_tree_desc *stat_desc; /* the corresponding static tree */
+    const static_tree_desc *stat_desc; /* the corresponding static tree */
 } tree_desc;
 
 typedef uint16_t Pos;
diff --git a/trees.c b/trees.c
index e7b45bb0e3078e0ac98eefc284898c388d0275ce..ab47326f1e4887174533093018b64430f0ee8e6f 100644 (file)
--- a/trees.c
+++ b/trees.c
@@ -119,13 +119,13 @@ struct static_tree_desc_s {
     int     max_length;          /* max bit length for the codes */
 };
 
-local static_tree_desc  static_l_desc =
+local const static_tree_desc  static_l_desc =
 {static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
 
-local static_tree_desc  static_d_desc =
+local const static_tree_desc  static_d_desc =
 {static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS};
 
-local static_tree_desc  static_bl_desc =
+local const static_tree_desc  static_bl_desc =
 {(const ct_data *)0, extra_blbits, 0,   BL_CODES, MAX_BL_BITS};
 
 /* ===========================================================================