diff options
Diffstat (limited to '')
| -rw-r--r-- | infblock.c | 23 |
1 files changed, 6 insertions, 17 deletions
| @@ -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 | |||
| 388 | void inflate_set_dictionary(s, z, d, n) | ||
| 389 | inflate_blocks_statef *s; | ||
| 390 | z_stream *z; | ||
| 391 | const Bytef *d; | ||
| 392 | uInt n; | ||
| 393 | { | ||
| 394 | zmemcpy((charf *)s->window, d, n); | ||
| 395 | s->read = s->write = s->window + n; | ||
| 396 | } | ||
