out = functable.chunkcopy_safe(out, from, len, safe);
}
} else {
- /* Whole reference is in range of current output. No
- range checks are necessary because we start with room
- for at least 258 bytes of output, so unroll and roundoff
- operations can write beyond `out+len` so long as they
- stay within 258 bytes of `out`.
+ /* Whole reference is in range of current output. No range checks are
+ necessary because we start with room for at least 258 bytes of output,
+ so unroll and roundoff operations can write beyond `out+len` so long
+ as they stay within 258 bytes of `out`.
*/
if (dist >= len || dist >= state->chunksize)
out = functable.chunkcopy(out, out - dist, len);
/* update state and return */
strm->next_in = in;
strm->next_out = out;
- strm->avail_in =
- (unsigned)(in < last ? (INFLATE_FAST_MIN_HAVE - 1) + (last - in)
- : (INFLATE_FAST_MIN_HAVE - 1) - (in - last));
- strm->avail_out =
- (unsigned)(out < end ? (INFLATE_FAST_MIN_LEFT - 1) + (end - out)
- : (INFLATE_FAST_MIN_LEFT - 1) - (out - end));
+ strm->avail_in = (unsigned)(in < last ? (INFLATE_FAST_MIN_HAVE - 1) + (last - in)
+ : (INFLATE_FAST_MIN_HAVE - 1) - (in - last));
+ strm->avail_out = (unsigned)(out < end ? (INFLATE_FAST_MIN_LEFT - 1) + (end - out)
+ : (INFLATE_FAST_MIN_LEFT - 1) - (out - end));
Assert(bits <= 32, "Remaining bits greater than 32");
state->hold = (uint32_t)hold;
if (copy > have)
copy = have;
if (copy) {
- if (state->head != NULL &&
- state->head->extra != NULL) {
+ if (state->head != NULL && state->head->extra != NULL) {
len = state->head->extra_len - state->length;
memcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
case LEN:
/* use inflate_fast() if we have enough input and output */
- if (have >= INFLATE_FAST_MIN_HAVE &&
- left >= INFLATE_FAST_MIN_LEFT) {
+ if (have >= INFLATE_FAST_MIN_HAVE && left >= INFLATE_FAST_MIN_LEFT) {
RESTORE();
zng_inflate_fast(strm, out);
LOAD();
zero for the first call.
*/
static uint32_t syncsearch(uint32_t *have, const uint8_t *buf, uint32_t len) {
- uint32_t got;
- uint32_t next;
+ uint32_t got, next;
got = *have;
next = 0;
state = (struct inflate_state *)source->state;
/* allocate space */
- copy = (struct inflate_state *)
- ZALLOC_STATE(source, 1, sizeof(struct inflate_state));
+ copy = (struct inflate_state *)ZALLOC_STATE(source, 1, sizeof(struct inflate_state));
if (copy == NULL)
return Z_MEM_ERROR;
window = NULL;
if (state->window != NULL) {
- window = (unsigned char *) ZALLOC_WINDOW(source, 1U << state->wbits, sizeof(unsigned char));
+ window = (unsigned char *)ZALLOC_WINDOW(source, 1U << state->wbits, sizeof(unsigned char));
if (window == NULL) {
ZFREE_STATE(source, copy);
return Z_MEM_ERROR;
#ifndef INFLATE_H_
#define INFLATE_H_
-/* define NO_GZIP when compiling if you want to disable gzip header and
- trailer decoding by inflate(). NO_GZIP would be used to avoid linking in
- the crc code when it is not needed. For shared libraries, gzip decoding
- should be left enabled. */
+/* define NO_GZIP when compiling if you want to disable gzip header and trailer decoding by inflate().
+ NO_GZIP would be used to avoid linking in the crc code when it is not needed.
+ For shared libraries, gzip decoding should be left enabled. */
#ifndef NO_GZIP
# define GUNZIP
#endif