ObjFW  Diff

Differences From Artifact [91a0ea19b6]:

To Artifact [3d750bfc13]:


38
39
40
41
42
43
44
45

46
47
48
49
50
51
52
38
39
40
41
42
43
44

45
46
47
48
49
50
51
52







-
+








	self = [super init];

	if (is == 0) {
		c = isa;
		[super dealloc];
		@throw [OFInvalidArgumentException newWithClass: c
						    andSelector: _cmd];
						       selector: _cmd];
	}

	data = NULL;
	itemsize = is;

	return self;
}
146
147
148
149
150
151
152
153

154
155
156

157
158
159
160
161
162
163
146
147
148
149
150
151
152

153
154
155

156
157
158
159
160
161
162
163







-
+


-
+








- (int)compare: (id)obj
{
	int ret;

	if (![obj isKindOfClass: [OFDataArray class]])
		@throw [OFInvalidArgumentException newWithClass: isa
						    andSelector: _cmd];
						       selector: _cmd];
	if ([obj itemsize] != itemsize)
		@throw [OFInvalidArgumentException newWithClass: isa
						    andSelector: _cmd];
						       selector: _cmd];

	if ([obj count] == count)
		return memcmp(data, [obj data], count * itemsize);

	if (count > [obj count]) {
		if ((ret = memcmp(data, [obj data], [obj count] * itemsize)))
			return ret;