Lines Matching defs:BITS
32 * - Add comments on state->bits assertion in inffast.c
124 state->bits = 0;
166 /* set number of window bits, free window if different */
225 int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) {
229 if (bits == 0)
232 if (bits < 0) {
234 state->bits = 0;
237 if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR;
238 value &= (1L << bits) - 1;
239 state->hold += (unsigned)value << state->bits;
240 state->bits += (uInt)bits;
262 unsigned sym, bits;
273 bits = 9;
274 inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
280 bits = 5;
281 inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
337 state.lencode[low].bits, state.lencode[low].val);
347 printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
453 bits = state->bits; \
464 state->bits = bits; \
471 bits = 0; \
480 hold += (unsigned long)(*next++) << bits; \
481 bits += 8; \
484 /* Assure that there are at least n bits in the bit accumulator. If there is
488 while (bits < (unsigned)(n)) \
492 /* Return the low n bits of the bit accumulator (n < 16) */
493 #define BITS(n) \
496 /* Remove n bits from the bit accumulator */
500 bits -= (unsigned)(n); \
503 /* Remove zero to seven bits as needed to go to a byte boundary */
506 hold >>= bits & 7; \
507 bits -= bits & 7; \
530 the requested bits are not available. The typical use of the BITS macros
534 ... do something with BITS(n) ...
538 input left to load n bits into the accumulator, or it continues. BITS(n)
539 gives the low n bits in the accumulator. When done, DROPBITS(n) drops
540 the low n bits off the accumulator. INITBITS() clears the accumulator
541 and sets the number of available bits to zero. BYTEBITS() discards just
542 enough bits to put the accumulator on a byte boundary. After BYTEBITS()
543 and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
559 keep[want++] = BITS(n);
598 unsigned bits; /* bits in bit buffer */
604 unsigned len; /* length to copy for repeats, bits to drop */
653 ((BITS(8) << 8) + (hold >> 8)) % 31) {
658 if (BITS(4) != Z_DEFLATED) {
664 len = BITS(4) + 8;
843 state->last = BITS(1);
845 switch (BITS(2)) {
909 state->nlen = BITS(5) + 257;
911 state->ndist = BITS(5) + 1;
913 state->ncode = BITS(4) + 4;
929 state->lens[order[state->have++]] = (unsigned short)BITS(3);
951 here = state->lencode[BITS(state->lenbits)];
952 if ((unsigned)(here.bits) <= bits) break;
956 DROPBITS(here.bits);
961 NEEDBITS(here.bits + 2);
962 DROPBITS(here.bits);
969 copy = 3 + BITS(2);
973 NEEDBITS(here.bits + 3);
974 DROPBITS(here.bits);
976 copy = 3 + BITS(3);
980 NEEDBITS(here.bits + 7);
981 DROPBITS(here.bits);
983 copy = 11 + BITS(7);
1046 here = state->lencode[BITS(state->lenbits)];
1047 if ((unsigned)(here.bits) <= bits) break;
1054 (BITS(last.bits + last.op) >> last.bits)];
1055 if ((unsigned)(last.bits + here.bits) <= bits) break;
1058 DROPBITS(last.bits);
1059 state->back += last.bits;
1061 DROPBITS(here.bits);
1062 state->back += here.bits;
1088 state->length += BITS(state->extra);
1098 here = state->distcode[BITS(state->distbits)];
1099 if ((unsigned)(here.bits) <= bits) break;
1106 (BITS(last.bits + last.op) >> last.bits)];
1107 if ((unsigned)(last.bits + here.bits) <= bits) break;
1110 DROPBITS(last.bits);
1111 state->back += last.bits;
1113 DROPBITS(here.bits);
1114 state->back += here.bits;
1127 state->offset += BITS(state->extra);
1267 strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
1394 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
1399 state->hold >>= state->bits & 7;
1400 state->bits -= state->bits & 7;
1402 while (state->bits >= 8) {
1405 state->bits -= 8;
1445 return state->mode == STORED && state->bits == 0;