aboutsummaryrefslogtreecommitdiff
path: root/trees.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:17:33 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:17:33 -0700
commit7850e4e406dce1f7a819297eeb151d1ca18e7cd9 (patch)
treed4befddacae46b06c4924193904de533099610b4 /trees.c
parentebd3c2c0e734fc99a1360014ea52ed04fe6aade4 (diff)
downloadzlib-7850e4e406dce1f7a819297eeb151d1ca18e7cd9.tar.gz
zlib-7850e4e406dce1f7a819297eeb151d1ca18e7cd9.tar.bz2
zlib-7850e4e406dce1f7a819297eeb151d1ca18e7cd9.zip
zlib 1.0.7v1.0.7
Diffstat (limited to 'trees.c')
-rw-r--r--trees.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/trees.c b/trees.c
index 4c4d6f2..fe86c77 100644
--- a/trees.c
+++ b/trees.c
@@ -1,5 +1,5 @@
1/* trees.c -- output deflated data using Huffman coding 1/* trees.c -- output deflated data using Huffman coding
2 * Copyright (C) 1995-1996 Jean-loup Gailly 2 * Copyright (C) 1995-1998 Jean-loup Gailly
3 * For conditions of distribution and use, see copyright notice in zlib.h 3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */ 4 */
5 5
@@ -29,7 +29,7 @@
29 * Addison-Wesley, 1983. ISBN 0-201-06672-6. 29 * Addison-Wesley, 1983. ISBN 0-201-06672-6.
30 */ 30 */
31 31
32/* $Id: trees.c,v 1.11 1996/07/24 13:41:06 me Exp $ */ 32/* @(#) $Id$ */
33 33
34#include "deflate.h" 34#include "deflate.h"
35 35
@@ -56,16 +56,16 @@
56#define REPZ_11_138 18 56#define REPZ_11_138 18
57/* repeat a zero length 11-138 times (7 bits of repeat count) */ 57/* repeat a zero length 11-138 times (7 bits of repeat count) */
58 58
59local int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ 59local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
60 = {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}; 60 = {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};
61 61
62local int extra_dbits[D_CODES] /* extra bits for each distance code */ 62local const int extra_dbits[D_CODES] /* extra bits for each distance code */
63 = {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}; 63 = {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};
64 64
65local int extra_blbits[BL_CODES]/* extra bits for each bit length code */ 65local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
66 = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; 66 = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
67 67
68local uch bl_order[BL_CODES] 68local const uch bl_order[BL_CODES]
69 = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; 69 = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
70/* The lengths of the bit length codes are sent in order of decreasing 70/* The lengths of the bit length codes are sent in order of decreasing
71 * probability, to avoid transmitting the lengths for unused bit length codes. 71 * probability, to avoid transmitting the lengths for unused bit length codes.
@@ -109,7 +109,7 @@ local int base_dist[D_CODES];
109 109
110struct static_tree_desc_s { 110struct static_tree_desc_s {
111 ct_data *static_tree; /* static tree or NULL */ 111 ct_data *static_tree; /* static tree or NULL */
112 intf *extra_bits; /* extra bits for each code or NULL */ 112 const intf *extra_bits; /* extra bits for each code or NULL */
113 int extra_base; /* base index for extra_bits */ 113 int extra_base; /* base index for extra_bits */
114 int elems; /* max number of elements in the tree */ 114 int elems; /* max number of elements in the tree */
115 int max_length; /* max bit length for the codes */ 115 int max_length; /* max bit length for the codes */
@@ -154,7 +154,7 @@ local void copy_block OF((deflate_state *s, charf *buf, unsigned len,
154 154
155#else /* DEBUG */ 155#else /* DEBUG */
156# define send_code(s, c, tree) \ 156# define send_code(s, c, tree) \
157 { if (verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ 157 { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
158 send_bits(s, tree[c].Code, tree[c].Len); } 158 send_bits(s, tree[c].Code, tree[c].Len); }
159#endif 159#endif
160 160
@@ -416,7 +416,7 @@ local void gen_bitlen(s, desc)
416 ct_data *tree = desc->dyn_tree; 416 ct_data *tree = desc->dyn_tree;
417 int max_code = desc->max_code; 417 int max_code = desc->max_code;
418 ct_data *stree = desc->stat_desc->static_tree; 418 ct_data *stree = desc->stat_desc->static_tree;
419 intf *extra = desc->stat_desc->extra_bits; 419 const intf *extra = desc->stat_desc->extra_bits;
420 int base = desc->stat_desc->extra_base; 420 int base = desc->stat_desc->extra_base;
421 int max_length = desc->stat_desc->max_length; 421 int max_length = desc->stat_desc->max_length;
422 int h; /* heap index */ 422 int h; /* heap index */