Differences From Artifact [28d4702177]:
- File src/OFInflateStream.m — part of check-in [1a86b8175b] at 2022-02-12 07:46:07 on branch trunk — Update copyright (user: js, size: 17067) [annotate] [blame] [check-ins using] [more...]
To Artifact [a61e69ad62]:
- File
src/OFInflateStream.m
— part of check-in
[c86b8f10f0]
at
2022-11-16 01:27:26
on branch trunk
— Add OFAssert()
This uses the same format as OFEnsure(). (user: js, size: 17048) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
14 15 16 17 18 19 20 | */ #include "config.h" #include <stdlib.h> #include <string.h> | < < | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | */ #include "config.h" #include <stdlib.h> #include <string.h> #ifndef OF_INFLATE64_STREAM_M # import "OFInflateStream.h" #else # import "OFInflate64Stream.h" # define OFInflateStream OFInflate64Stream #endif #import "OFHuffmanTree.h" |
︙ | ︙ | |||
103 104 105 106 107 108 109 | @implementation OFInflateStream static OF_INLINE bool tryReadBits(OFInflateStream *stream, uint16_t *bits, uint8_t count) { uint16_t ret = stream->_savedBits; | | | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | @implementation OFInflateStream static OF_INLINE bool tryReadBits(OFInflateStream *stream, uint16_t *bits, uint8_t count) { uint16_t ret = stream->_savedBits; OFAssert(stream->_savedBitsLength < count); for (uint_fast8_t i = stream->_savedBitsLength; i < count; i++) { if OF_UNLIKELY (stream->_bitIndex == 8) { if OF_LIKELY (stream->_bufferIndex < stream->_bufferLength) stream->_byte = stream->_buffer[stream->_bufferIndex++]; |
︙ | ︙ |