Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
06e27ef7
Commit
06e27ef7
authored
May 22, 1998
by
Andrew Tridgell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fix redefinition of MAX
- fix shadow of variable "overflow"
parent
23e43fce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
trees.c
zlib/trees.c
+8
-6
No files found.
zlib/trees.c
View file @
06e27ef7
...
...
@@ -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
o
verflow
=
0
;
/* number of elements with bit length too large */
int
O
verflow
=
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
,
o
verflow
++
;
if
(
bits
>
max_length
)
bits
=
max_length
,
O
verflow
++
;
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
(
o
verflow
==
0
)
return
;
if
(
O
verflow
==
0
)
return
;
Trace
((
stderr
,
"
\n
bit 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]
*/
o
verflow
-=
2
;
}
while
(
o
verflow
>
0
);
O
verflow
-=
2
;
}
while
(
O
verflow
>
0
);
/* Now recompute all bit lengths, scanning in increasing frequency.
* h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment