Differences From Artifact [856d77bd39]:
- File
src/OFDeflateStream.m
— part of check-in
[d83d3aa719]
at
2013-10-10 13:18:35
on branch trunk
— Add OFDeflateStream.
No compression support yet, only decompression.
Decompression speed is acceptable for productive use, but there is still
a lot of room for optimization as this is a very straightforward
implementation without much optimization. (user: js, size: 17650) [annotate] [blame] [check-ins using]
To Artifact [d790744286]:
- File
src/OFDeflateStream.m
— part of check-in
[5dbf9298bd]
at
2013-10-10 21:33:51
on branch trunk
— OFDeflateStream: Fix uint_fast16_t != uint16_t.
On systems where uint_fast16_t is different from uint16_t, the pointer
operator creates incompatible pointers for those two, thus leading to a
compile time error. Therefore, one uint_fast16_t needed to be changed to
an uint16_t. (user: js, size: 17640) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
294 295 296 297 298 299 300 | [super dealloc]; } - (size_t)lowlevelReadIntoBuffer: (void*)buffer_ length: (size_t)length { uint8_t *buffer = buffer_; | | > | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | [super dealloc]; } - (size_t)lowlevelReadIntoBuffer: (void*)buffer_ length: (size_t)length { uint8_t *buffer = buffer_; uint_fast16_t bits; uint16_t value; size_t i, tmp, bytesWritten = 0; char *slidingWindow; uint_fast16_t slidingWindowIndex; if (_atEndOfStream) @throw [OFReadFailedException exceptionWithStream: self requestedLength: length]; |
︙ | ︙ | |||
650 651 652 653 654 655 656 | if OF_UNLIKELY (_slidingWindow == NULL) @throw [OFInvalidFormatException exception]; for (j = 0; j < CTX.length; j++) { uint_fast16_t index; | < | 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | if OF_UNLIKELY (_slidingWindow == NULL) @throw [OFInvalidFormatException exception]; for (j = 0; j < CTX.length; j++) { uint_fast16_t index; if OF_UNLIKELY (length == 0) { CTX.length -= j; return bytesWritten; } index = (_slidingWindowIndex - |
︙ | ︙ |