mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-09-09 20:29:26 -04:00
deflate_decompress: rename overrun_count to overread_count
Make it clear that this is for the input, not the output. Update https://github.com/ebiggers/libdeflate/issues/157
This commit is contained in:
parent
572e4c5db0
commit
5be041247e
@ -43,7 +43,7 @@ FUNCNAME(struct libdeflate_decompressor * restrict d,
|
|||||||
const u8 * const in_end = in_next + in_nbytes;
|
const u8 * const in_end = in_next + in_nbytes;
|
||||||
bitbuf_t bitbuf = 0;
|
bitbuf_t bitbuf = 0;
|
||||||
unsigned bitsleft = 0;
|
unsigned bitsleft = 0;
|
||||||
size_t overrun_count = 0;
|
size_t overread_count = 0;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
unsigned is_final_block;
|
unsigned is_final_block;
|
||||||
unsigned block_type;
|
unsigned block_type;
|
||||||
|
@ -222,7 +222,7 @@ do { \
|
|||||||
if (likely(in_next != in_end)) \
|
if (likely(in_next != in_end)) \
|
||||||
bitbuf |= (bitbuf_t)*in_next++ << bitsleft; \
|
bitbuf |= (bitbuf_t)*in_next++ << bitsleft; \
|
||||||
else \
|
else \
|
||||||
overrun_count++; \
|
overread_count++; \
|
||||||
bitsleft += 8; \
|
bitsleft += 8; \
|
||||||
} while (bitsleft <= BITBUF_NBITS - 8)
|
} while (bitsleft <= BITBUF_NBITS - 8)
|
||||||
|
|
||||||
@ -307,9 +307,9 @@ if (!HAVE_BITS(n)) { \
|
|||||||
*/
|
*/
|
||||||
#define ALIGN_INPUT() \
|
#define ALIGN_INPUT() \
|
||||||
do { \
|
do { \
|
||||||
SAFETY_CHECK(overrun_count <= (bitsleft >> 3)); \
|
SAFETY_CHECK(overread_count <= (bitsleft >> 3)); \
|
||||||
in_next -= (bitsleft >> 3) - overrun_count; \
|
in_next -= (bitsleft >> 3) - overread_count; \
|
||||||
overrun_count = 0; \
|
overread_count = 0; \
|
||||||
bitbuf = 0; \
|
bitbuf = 0; \
|
||||||
bitsleft = 0; \
|
bitsleft = 0; \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user