ObjFW  Check-in [5dbf9298bd]

Overview
Comment: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.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5dbf9298bdb775b6fc6d2d08280371d70bc0b8fbe19f1858654b518dd54f924f
User & Date: js on 2013-10-10 21:33:51
Other Links: manifest | tags
Context
2013-10-10
22:18
OFZIPArchive: Correctly handle archive comments. check-in: e2ad3ceacb user: js tags: trunk
21:33
OFDeflateStream: Fix uint_fast16_t != uint16_t. check-in: 5dbf9298bd user: js tags: trunk
13:36
OFZIPArchive: Add support for deflate. check-in: 53e46a8326 user: js tags: trunk
Changes

Modified src/OFDeflateStream.m from [856d77bd39] to [d790744286].

294
295
296
297
298
299
300
301


302
303
304
305
306
307
308
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, value;
	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
657
658
659
660
661
662
663
664
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;
					uint8_t value;

					if OF_UNLIKELY (length == 0) {
						CTX.length -= j;
						return bytesWritten;
					}

					index = (_slidingWindowIndex -