aboutsummaryrefslogtreecommitdiff
path: root/trees.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:21:47 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:21:47 -0700
commit7c2a874e50b871d04fbd19501f7b42cff55e5abc (patch)
tree1879cd29182ababb17cde77cee5ce74505db4006 /trees.c
parenta383133c4e7b93113cee912f213cf9502d785fa7 (diff)
downloadzlib-7c2a874e50b871d04fbd19501f7b42cff55e5abc.tar.gz
zlib-7c2a874e50b871d04fbd19501f7b42cff55e5abc.tar.bz2
zlib-7c2a874e50b871d04fbd19501f7b42cff55e5abc.zip
zlib 1.2.0v1.2.0
Diffstat (limited to 'trees.c')
-rw-r--r--trees.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/trees.c b/trees.c
index 0a98405..f7f4a84 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-2002 Jean-loup Gailly 2 * Copyright (C) 1995-2003 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
@@ -230,7 +230,6 @@ local void send_bits(s, value, length)
230#endif /* DEBUG */ 230#endif /* DEBUG */
231 231
232 232
233#define MAX(a,b) (a >= b ? a : b)
234/* the arguments must not have side effects */ 233/* the arguments must not have side effects */
235 234
236/* =========================================================================== 235/* ===========================================================================
@@ -675,7 +674,8 @@ local void build_tree(s, desc)
675 674
676 /* Create a new node father of n and m */ 675 /* Create a new node father of n and m */
677 tree[node].Freq = tree[n].Freq + tree[m].Freq; 676 tree[node].Freq = tree[n].Freq + tree[m].Freq;
678 s->depth[node] = (uch) (MAX(s->depth[n], s->depth[m]) + 1); 677 s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
678 s->depth[n] : s->depth[m]) + 1);
679 tree[n].Dad = tree[m].Dad = (ush)node; 679 tree[n].Dad = tree[m].Dad = (ush)node;
680#ifdef DUMP_BL_TREE 680#ifdef DUMP_BL_TREE
681 if (tree == s->bl_tree) { 681 if (tree == s->bl_tree) {
@@ -950,7 +950,7 @@ void _tr_flush_block(s, buf, stored_len, eof)
950 */ 950 */
951 max_blindex = build_bl_tree(s); 951 max_blindex = build_bl_tree(s);
952 952
953 /* Determine the best encoding. Compute first the block length in bytes*/ 953 /* Determine the best encoding. Compute the block lengths in bytes. */
954 opt_lenb = (s->opt_len+3+7)>>3; 954 opt_lenb = (s->opt_len+3+7)>>3;
955 static_lenb = (s->static_len+3+7)>>3; 955 static_lenb = (s->static_len+3+7)>>3;
956 956