diff options
Diffstat (limited to 'trees.c')
-rw-r--r-- | trees.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 | ||