=========================================================================== * Flush the bit buffer, keeping at most 7 bits in it. */
(s)
| 1159 | * Flush the bit buffer, keeping at most 7 bits in it. |
| 1160 | */ |
| 1161 | local void bi_flush(s) |
| 1162 | deflate_state *s; |
| 1163 | { |
| 1164 | if (s->bi_valid == 16) { |
| 1165 | put_short(s, s->bi_buf); |
| 1166 | s->bi_buf = 0; |
| 1167 | s->bi_valid = 0; |
| 1168 | } else if (s->bi_valid >= 8) { |
| 1169 | put_byte(s, (Byte)s->bi_buf); |
| 1170 | s->bi_buf >>= 8; |
| 1171 | s->bi_valid -= 8; |
| 1172 | } |
| 1173 | } |
| 1174 | |
| 1175 | /* =========================================================================== |
| 1176 | * Flush the bit buffer and align the output on a byte boundary |