ObjFW  Diff

Differences From Artifact [20c52d7bc7]:

To Artifact [0daf2b33bf]:


622
623
624
625
626
627
628
629
630



631
632
633

634

635
636
637
638
639
640
641
622
623
624
625
626
627
628


629
630
631
632
633

634
635
636
637
638
639
640
641
642
643







-
-
+
+
+


-
+

+







	OFDataArray *data;

	if (_itemSize != 1)
		@throw [OFInvalidArgumentException
		    exceptionWithClass: [self class]
			      selector: _cmd];

	if (_count <= 15) {
		uint8_t tmp = 0xA0 | ((uint8_t)_count & 0xF);
	if (_count <= UINT8_MAX) {
		uint8_t type = 0xD9;
		uint8_t tmp = (uint8_t)_count;

		data = [OFDataArray dataArrayWithItemSize: 1
						 capacity: _count + 1];
						 capacity: _count + 2];

		[data addItem: &type];
		[data addItem: &tmp];
	} else if (_count <= UINT16_MAX) {
		uint8_t type = 0xDA;
		uint16_t tmp = OF_BSWAP16_IF_LE((uint16_t)_count);

		data = [OFDataArray dataArrayWithItemSize: 1
						 capacity: _count + 3];