summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-05-22 12:08:49 +0000
committerAndrew Tridgell <tridge@samba.org>1998-05-22 12:08:49 +0000
commit06e27ef78e0348ec7326f1c1c3c1026abac9db42 (patch)
tree949359faa57974c636a40552d708ec3e98ff9fd1
parent23e43fceeb918374e99005c7d1553ded436d6bab (diff)
downloadrsync-06e27ef78e0348ec7326f1c1c3c1026abac9db42.tar.gz
rsync-06e27ef78e0348ec7326f1c1c3c1026abac9db42.tar.bz2
rsync-06e27ef78e0348ec7326f1c1c3c1026abac9db42.zip
- fix redefinition of MAX
- fix shadow of variable "overflow"
-rw-r--r--zlib/trees.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/zlib/trees.c b/zlib/trees.c
index ef310437..41b7fe8f 100644
--- a/zlib/trees.c
+++ b/zlib/trees.c
@@ -230,7 +230,9 @@ local void send_bits(s, value, length)
#endif /* DEBUG */
-#define MAX(a,b) (a >= b ? a : b)
+#ifndef MAX
+#define MAX(a,b) ((a) >= (b) ? (a) : (b))
+#endif
/* the arguments must not have side effects */
/* ===========================================================================
@@ -497,7 +499,7 @@ local void gen_bitlen(s, desc)
int bits; /* bit length */
int xbits; /* extra bits */
ush f; /* frequency */
- int overflow = 0; /* number of elements with bit length too large */
+ int Overflow = 0; /* number of elements with bit length too large */
for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
@@ -509,7 +511,7 @@ local void gen_bitlen(s, desc)
for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
n = s->heap[h];
bits = tree[tree[n].Dad].Len + 1;
- if (bits > max_length) bits = max_length, overflow++;
+ if (bits > max_length) bits = max_length, Overflow++;
tree[n].Len = (ush)bits;
/* We overwrite tree[n].Dad which is no longer needed */
@@ -522,7 +524,7 @@ local void gen_bitlen(s, desc)
s->opt_len += (ulg)f * (bits + xbits);
if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
}
- if (overflow == 0) return;
+ if (Overflow == 0) return;
Trace((stderr,"\nbit length overflow\n"));
/* This happens for example on obj2 and pic of the Calgary corpus */
@@ -537,8 +539,8 @@ local void gen_bitlen(s, desc)
/* The brother of the overflow item also moves one step up,
* but this does not affect bl_count[max_length]
*/
- overflow -= 2;
- } while (overflow > 0);
+ Overflow -= 2;
+ } while (Overflow > 0);
/* Now recompute all bit lengths, scanning in increasing frequency.
* h is still equal to HEAP_SIZE. (It is simpler to reconstruct all