ObjFW  Diff

Differences From Artifact [75d72d0a96]:

To Artifact [15022d3186]:


22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36







-
+







#include <assert.h>

#import "OFArray.h"
#import "OFArray_subarray.h"
#import "OFArray_adjacent.h"
#import "OFString.h"
#import "OFXMLElement.h"
#import "OFDataArray.h"
#import "OFData.h"
#import "OFNull.h"

#import "OFEnumerationMutationException.h"
#import "OFInvalidArgumentException.h"
#import "OFOutOfRangeException.h"

static struct {
652
653
654
655
656
657
658
659

660
661

662
663
664
665

666
667
668
669
670
671
672
652
653
654
655
656
657
658

659
660

661
662
663
664

665
666
667
668
669
670
671
672







-
+

-
+



-
+







	[JSON makeImmutable];

	objc_autoreleasePoolPop(pool);

	return JSON;
}

- (OFDataArray *)messagePackRepresentation
- (OFData *)messagePackRepresentation
{
	OFDataArray *data;
	OFMutableData *data;
	size_t i, count;
	void *pool;

	data = [OFDataArray dataArray];
	data = [OFMutableData data];
	count = [self count];

	if (count <= 15) {
		uint8_t tmp = 0x90 | ((uint8_t)count & 0xF);
		[data addItem: &tmp];
	} else if (count <= UINT16_MAX) {
		uint8_t type = 0xDC;
686
687
688
689
690
691
692
693

694
695
696
697
698
699
700
701
702
703
704


705
706
707
708
709
710
711
686
687
688
689
690
691
692

693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713







-
+











+
+







		@throw [OFOutOfRangeException exception];

	pool = objc_autoreleasePoolPush();

	i = 0;
	for (id object in self) {
		void *pool2 = objc_autoreleasePoolPush();
		OFDataArray *child;
		OFData *child;

		i++;

		child = [object messagePackRepresentation];
		[data addItems: [child items]
			 count: [child count]];

		objc_autoreleasePoolPop(pool2);
	}

	assert(i == count);

	[data makeImmutable];

	objc_autoreleasePoolPop(pool);

	return data;
}

- (void)makeObjectsPerformSelector: (SEL)selector