From 899f0720ec732e74741f8cbe76bfc3bd7a264cf7 Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Tue, 25 Aug 2020 19:46:15 -0700 Subject: Renamed trees_p.h to trees.h. --- CMakeLists.txt | 4 ++-- tools/maketrees.c | 2 +- trees.c | 2 +- trees.h | 40 ++++++++++++++++++++++++++++++++++++++++ trees_emit.h | 2 +- trees_p.h | 40 ---------------------------------------- 6 files changed, 45 insertions(+), 45 deletions(-) create mode 100644 trees.h delete mode 100644 trees_p.h diff --git a/CMakeLists.txt b/CMakeLists.txt index dd2bccb6c8..5a58e7fc28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -835,9 +835,9 @@ set(ZLIB_PRIVATE_HDRS inftrees.h insert_string_tpl.h match_tpl.h - trees_tbl.h + trees.h trees_emit.h - trees_p.h + trees_tbl.h zbuild.h zendian.h zutil.h diff --git a/tools/maketrees.c b/tools/maketrees.c index c60cc130ab..00b7c833d1 100644 --- a/tools/maketrees.c +++ b/tools/maketrees.c @@ -6,7 +6,7 @@ #include #include "zbuild.h" #include "deflate.h" -#include "trees_p.h" +#include "trees.h" static ct_data static_ltree[L_CODES+2]; /* The static literal tree. Since the bit lengths are imposed, there is no diff --git a/trees.c b/trees.c index f02853a079..47734f3082 100644 --- a/trees.c +++ b/trees.c @@ -32,7 +32,7 @@ #include "zbuild.h" #include "deflate.h" -#include "trees_p.h" +#include "trees.h" #include "trees_emit.h" #include "trees_tbl.h" diff --git a/trees.h b/trees.h new file mode 100644 index 0000000000..e57f926489 --- /dev/null +++ b/trees.h @@ -0,0 +1,40 @@ +#ifndef TREES_H_ +#define TREES_H_ + +/* Constants */ + +#define DIST_CODE_LEN 512 +/* see definition of array dist_code in trees.c */ + +#define MAX_BL_BITS 7 +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +#define REP_3_6 16 +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +#define REPZ_3_10 17 +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +#define REPZ_11_138 18 +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +static const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ + = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; + +static const int extra_dbits[D_CODES] /* extra bits for each distance code */ + = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + +static const int extra_blbits[BL_CODES] /* extra bits for each bit length code */ + = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; + +static const unsigned char bl_order[BL_CODES] + = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; + /* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + + +/* Function definitions */ +void gen_codes (ct_data *tree, int max_code, uint16_t *bl_count); + +#endif diff --git a/trees_emit.h b/trees_emit.h index dfce22bfc0..452fad6c71 100644 --- a/trees_emit.h +++ b/trees_emit.h @@ -2,7 +2,7 @@ #define TREES_EMIT_H_ #include "zbuild.h" -#include "trees_p.h" +#include "trees.h" #ifdef ZLIB_DEBUG # include diff --git a/trees_p.h b/trees_p.h deleted file mode 100644 index 13c0b16a16..0000000000 --- a/trees_p.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef TREES_P_H_ -#define TREES_P_H_ - -/* Constants */ - -#define DIST_CODE_LEN 512 -/* see definition of array dist_code in trees.c */ - -#define MAX_BL_BITS 7 -/* Bit length codes must not exceed MAX_BL_BITS bits */ - -#define REP_3_6 16 -/* repeat previous bit length 3-6 times (2 bits of repeat count) */ - -#define REPZ_3_10 17 -/* repeat a zero length 3-10 times (3 bits of repeat count) */ - -#define REPZ_11_138 18 -/* repeat a zero length 11-138 times (7 bits of repeat count) */ - -static const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ - = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; - -static const int extra_dbits[D_CODES] /* extra bits for each distance code */ - = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; - -static const int extra_blbits[BL_CODES] /* extra bits for each bit length code */ - = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; - -static const unsigned char bl_order[BL_CODES] - = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; - /* The lengths of the bit length codes are sent in order of decreasing - * probability, to avoid transmitting the lengths for unused bit length codes. - */ - - -/* Function definitions */ -void gen_codes (ct_data *tree, int max_code, uint16_t *bl_count); - -#endif -- cgit 0.0.5-2-1-g0f52