Use const for static tree descriptions in deflate.

This is in order to permit shared memory for these structures.
This commit is contained in:
Mark Adler 2015-08-15 18:04:50 -07:00
parent 55d98b4c30
commit 82e9dc6093
2 changed files with 4 additions and 4 deletions

View File

@ -83,7 +83,7 @@ typedef struct static_tree_desc_s static_tree_desc;
typedef struct tree_desc_s { typedef struct tree_desc_s {
ct_data *dyn_tree; /* the dynamic tree */ ct_data *dyn_tree; /* the dynamic tree */
int max_code; /* largest code with non zero frequency */ 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; } FAR tree_desc;
typedef ush Pos; typedef ush Pos;

View File

@ -122,13 +122,13 @@ struct static_tree_desc_s {
int max_length; /* max bit length for the codes */ 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}; {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}; {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}; {(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
/* =========================================================================== /* ===========================================================================