summaryrefslogtreecommitdiff
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 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 @@
/* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2002 Jean-loup Gailly
+ * Copyright (C) 1995-2003 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -230,7 +230,6 @@ local void send_bits(s, value, length)
#endif /* DEBUG */
-#define MAX(a,b) (a >= b ? a : b)
/* the arguments must not have side effects */
/* ===========================================================================
@@ -675,7 +674,8 @@ local void build_tree(s, desc)
/* Create a new node father of n and m */
tree[node].Freq = tree[n].Freq + tree[m].Freq;
- s->depth[node] = (uch) (MAX(s->depth[n], s->depth[m]) + 1);
+ s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
+ s->depth[n] : s->depth[m]) + 1);
tree[n].Dad = tree[m].Dad = (ush)node;
#ifdef DUMP_BL_TREE
if (tree == s->bl_tree) {
@@ -950,7 +950,7 @@ void _tr_flush_block(s, buf, stored_len, eof)
*/
max_blindex = build_bl_tree(s);
- /* Determine the best encoding. Compute first the block length in bytes*/
+ /* Determine the best encoding. Compute the block lengths in bytes. */
opt_lenb = (s->opt_len+3+7)>>3;
static_lenb = (s->static_len+3+7)>>3;