From: Hans Kristian Rosbach Date: Thu, 16 Jul 2026 17:35:50 +0000 (+0200) Subject: Minor style cleanup of zng_length_code and zng_dist_code X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5ef78e87c3a3b02ea7774579db82d4700dd033a;p=thirdparty%2Fzlib-ng.git Minor style cleanup of zng_length_code and zng_dist_code --- diff --git a/deflate_p.h b/deflate_p.h index 18c8b6780..ba9c1eb9f 100644 --- a/deflate_p.h +++ b/deflate_p.h @@ -58,8 +58,8 @@ Z_INTERNAL void PREFIX(flush_pending)(PREFIX3(stream) *strm); * the current block must be flushed. */ -extern const unsigned char Z_INTERNAL zng_length_code[]; -extern const unsigned char Z_INTERNAL zng_dist_code[]; +extern Z_INTERNAL const unsigned char zng_length_code[]; +extern Z_INTERNAL const unsigned char zng_dist_code[]; static inline int zng_tr_tally_lit(deflate_state *s, unsigned char c) { /* c is the unmatched char */ diff --git a/trees_emit.h b/trees_emit.h index 5ba70254e..5f073714d 100644 --- a/trees_emit.h +++ b/trees_emit.h @@ -14,8 +14,8 @@ extern Z_INTERNAL const ct_data static_ltree[L_CODES+2]; extern Z_INTERNAL const ct_data static_dtree[D_CODES]; -extern const unsigned char Z_INTERNAL zng_dist_code[DIST_CODE_LEN]; -extern const unsigned char Z_INTERNAL zng_length_code[STD_MAX_MATCH-STD_MIN_MATCH+1]; +extern Z_INTERNAL const unsigned char zng_dist_code[DIST_CODE_LEN]; +extern Z_INTERNAL const unsigned char zng_length_code[STD_MAX_MATCH-STD_MIN_MATCH+1]; /* Combined mask + extra_bits tables for single-lookup optimization */ extern Z_INTERNAL const uint16_t lmask_extra[LENGTH_CODES]; diff --git a/trees_tbl.h b/trees_tbl.h index 7771cfb2f..7a249ccd5 100644 --- a/trees_tbl.h +++ b/trees_tbl.h @@ -73,7 +73,7 @@ Z_INTERNAL const ct_data static_dtree[D_CODES] = { {{19},{5}}, {{11},{5}}, {{27},{5}}, {{ 7},{5}}, {{23},{5}} }; -const unsigned char Z_INTERNAL zng_dist_code[DIST_CODE_LEN] = { +Z_INTERNAL const unsigned char zng_dist_code[DIST_CODE_LEN] = { 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, @@ -102,7 +102,7 @@ const unsigned char Z_INTERNAL zng_dist_code[DIST_CODE_LEN] = { 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 }; -const unsigned char Z_INTERNAL zng_length_code[STD_MAX_MATCH-STD_MIN_MATCH+1] = { +Z_INTERNAL const unsigned char zng_length_code[STD_MAX_MATCH-STD_MIN_MATCH+1] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, diff --git a/utils/maketrees.c b/utils/maketrees.c index 00e01a7c8..57c7968e9 100644 --- a/utils/maketrees.c +++ b/utils/maketrees.c @@ -116,12 +116,12 @@ static void gen_trees_header(void) { printf("{{%2u},{%u}}%s", static_dtree[i].Code, static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5)); } - printf("const unsigned char Z_INTERNAL zng_dist_code[DIST_CODE_LEN] = {\n"); + printf("Z_INTERNAL const unsigned char zng_dist_code[DIST_CODE_LEN] = {\n"); for (i = 0; i < DIST_CODE_LEN; i++) { printf("%2u%s", dist_code[i], SEPARATOR(i, DIST_CODE_LEN-1, 20)); } - printf("const unsigned char Z_INTERNAL zng_length_code[STD_MAX_MATCH-STD_MIN_MATCH+1] = {\n"); + printf("Z_INTERNAL const unsigned char zng_length_code[STD_MAX_MATCH-STD_MIN_MATCH+1] = {\n"); for (i = 0; i < STD_MAX_MATCH-STD_MIN_MATCH+1; i++) { printf("%2u%s", length_code[i], SEPARATOR(i, STD_MAX_MATCH-STD_MIN_MATCH, 20)); }