diff options
Diffstat (limited to 'infblock.c')
-rw-r--r-- | infblock.c | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -66,7 +66,7 @@ inflate_blocks_statef *s; | |||
66 | z_streamp z; | 66 | z_streamp z; |
67 | uLongf *c; | 67 | uLongf *c; |
68 | { | 68 | { |
69 | if (s->checkfn != Z_NULL) | 69 | if (c != Z_NULL) |
70 | *c = s->check; | 70 | *c = s->check; |
71 | if (s->mode == BTREE || s->mode == DTREE) | 71 | if (s->mode == BTREE || s->mode == DTREE) |
72 | ZFREE(z, s->sub.trees.blens); | 72 | ZFREE(z, s->sub.trees.blens); |
@@ -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 | z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0); |
85 | Trace((stderr, "inflate: blocks reset\n")); | 85 | Trace((stderr, "inflate: blocks reset\n")); |
86 | } | 86 | } |
87 | 87 | ||
@@ -105,7 +105,7 @@ uInt w; | |||
105 | s->checkfn = c; | 105 | s->checkfn = c; |
106 | s->mode = TYPE; | 106 | s->mode = TYPE; |
107 | Trace((stderr, "inflate: blocks allocated\n")); | 107 | Trace((stderr, "inflate: blocks allocated\n")); |
108 | inflate_blocks_reset(s, z, &s->check); | 108 | inflate_blocks_reset(s, z, Z_NULL); |
109 | return s; | 109 | return s; |
110 | } | 110 | } |
111 | 111 | ||
@@ -380,12 +380,11 @@ int r; | |||
380 | } | 380 | } |
381 | 381 | ||
382 | 382 | ||
383 | int inflate_blocks_free(s, z, c) | 383 | int inflate_blocks_free(s, z) |
384 | inflate_blocks_statef *s; | 384 | inflate_blocks_statef *s; |
385 | z_streamp z; | 385 | z_streamp z; |
386 | uLongf *c; | ||
387 | { | 386 | { |
388 | inflate_blocks_reset(s, z, c); | 387 | inflate_blocks_reset(s, z, Z_NULL); |
389 | ZFREE(z, s->window); | 388 | ZFREE(z, s->window); |
390 | ZFREE(z, s); | 389 | ZFREE(z, s); |
391 | Trace((stderr, "inflate: blocks freed\n")); | 390 | Trace((stderr, "inflate: blocks freed\n")); |
@@ -401,3 +400,14 @@ uInt n; | |||
401 | zmemcpy((charf *)s->window, d, n); | 400 | zmemcpy((charf *)s->window, d, n); |
402 | s->read = s->write = s->window + n; | 401 | s->read = s->write = s->window + n; |
403 | } | 402 | } |
403 | |||
404 | |||
405 | /* Returns true if inflate is currently at the end of a block generated | ||
406 | * by Z_SYNC_FLUSH or Z_FULL_FLUSH. | ||
407 | * IN assertion: s != Z_NULL | ||
408 | */ | ||
409 | int inflate_blocks_sync_point(s) | ||
410 | inflate_blocks_statef *s; | ||
411 | { | ||
412 | return s->mode == LENS; | ||
413 | } | ||