summaryrefslogtreecommitdiff
path: root/infblock.c
diff options
context:
space:
mode:
Diffstat (limited to 'infblock.c')
-rw-r--r--infblock.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/infblock.c b/infblock.c
index 04a5653..1fc0726 100644
--- a/infblock.c
+++ b/infblock.c
@@ -62,9 +62,9 @@ local uInt border[] = { /* Order of the bit length code lengths */
62 62
63 63
64void inflate_blocks_reset(s, z, c) 64void inflate_blocks_reset(s, z, c)
65struct inflate_blocks_state *s; 65inflate_blocks_statef *s;
66z_stream *z; 66z_stream *z;
67uLong *c; 67uLongf *c;
68{ 68{
69 if (s->checkfn != Z_NULL) 69 if (s->checkfn != Z_NULL)
70 *c = s->check; 70 *c = s->check;
@@ -86,17 +86,17 @@ uLong *c;
86} 86}
87 87
88 88
89struct inflate_blocks_state *inflate_blocks_new(z, c, w) 89inflate_blocks_statef *inflate_blocks_new(z, c, w)
90z_stream *z; 90z_stream *z;
91check_func c; 91check_func c;
92uInt w; 92uInt w;
93{ 93{
94 struct inflate_blocks_state *s; 94 inflate_blocks_statef *s;
95 95
96 if ((s = (struct inflate_blocks_state *)ZALLOC 96 if ((s = (inflate_blocks_statef *)ZALLOC
97 (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL) 97 (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
98 return s; 98 return s;
99 if ((s->window = (Byte *)ZALLOC(z, 1, w)) == Z_NULL) 99 if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
100 { 100 {
101 ZFREE(z, s); 101 ZFREE(z, s);
102 return Z_NULL; 102 return Z_NULL;
@@ -111,16 +111,16 @@ uInt w;
111 111
112 112
113int inflate_blocks(s, z, r) 113int inflate_blocks(s, z, r)
114struct inflate_blocks_state *s; 114inflate_blocks_statef *s;
115z_stream *z; 115z_stream *z;
116int r; 116int r;
117{ 117{
118 uInt t; /* temporary storage */ 118 uInt t; /* temporary storage */
119 uLong b; /* bit buffer */ 119 uLong b; /* bit buffer */
120 uInt k; /* bits in bit buffer */ 120 uInt k; /* bits in bit buffer */
121 Byte *p; /* input data pointer */ 121 Bytef *p; /* input data pointer */
122 uInt n; /* bytes available there */ 122 uInt n; /* bytes available there */
123 Byte *q; /* output window write pointer */ 123 Bytef *q; /* output window write pointer */
124 uInt m; /* bytes to end of window or read pointer */ 124 uInt m; /* bytes to end of window or read pointer */
125 125
126 /* copy input/output information to locals (UPDATE macro restores) */ 126 /* copy input/output information to locals (UPDATE macro restores) */
@@ -179,7 +179,7 @@ int r;
179 break; 179 break;
180 case LENS: 180 case LENS:
181 NEEDBITS(32) 181 NEEDBITS(32)
182 if ((~b) >> 16 != (b & 0xffff)) 182 if (((~b) >> 16) != (b & 0xffff))
183 { 183 {
184 s->mode = BAD; 184 s->mode = BAD;
185 z->msg = "invalid stored block lengths"; 185 z->msg = "invalid stored block lengths";
@@ -223,7 +223,7 @@ int r;
223 t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); 223 t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
224 if (t < 19) 224 if (t < 19)
225 t = 19; 225 t = 19;
226 if ((s->sub.trees.blens = (uInt*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL) 226 if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
227 { 227 {
228 r = Z_MEM_ERROR; 228 r = Z_MEM_ERROR;
229 LEAVE 229 LEAVE
@@ -301,10 +301,10 @@ int r;
301 { 301 {
302 uInt bl, bd; 302 uInt bl, bd;
303 inflate_huft *tl, *td; 303 inflate_huft *tl, *td;
304 struct inflate_codes_state *c; 304 inflate_codes_statef *c;
305 305
306 bl = 9; 306 bl = 9; /* must be <= 9 for lookahead assumptions */
307 bd = 6; 307 bd = 6; /* must be <= 9 for lookahead assumptions */
308 t = s->sub.trees.table; 308 t = s->sub.trees.table;
309 t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), 309 t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
310 s->sub.trees.blens, &bl, &bd, &tl, &td, z); 310 s->sub.trees.blens, &bl, &bd, &tl, &td, z);
@@ -373,9 +373,9 @@ int r;
373 373
374 374
375int inflate_blocks_free(s, z, c) 375int inflate_blocks_free(s, z, c)
376struct inflate_blocks_state *s; 376inflate_blocks_statef *s;
377z_stream *z; 377z_stream *z;
378uLong *c; 378uLongf *c;
379{ 379{
380 inflate_blocks_reset(s, z, c); 380 inflate_blocks_reset(s, z, c);
381 ZFREE(z, s->window); 381 ZFREE(z, s->window);