]> git.lizzy.rs Git - zlib.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)
committerMark Adler <madler@alumni.caltech.edu>
Sun, 16 Aug 2015 01:04:50 +0000 (18:04 -0700)
This is in order to permit shared memory for these structures.

deflate.h
trees.c

index 8440790195b476e42fdf111db99128d7c4c2401c..f18c616c1fa6b7b3a7d84b544ae06bc8f36858c5 100644 (file)
--- a/deflate.h
+++ b/deflate.h
@@ -83,7 +83,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 */
 } FAR tree_desc;
 
 typedef ush Pos;
diff --git a/trees.c b/trees.c
index ad3762823945f0e865c086046e0d4e73c6500d54..445371693dc45dcd4e56ae9ce51e7d6feef3cb46 100644 (file)
--- a/trees.c
+++ b/trees.c
@@ -122,13 +122,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};
 
 /* ===========================================================================