Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
18e5275f
Commit
18e5275f
authored
May 29, 2003
by
Steven Cole
Committed by
Linus Torvalds
May 29, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] K&R to ANSI C conversions for zlib
Here are some more K&R to ANSI C conversions.
parent
84bc69a1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
212 additions
and
167 deletions
+212
-167
arch/ppc/boot/lib/zlib.c
arch/ppc/boot/lib/zlib.c
+98
-76
arch/ppc64/boot/zlib.c
arch/ppc64/boot/zlib.c
+98
-76
lib/zlib_deflate/deflate.c
lib/zlib_deflate/deflate.c
+16
-15
No files found.
arch/ppc/boot/lib/zlib.c
View file @
18e5275f
...
@@ -299,8 +299,9 @@ struct internal_state {
...
@@ -299,8 +299,9 @@ struct internal_state {
};
};
int
inflateReset
(
z
)
int
inflateReset
(
z_stream
*
z
;
z_stream
*
z
)
{
{
uLong
c
;
uLong
c
;
...
@@ -387,9 +388,10 @@ z_stream *z;
...
@@ -387,9 +388,10 @@ z_stream *z;
#define NEEDBYTE {if(z->avail_in==0)goto empty;r=Z_OK;}
#define NEEDBYTE {if(z->avail_in==0)goto empty;r=Z_OK;}
#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
int
inflate
(
z
,
f
)
int
inflate
(
z_stream
*
z
;
z_stream
*
z
,
int
f
;
int
f
)
{
{
int
r
;
int
r
;
uInt
b
;
uInt
b
;
...
@@ -504,8 +506,9 @@ int f;
...
@@ -504,8 +506,9 @@ int f;
* will have been updated if need be.
* will have been updated if need be.
*/
*/
int
inflateIncomp
(
z
)
int
inflateIncomp
(
z_stream
*
z
;
z_stream
*
z
)
{
{
if
(
z
->
state
->
mode
!=
BLOCKS
)
if
(
z
->
state
->
mode
!=
BLOCKS
)
return
Z_DATA_ERROR
;
return
Z_DATA_ERROR
;
...
@@ -513,8 +516,9 @@ z_stream *z;
...
@@ -513,8 +516,9 @@ z_stream *z;
}
}
int
inflateSync
(
z
)
int
inflateSync
(
z_stream
*
z
;
z_stream
*
z
)
{
{
uInt
n
;
/* number of bytes to look at */
uInt
n
;
/* number of bytes to look at */
Bytef
*
p
;
/* pointer to bytes */
Bytef
*
p
;
/* pointer to bytes */
...
@@ -737,10 +741,11 @@ local uInt border[] = { /* Order of the bit length code lengths */
...
@@ -737,10 +741,11 @@ local uInt border[] = { /* Order of the bit length code lengths */
*/
*/
local
void
inflate_blocks_reset
(
s
,
z
,
c
)
local
void
inflate_blocks_reset
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
,
uLongf
*
c
;
uLongf
*
c
)
{
{
if
(
s
->
checkfn
!=
Z_NULL
)
if
(
s
->
checkfn
!=
Z_NULL
)
*
c
=
s
->
check
;
*
c
=
s
->
check
;
...
@@ -762,10 +767,11 @@ uLongf *c;
...
@@ -762,10 +767,11 @@ uLongf *c;
}
}
local
inflate_blocks_statef
*
inflate_blocks_new
(
z
,
c
,
w
)
local
inflate_blocks_statef
*
inflate_blocks_new
(
z_stream
*
z
;
z_stream
*
z
,
check_func
c
;
check_func
c
,
uInt
w
;
uInt
w
)
{
{
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
;
...
@@ -786,10 +792,11 @@ uInt w;
...
@@ -786,10 +792,11 @@ uInt w;
}
}
local
int
inflate_blocks
(
s
,
z
,
r
)
local
int
inflate_blocks
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
,
int
r
;
int
r
)
{
{
uInt
t
;
/* temporary storage */
uInt
t
;
/* temporary storage */
uLong
b
;
/* bit buffer */
uLong
b
;
/* bit buffer */
...
@@ -1049,10 +1056,11 @@ int r;
...
@@ -1049,10 +1056,11 @@ int r;
}
}
local
int
inflate_blocks_free
(
s
,
z
,
c
)
local
int
inflate_blocks_free
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
,
uLongf
*
c
;
uLongf
*
c
)
{
{
inflate_blocks_reset
(
s
,
z
,
c
);
inflate_blocks_reset
(
s
,
z
,
c
);
ZFREE
(
z
,
s
->
window
,
s
->
end
-
s
->
window
);
ZFREE
(
z
,
s
->
window
,
s
->
end
-
s
->
window
);
...
@@ -1069,9 +1077,10 @@ uLongf *c;
...
@@ -1069,9 +1077,10 @@ uLongf *c;
* BLOCKS). On exit, the output will also be caught up, and the checksum
* BLOCKS). On exit, the output will also be caught up, and the checksum
* will have been updated if need be.
* will have been updated if need be.
*/
*/
local
int
inflate_addhistory
(
s
,
z
)
local
int
inflate_addhistory
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
)
{
{
uLong
b
;
/* bit buffer */
/* NOT USED HERE */
uLong
b
;
/* bit buffer */
/* NOT USED HERE */
uInt
k
;
/* bits in bit buffer */
/* NOT USED HERE */
uInt
k
;
/* bits in bit buffer */
/* NOT USED HERE */
...
@@ -1220,15 +1229,16 @@ local uInt cpdext[] = { /* Extra bits for distance codes */
...
@@ -1220,15 +1229,16 @@ local uInt cpdext[] = { /* Extra bits for distance codes */
uInt
inflate_hufts
;
uInt
inflate_hufts
;
#endif
#endif
local
int
huft_build
(
b
,
n
,
s
,
d
,
e
,
t
,
m
,
zs
)
local
int
huft_build
(
uIntf
*
b
;
/* code lengths in bits (all assumed <= BMAX) */
uIntf
*
b
,
/* code lengths in bits (all assumed <= BMAX) */
uInt
n
;
/* number of codes (assumed <= N_MAX) */
uInt
n
,
/* number of codes (assumed <= N_MAX) */
uInt
s
;
/* number of simple-valued codes (0..s-1) */
uInt
s
,
/* number of simple-valued codes (0..s-1) */
uIntf
*
d
;
/* list of base values for non-simple codes */
uIntf
*
d
,
/* list of base values for non-simple codes */
uIntf
*
e
;
/* list of extra bits for non-simple codes */
uIntf
*
e
,
/* list of extra bits for non-simple codes */
inflate_huft
*
FAR
*
t
;
/* result: starting table */
inflate_huft
*
FAR
*
t
,
/* result: starting table */
uIntf
*
m
;
/* maximum lookup bits, returns actual */
uIntf
*
m
,
/* maximum lookup bits, returns actual */
z_stream
*
zs
;
/* for zalloc function */
z_stream
*
zs
/* for zalloc function */
)
/* Given a list of code lengths and a maximum table size, make a set of
/* Given a list of code lengths and a maximum table size, make a set of
tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
if the given code set is incomplete (the tables are still built in this
if the given code set is incomplete (the tables are still built in this
...
@@ -1423,11 +1433,12 @@ z_stream *zs; /* for zalloc function */
...
@@ -1423,11 +1433,12 @@ z_stream *zs; /* for zalloc function */
}
}
local
int
inflate_trees_bits
(
c
,
bb
,
tb
,
z
)
local
int
inflate_trees_bits
(
uIntf
*
c
;
/* 19 code lengths */
uIntf
*
c
,
/* 19 code lengths */
uIntf
*
bb
;
/* bits tree desired/actual depth */
uIntf
*
bb
,
/* bits tree desired/actual depth */
inflate_huft
*
FAR
*
tb
;
/* bits tree result */
inflate_huft
*
FAR
*
tb
,
/* bits tree result */
z_stream
*
z
;
/* for zfree function */
z_stream
*
z
/* for zfree function */
)
{
{
int
r
;
int
r
;
...
@@ -1444,15 +1455,16 @@ z_stream *z; /* for zfree function */
...
@@ -1444,15 +1455,16 @@ z_stream *z; /* for zfree function */
}
}
local
int
inflate_trees_dynamic
(
nl
,
nd
,
c
,
bl
,
bd
,
tl
,
td
,
z
)
local
int
inflate_trees_dynamic
(
uInt
nl
;
/* number of literal/length codes */
uInt
nl
,
/* number of literal/length codes */
uInt
nd
;
/* number of distance codes */
uInt
nd
,
/* number of distance codes */
uIntf
*
c
;
/* that many (total) code lengths */
uIntf
*
c
,
/* that many (total) code lengths */
uIntf
*
bl
;
/* literal desired/actual bit depth */
uIntf
*
bl
,
/* literal desired/actual bit depth */
uIntf
*
bd
;
/* distance desired/actual bit depth */
uIntf
*
bd
,
/* distance desired/actual bit depth */
inflate_huft
*
FAR
*
tl
;
/* literal/length tree result */
inflate_huft
*
FAR
*
tl
,
/* literal/length tree result */
inflate_huft
*
FAR
*
td
;
/* distance tree result */
inflate_huft
*
FAR
*
td
,
/* distance tree result */
z_stream
*
z
;
/* for zfree function */
z_stream
*
z
/* for zfree function */
)
{
{
int
r
;
int
r
;
...
@@ -1529,11 +1541,12 @@ uInt n;
...
@@ -1529,11 +1541,12 @@ uInt n;
}
}
local
int
inflate_trees_fixed
(
bl
,
bd
,
tl
,
td
)
local
int
inflate_trees_fixed
(
uIntf
*
bl
;
/* literal desired/actual bit depth */
uIntf
*
bl
,
/* literal desired/actual bit depth */
uIntf
*
bd
;
/* distance desired/actual bit depth */
uIntf
*
bd
,
/* distance desired/actual bit depth */
inflate_huft
*
FAR
*
tl
;
/* literal/length tree result */
inflate_huft
*
FAR
*
tl
,
/* literal/length tree result */
inflate_huft
*
FAR
*
td
;
/* distance tree result */
inflate_huft
*
FAR
*
td
/* distance tree result */
)
{
{
/* build fixed tables if not built already--lock out other instances */
/* build fixed tables if not built already--lock out other instances */
while
(
++
fixed_lock
>
1
)
while
(
++
fixed_lock
>
1
)
...
@@ -1651,10 +1664,13 @@ struct inflate_codes_state {
...
@@ -1651,10 +1664,13 @@ struct inflate_codes_state {
};
};
local
inflate_codes_statef
*
inflate_codes_new
(
bl
,
bd
,
tl
,
td
,
z
)
local
inflate_codes_statef
*
inflate_codes_new
(
uInt
bl
,
bd
;
uInt
bl
,
inflate_huft
*
tl
,
*
td
;
uInt
bd
,
z_stream
*
z
;
inflate_huft
*
tl
,
inflate_huft
*
td
,
z_stream
*
z
)
{
{
inflate_codes_statef
*
c
;
inflate_codes_statef
*
c
;
...
@@ -1672,10 +1688,11 @@ z_stream *z;
...
@@ -1672,10 +1688,11 @@ z_stream *z;
}
}
local
int
inflate_codes
(
s
,
z
,
r
)
local
int
inflate_codes
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
,
int
r
;
int
r
)
{
{
uInt
j
;
/* temporary storage */
uInt
j
;
/* temporary storage */
inflate_huft
*
t
;
/* temporary pointer */
inflate_huft
*
t
;
/* temporary pointer */
...
@@ -1832,9 +1849,10 @@ int r;
...
@@ -1832,9 +1849,10 @@ int r;
}
}
local
void
inflate_codes_free
(
c
,
z
)
local
void
inflate_codes_free
(
inflate_codes_statef
*
c
;
inflate_codes_statef
*
c
,
z_stream
*
z
;
z_stream
*
z
)
{
{
ZFREE
(
z
,
c
,
sizeof
(
struct
inflate_codes_state
));
ZFREE
(
z
,
c
,
sizeof
(
struct
inflate_codes_state
));
Tracev
((
stderr
,
"inflate: codes free
\n
"
));
Tracev
((
stderr
,
"inflate: codes free
\n
"
));
...
@@ -1847,10 +1865,11 @@ z_stream *z;
...
@@ -1847,10 +1865,11 @@ z_stream *z;
*/
*/
/* copy as much as possible from the sliding window to the output area */
/* copy as much as possible from the sliding window to the output area */
local
int
inflate_flush
(
s
,
z
,
r
)
local
int
inflate_flush
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
,
int
r
;
int
r
)
{
{
uInt
n
;
uInt
n
;
Bytef
*
p
,
*
q
;
Bytef
*
p
,
*
q
;
...
@@ -1934,11 +1953,14 @@ int r;
...
@@ -1934,11 +1953,14 @@ int r;
at least ten. The ten bytes are six bytes for the longest length/
at least ten. The ten bytes are six bytes for the longest length/
distance pair plus four bytes for overloading the bit buffer. */
distance pair plus four bytes for overloading the bit buffer. */
local
int
inflate_fast
(
bl
,
bd
,
tl
,
td
,
s
,
z
)
local
int
inflate_fast
(
uInt
bl
,
bd
;
uInt
bl
,
inflate_huft
*
tl
,
*
td
;
uInt
bd
,
inflate_blocks_statef
*
s
;
inflate_huft
*
tl
,
z_stream
*
z
;
inflate_huft
*
td
,
inflate_blocks_statef
*
s
,
z_stream
*
z
)
{
{
inflate_huft
*
t
;
/* temporary pointer */
inflate_huft
*
t
;
/* temporary pointer */
uInt
e
;
/* extra bits or operation */
uInt
e
;
/* extra bits or operation */
...
...
arch/ppc64/boot/zlib.c
View file @
18e5275f
...
@@ -322,8 +322,9 @@ struct internal_state {
...
@@ -322,8 +322,9 @@ struct internal_state {
};
};
int
inflateReset
(
z
)
int
inflateReset
(
z_stream
*
z
;
z_stream
*
z
)
{
{
uLong
c
;
uLong
c
;
...
@@ -410,9 +411,10 @@ z_stream *z;
...
@@ -410,9 +411,10 @@ z_stream *z;
#define NEEDBYTE {if(z->avail_in==0)goto empty;r=Z_OK;}
#define NEEDBYTE {if(z->avail_in==0)goto empty;r=Z_OK;}
#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
int
inflate
(
z
,
f
)
int
inflate
(
z_stream
*
z
;
z_stream
*
z
,
int
f
;
int
f
)
{
{
int
r
;
int
r
;
uInt
b
;
uInt
b
;
...
@@ -527,8 +529,9 @@ int f;
...
@@ -527,8 +529,9 @@ int f;
* will have been updated if need be.
* will have been updated if need be.
*/
*/
int
inflateIncomp
(
z
)
int
inflateIncomp
(
z_stream
*
z
;
z_stream
*
z
)
{
{
if
(
z
->
state
->
mode
!=
BLOCKS
)
if
(
z
->
state
->
mode
!=
BLOCKS
)
return
Z_DATA_ERROR
;
return
Z_DATA_ERROR
;
...
@@ -536,8 +539,9 @@ z_stream *z;
...
@@ -536,8 +539,9 @@ z_stream *z;
}
}
int
inflateSync
(
z
)
int
inflateSync
(
z_stream
*
z
;
z_stream
*
z
)
{
{
uInt
n
;
/* number of bytes to look at */
uInt
n
;
/* number of bytes to look at */
Bytef
*
p
;
/* pointer to bytes */
Bytef
*
p
;
/* pointer to bytes */
...
@@ -760,10 +764,11 @@ local uInt border[] = { /* Order of the bit length code lengths */
...
@@ -760,10 +764,11 @@ local uInt border[] = { /* Order of the bit length code lengths */
*/
*/
local
void
inflate_blocks_reset
(
s
,
z
,
c
)
local
void
inflate_blocks_reset
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
,
uLongf
*
c
;
uLongf
*
c
)
{
{
if
(
s
->
checkfn
!=
Z_NULL
)
if
(
s
->
checkfn
!=
Z_NULL
)
*
c
=
s
->
check
;
*
c
=
s
->
check
;
...
@@ -785,10 +790,11 @@ uLongf *c;
...
@@ -785,10 +790,11 @@ uLongf *c;
}
}
local
inflate_blocks_statef
*
inflate_blocks_new
(
z
,
c
,
w
)
local
inflate_blocks_statef
*
inflate_blocks_new
(
z_stream
*
z
;
z_stream
*
z
,
check_func
c
;
check_func
c
,
uInt
w
;
uInt
w
)
{
{
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
;
...
@@ -809,10 +815,11 @@ uInt w;
...
@@ -809,10 +815,11 @@ uInt w;
}
}
local
int
inflate_blocks
(
s
,
z
,
r
)
local
int
inflate_blocks
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
,
int
r
;
int
r
)
{
{
uInt
t
;
/* temporary storage */
uInt
t
;
/* temporary storage */
uLong
b
;
/* bit buffer */
uLong
b
;
/* bit buffer */
...
@@ -1072,10 +1079,11 @@ int r;
...
@@ -1072,10 +1079,11 @@ int r;
}
}
local
int
inflate_blocks_free
(
s
,
z
,
c
)
local
int
inflate_blocks_free
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
,
uLongf
*
c
;
uLongf
*
c
)
{
{
inflate_blocks_reset
(
s
,
z
,
c
);
inflate_blocks_reset
(
s
,
z
,
c
);
ZFREE
(
z
,
s
->
window
,
s
->
end
-
s
->
window
);
ZFREE
(
z
,
s
->
window
,
s
->
end
-
s
->
window
);
...
@@ -1092,9 +1100,10 @@ uLongf *c;
...
@@ -1092,9 +1100,10 @@ uLongf *c;
* BLOCKS). On exit, the output will also be caught up, and the checksum
* BLOCKS). On exit, the output will also be caught up, and the checksum
* will have been updated if need be.
* will have been updated if need be.
*/
*/
local
int
inflate_addhistory
(
s
,
z
)
local
int
inflate_addhistory
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
)
{
{
uLong
b
;
/* bit buffer */
/* NOT USED HERE */
uLong
b
;
/* bit buffer */
/* NOT USED HERE */
uInt
k
;
/* bits in bit buffer */
/* NOT USED HERE */
uInt
k
;
/* bits in bit buffer */
/* NOT USED HERE */
...
@@ -1243,15 +1252,16 @@ local uInt cpdext[] = { /* Extra bits for distance codes */
...
@@ -1243,15 +1252,16 @@ local uInt cpdext[] = { /* Extra bits for distance codes */
uInt
inflate_hufts
;
uInt
inflate_hufts
;
#endif
#endif
local
int
huft_build
(
b
,
n
,
s
,
d
,
e
,
t
,
m
,
zs
)
local
int
huft_build
(
uIntf
*
b
;
/* code lengths in bits (all assumed <= BMAX) */
uIntf
*
b
,
/* code lengths in bits (all assumed <= BMAX) */
uInt
n
;
/* number of codes (assumed <= N_MAX) */
uInt
n
,
/* number of codes (assumed <= N_MAX) */
uInt
s
;
/* number of simple-valued codes (0..s-1) */
uInt
s
,
/* number of simple-valued codes (0..s-1) */
uIntf
*
d
;
/* list of base values for non-simple codes */
uIntf
*
d
,
/* list of base values for non-simple codes */
uIntf
*
e
;
/* list of extra bits for non-simple codes */
uIntf
*
e
,
/* list of extra bits for non-simple codes */
inflate_huft
*
FAR
*
t
;
/* result: starting table */
inflate_huft
*
FAR
*
t
,
/* result: starting table */
uIntf
*
m
;
/* maximum lookup bits, returns actual */
uIntf
*
m
,
/* maximum lookup bits, returns actual */
z_stream
*
zs
;
/* for zalloc function */
z_stream
*
zs
/* for zalloc function */
)
/* Given a list of code lengths and a maximum table size, make a set of
/* Given a list of code lengths and a maximum table size, make a set of
tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
if the given code set is incomplete (the tables are still built in this
if the given code set is incomplete (the tables are still built in this
...
@@ -1446,11 +1456,12 @@ z_stream *zs; /* for zalloc function */
...
@@ -1446,11 +1456,12 @@ z_stream *zs; /* for zalloc function */
}
}
local
int
inflate_trees_bits
(
c
,
bb
,
tb
,
z
)
local
int
inflate_trees_bits
(
uIntf
*
c
;
/* 19 code lengths */
uIntf
*
c
,
/* 19 code lengths */
uIntf
*
bb
;
/* bits tree desired/actual depth */
uIntf
*
bb
,
/* bits tree desired/actual depth */
inflate_huft
*
FAR
*
tb
;
/* bits tree result */
inflate_huft
*
FAR
*
tb
,
/* bits tree result */
z_stream
*
z
;
/* for zfree function */
z_stream
*
z
/* for zfree function */
)
{
{
int
r
;
int
r
;
...
@@ -1467,15 +1478,16 @@ z_stream *z; /* for zfree function */
...
@@ -1467,15 +1478,16 @@ z_stream *z; /* for zfree function */
}
}
local
int
inflate_trees_dynamic
(
nl
,
nd
,
c
,
bl
,
bd
,
tl
,
td
,
z
)
local
int
inflate_trees_dynamic
(
uInt
nl
;
/* number of literal/length codes */
uInt
nl
,
/* number of literal/length codes */
uInt
nd
;
/* number of distance codes */
uInt
nd
,
/* number of distance codes */
uIntf
*
c
;
/* that many (total) code lengths */
uIntf
*
c
,
/* that many (total) code lengths */
uIntf
*
bl
;
/* literal desired/actual bit depth */
uIntf
*
bl
,
/* literal desired/actual bit depth */
uIntf
*
bd
;
/* distance desired/actual bit depth */
uIntf
*
bd
,
/* distance desired/actual bit depth */
inflate_huft
*
FAR
*
tl
;
/* literal/length tree result */
inflate_huft
*
FAR
*
tl
,
/* literal/length tree result */
inflate_huft
*
FAR
*
td
;
/* distance tree result */
inflate_huft
*
FAR
*
td
,
/* distance tree result */
z_stream
*
z
;
/* for zfree function */
z_stream
*
z
/* for zfree function */
)
{
{
int
r
;
int
r
;
...
@@ -1552,11 +1564,12 @@ uInt n;
...
@@ -1552,11 +1564,12 @@ uInt n;
}
}
local
int
inflate_trees_fixed
(
bl
,
bd
,
tl
,
td
)
local
int
inflate_trees_fixed
(
uIntf
*
bl
;
/* literal desired/actual bit depth */
uIntf
*
bl
,
/* literal desired/actual bit depth */
uIntf
*
bd
;
/* distance desired/actual bit depth */
uIntf
*
bd
,
/* distance desired/actual bit depth */
inflate_huft
*
FAR
*
tl
;
/* literal/length tree result */
inflate_huft
*
FAR
*
tl
,
/* literal/length tree result */
inflate_huft
*
FAR
*
td
;
/* distance tree result */
inflate_huft
*
FAR
*
td
/* distance tree result */
)
{
{
/* build fixed tables if not built already--lock out other instances */
/* build fixed tables if not built already--lock out other instances */
while
(
++
fixed_lock
>
1
)
while
(
++
fixed_lock
>
1
)
...
@@ -1674,10 +1687,13 @@ struct inflate_codes_state {
...
@@ -1674,10 +1687,13 @@ struct inflate_codes_state {
};
};
local
inflate_codes_statef
*
inflate_codes_new
(
bl
,
bd
,
tl
,
td
,
z
)
local
inflate_codes_statef
*
inflate_codes_new
(
uInt
bl
,
bd
;
uInt
bl
,
inflate_huft
*
tl
,
*
td
;
uInt
bd
,
z_stream
*
z
;
inflate_huft
*
tl
,
inflate_huft
*
td
,
z_stream
*
z
)
{
{
inflate_codes_statef
*
c
;
inflate_codes_statef
*
c
;
...
@@ -1695,10 +1711,11 @@ z_stream *z;
...
@@ -1695,10 +1711,11 @@ z_stream *z;
}
}
local
int
inflate_codes
(
s
,
z
,
r
)
local
int
inflate_codes
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
,
int
r
;
int
r
)
{
{
uInt
j
;
/* temporary storage */
uInt
j
;
/* temporary storage */
inflate_huft
*
t
;
/* temporary pointer */
inflate_huft
*
t
;
/* temporary pointer */
...
@@ -1855,9 +1872,10 @@ int r;
...
@@ -1855,9 +1872,10 @@ int r;
}
}
local
void
inflate_codes_free
(
c
,
z
)
local
void
inflate_codes_free
(
inflate_codes_statef
*
c
;
inflate_codes_statef
*
c
,
z_stream
*
z
;
z_stream
*
z
)
{
{
ZFREE
(
z
,
c
,
sizeof
(
struct
inflate_codes_state
));
ZFREE
(
z
,
c
,
sizeof
(
struct
inflate_codes_state
));
Tracev
((
stderr
,
"inflate: codes free
\n
"
));
Tracev
((
stderr
,
"inflate: codes free
\n
"
));
...
@@ -1870,10 +1888,11 @@ z_stream *z;
...
@@ -1870,10 +1888,11 @@ z_stream *z;
*/
*/
/* copy as much as possible from the sliding window to the output area */
/* copy as much as possible from the sliding window to the output area */
local
int
inflate_flush
(
s
,
z
,
r
)
local
int
inflate_flush
(
inflate_blocks_statef
*
s
;
inflate_blocks_statef
*
s
,
z_stream
*
z
;
z_stream
*
z
,
int
r
;
int
r
)
{
{
uInt
n
;
uInt
n
;
Bytef
*
p
,
*
q
;
Bytef
*
p
,
*
q
;
...
@@ -1957,11 +1976,14 @@ int r;
...
@@ -1957,11 +1976,14 @@ int r;
at least ten. The ten bytes are six bytes for the longest length/
at least ten. The ten bytes are six bytes for the longest length/
distance pair plus four bytes for overloading the bit buffer. */
distance pair plus four bytes for overloading the bit buffer. */
local
int
inflate_fast
(
bl
,
bd
,
tl
,
td
,
s
,
z
)
local
int
inflate_fast
(
uInt
bl
,
bd
;
uInt
bl
,
inflate_huft
*
tl
,
*
td
;
uInt
bd
,
inflate_blocks_statef
*
s
;
inflate_huft
*
tl
,
z_stream
*
z
;
inflate_huft
*
td
,
inflate_blocks_statef
*
s
,
z_stream
*
z
)
{
{
inflate_huft
*
t
;
/* temporary pointer */
inflate_huft
*
t
;
/* temporary pointer */
uInt
e
;
/* extra bits or operation */
uInt
e
;
/* extra bits or operation */
...
...
lib/zlib_deflate/deflate.c
View file @
18e5275f
...
@@ -164,11 +164,12 @@ local const config configuration_table[10] = {
...
@@ -164,11 +164,12 @@ local const config configuration_table[10] = {
memset((charf *)s->head, 0, (unsigned)(s->hash_size-1)*sizeof(*s->head));
memset((charf *)s->head, 0, (unsigned)(s->hash_size-1)*sizeof(*s->head));
/* ========================================================================= */
/* ========================================================================= */
int
zlib_deflateInit_
(
strm
,
level
,
version
,
stream_size
)
int
zlib_deflateInit_
(
z_streamp
strm
;
z_streamp
strm
,
int
level
;
int
level
,
const
char
*
version
;
const
char
*
version
,
int
stream_size
;
int
stream_size
)
{
{
return
zlib_deflateInit2_
(
strm
,
level
,
Z_DEFLATED
,
MAX_WBITS
,
return
zlib_deflateInit2_
(
strm
,
level
,
Z_DEFLATED
,
MAX_WBITS
,
DEF_MEM_LEVEL
,
DEF_MEM_LEVEL
,
...
@@ -177,16 +178,16 @@ int zlib_deflateInit_(strm, level, version, stream_size)
...
@@ -177,16 +178,16 @@ int zlib_deflateInit_(strm, level, version, stream_size)
}
}
/* ========================================================================= */
/* ========================================================================= */
int
zlib_deflateInit2_
(
strm
,
level
,
method
,
windowBits
,
memLevel
,
strategy
,
int
zlib_deflateInit2_
(
version
,
stream_size
)
z_streamp
strm
,
z_streamp
strm
;
int
level
,
int
level
;
int
method
,
int
method
;
int
windowBits
,
int
windowBits
;
int
memLevel
,
int
memLevel
;
int
strategy
,
int
strategy
;
const
char
*
version
,
const
char
*
version
;
int
stream_size
int
stream_size
;
)
{
{
deflate_state
*
s
;
deflate_state
*
s
;
int
noheader
=
0
;
int
noheader
=
0
;
...
...
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