summaryrefslogtreecommitdiff
path: root/infblock.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:13:27 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:13:27 -0700
commit8a2acbffc86012de3523ecf91db2c4ea1b1c4ea2 (patch)
treec461eb314065024b6cb87d136e107dca2cc09a33 /infblock.c
parent56bcb184fac036a45cb8937238d51778d0a796aa (diff)
downloadzlib-1.0-pre.tar.gz
zlib-1.0-pre.tar.bz2
zlib-1.0-pre.zip
zlib 1.0-prev1.0-pre
Diffstat (limited to 'infblock.c')
-rw-r--r--infblock.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/infblock.c b/infblock.c
index 4c2ff65..9c6e6a8 100644
--- a/infblock.c
+++ b/infblock.c
@@ -1,5 +1,5 @@
1/* infblock.c -- interpret and process block types to last block 1/* infblock.c -- interpret and process block types to last block
2 * Copyright (C) 1995-1996 Mark Adler 2 * Copyright (C) 1995 Mark Adler
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
@@ -81,7 +81,7 @@ uLongf *c;
81 s->bitb = 0; 81 s->bitb = 0;
82 s->read = s->write = s->window; 82 s->read = s->write = s->window;
83 if (s->checkfn != Z_NULL) 83 if (s->checkfn != Z_NULL)
84 z->adler = s->check = (*s->checkfn)(0L, Z_NULL, 0); 84 s->check = (*s->checkfn)(0L, Z_NULL, 0);
85 Trace((stderr, "inflate: blocks reset\n")); 85 Trace((stderr, "inflate: blocks reset\n"));
86} 86}
87 87
@@ -172,7 +172,7 @@ int r;
172 case 3: /* illegal */ 172 case 3: /* illegal */
173 DUMPBITS(3) 173 DUMPBITS(3)
174 s->mode = BAD; 174 s->mode = BAD;
175 z->msg = (char*)"invalid block type"; 175 z->msg = "invalid block type";
176 r = Z_DATA_ERROR; 176 r = Z_DATA_ERROR;
177 LEAVE 177 LEAVE
178 } 178 }
@@ -182,7 +182,7 @@ int r;
182 if ((((~b) >> 16) & 0xffff) != (b & 0xffff)) 182 if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
183 { 183 {
184 s->mode = BAD; 184 s->mode = BAD;
185 z->msg = (char*)"invalid stored block lengths"; 185 z->msg = "invalid stored block lengths";
186 r = Z_DATA_ERROR; 186 r = Z_DATA_ERROR;
187 LEAVE 187 LEAVE
188 } 188 }
@@ -215,7 +215,7 @@ int r;
215 if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) 215 if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
216 { 216 {
217 s->mode = BAD; 217 s->mode = BAD;
218 z->msg = (char*)"too many length or distance symbols"; 218 z->msg = "too many length or distance symbols";
219 r = Z_DATA_ERROR; 219 r = Z_DATA_ERROR;
220 LEAVE 220 LEAVE
221 } 221 }
@@ -285,7 +285,7 @@ int r;
285 (c == 16 && i < 1)) 285 (c == 16 && i < 1))
286 { 286 {
287 s->mode = BAD; 287 s->mode = BAD;
288 z->msg = (char*)"invalid bit length repeat"; 288 z->msg = "invalid bit length repeat";
289 r = Z_DATA_ERROR; 289 r = Z_DATA_ERROR;
290 LEAVE 290 LEAVE
291 } 291 }
@@ -383,14 +383,3 @@ uLongf *c;
383 Trace((stderr, "inflate: blocks freed\n")); 383 Trace((stderr, "inflate: blocks freed\n"));
384 return Z_OK; 384 return Z_OK;
385} 385}
386
387
388void inflate_set_dictionary(s, z, d, n)
389inflate_blocks_statef *s;
390z_stream *z;
391const Bytef *d;
392uInt n;
393{
394 zmemcpy((charf *)s->window, d, n);
395 s->read = s->write = s->window + n;
396}