From: Mark Adler Date: Sun, 16 Aug 2015 01:04:50 +0000 (-0700) Subject: Use const for static tree descriptions in deflate. X-Git-Tag: 1.9.9-b1~793^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7e045e8ad125e99965fd2873fa7898fe3c2d649;p=thirdparty%2Fzlib-ng.git Use const for static tree descriptions in deflate. This is in order to permit shared memory for these structures. Conflicts: deflate.h --- diff --git a/deflate.h b/deflate.h index fedb29eac..c6ce02466 100644 --- 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 e7b45bb0e..ab47326f1 100644 --- 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}; /* ===========================================================================