ObjFW  Check-in [2b11bca0d1]

Overview
Comment:OFDeflateStream: Get rid of stupid GCC warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2b11bca0d14560ae30a7746f7d9046a0e20d761b30b7735db545b9de2943d3f0
User & Date: js on 2013-10-29 23:37:20
Other Links: manifest | tags
Context
2013-10-29
23:46
Clean up OF_ENSURE() vs. assert() a little. check-in: a427cfc86a user: js tags: trunk
23:37
OFDeflateStream: Get rid of stupid GCC warnings. check-in: 2b11bca0d1 user: js tags: trunk
22:56
OFDeflateStream: Fix reading uncompressed header. check-in: d1293b647a user: js tags: trunk
Changes

Modified src/OFDeflateStream.m from [b45e69217a] to [66b4a19144].

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
}

static struct huffman_tree*
constructTree(uint8_t lengths[], uint_fast16_t count)
{
	struct huffman_tree *tree;
	uint16_t lengthCount[MAX_BITS + 1] = { 0 };
	uint16_t code, maxCode, nextCode[MAX_BITS + 1];
	uint_fast16_t i;

	for (i = 0; i < count; i++) {
		uint8_t length = lengths[i];

		if OF_UNLIKELY (length > MAX_BITS)
			@throw [OFInvalidFormatException exception];







|







156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
}

static struct huffman_tree*
constructTree(uint8_t lengths[], uint_fast16_t count)
{
	struct huffman_tree *tree;
	uint16_t lengthCount[MAX_BITS + 1] = { 0 };
	uint16_t code, maxCode = 0, nextCode[MAX_BITS + 1];
	uint_fast16_t i;

	for (i = 0; i < count; i++) {
		uint8_t length = lengths[i];

		if OF_UNLIKELY (length > MAX_BITS)
			@throw [OFInvalidFormatException exception];
729
730
731
732
733
734
735


736
737
738
739
740
741
742
			CTX.treeIter = CTX.distTree;
			CTX.state = AWAIT_DISTANCE;
		}

		break;
#undef CTX
	}


}

- (bool)lowlevelIsAtEndOfStream
{
	return _atEndOfStream;
}
@end







>
>







729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
			CTX.treeIter = CTX.distTree;
			CTX.state = AWAIT_DISTANCE;
		}

		break;
#undef CTX
	}

	assert(0);
}

- (bool)lowlevelIsAtEndOfStream
{
	return _atEndOfStream;
}
@end