Differences From Artifact [be9beadf26]:
- File
src/OFDeflateStream.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 20161) [annotate] [blame] [check-ins using]
To Artifact [95db2a693c]:
- File
src/OFDeflateStream.m
— part of check-in
[6b77a5dd8b]
at
2017-05-21 21:28:57
on branch trunk
— Prefix private methods with of_ instead of OF_
This matches Apple's style. (user: js, size: 20161) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
59 60 61 62 63 64 65 | struct huffman_tree { struct huffman_tree *leafs[2]; uint16_t value; }; @interface OFDeflateStream () | | | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | struct huffman_tree { struct huffman_tree *leafs[2]; uint16_t value; }; @interface OFDeflateStream () - (void)of_initDecompression; @end #ifndef DEFLATE64 static const uint8_t numDistanceCodes = 30; static const uint8_t lengthCodes[29] = { /* indices are -257, values -3 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, |
︙ | ︙ | |||
322 323 324 325 326 327 328 | releaseTree(_decompression->context.huffman.distTree); } [super dealloc]; } #endif | | | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | releaseTree(_decompression->context.huffman.distTree); } [super dealloc]; } #endif - (void)of_initDecompression { _decompression = [self allocMemoryWithSize: sizeof(*_decompression)]; memset(_decompression, 0, sizeof(*_decompression)); /* 0-7 address the bit, 8 means fetch next byte */ _decompression->bitIndex = 8; #ifdef DEFLATE64 |
︙ | ︙ | |||
348 349 350 351 352 353 354 | uint16_t bits, tmp; uint16_t value; size_t bytesWritten = 0; uint8_t *slidingWindow; uint16_t slidingWindowIndex; if (ivars == NULL) { | | | 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | uint16_t bits, tmp; uint16_t value; size_t bytesWritten = 0; uint8_t *slidingWindow; uint16_t slidingWindowIndex; if (ivars == NULL) { [self of_initDecompression]; ivars = _decompression; } if (ivars->atEndOfStream) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length]; |
︙ | ︙ |