ObjFW  Check-in [5b1280c863]

Overview
Comment:Rename -[itemsize] to -[itemSize].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5b1280c863f310bf906315c837961a2409a2494a51c7f91ab6b11655fc82ae68
User & Date: js on 2010-04-08 21:05:11
Other Links: manifest | tags
Context
2010-04-08
21:14
Make TableGenerator an OFApplicationDelegate. check-in: db6e3205fd user: js tags: trunk
21:05
Rename -[itemsize] to -[itemSize]. check-in: 5b1280c863 user: js tags: trunk
02:00
Add -[programName] to OFApplication and remove it from -[arguments]. check-in: b23b8c11bc user: js tags: trunk
Changes

Modified src/OFDataArray.h from [fb357534a5] to [5bdcca6241].

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 * \return The number of items in the OFDataArray
 */
- (size_t)count;

/**
 * \return The size of each item in the OFDataArray in bytes
 */
- (size_t)itemsize;

/**
 * \return All elements of the OFDataArray as a C array
 */
- (void*)cArray;

/**







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 * \return The number of items in the OFDataArray
 */
- (size_t)count;

/**
 * \return The size of each item in the OFDataArray in bytes
 */
- (size_t)itemSize;

/**
 * \return All elements of the OFDataArray as a C array
 */
- (void*)cArray;

/**

Modified src/OFDataArray.m from [c912fd9350] to [7837bd842b].

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
}

- (size_t)count
{
	return count;
}

- (size_t)itemsize
{
	return itemsize;
}

- (void*)cArray
{
	return data;







|







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
}

- (size_t)count
{
	return count;
}

- (size_t)itemSize
{
	return itemsize;
}

- (void*)cArray
{
	return data;
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
}

- (BOOL)isEqual: (OFObject*)obj
{
	if (![obj isKindOfClass: [OFDataArray class]])
		return NO;
	if ([(OFDataArray*)obj count] != count ||
	    [(OFDataArray*)obj itemsize] != itemsize)
		return NO;
	if (memcmp([(OFDataArray*)obj cArray], data, count * itemsize))
		return NO;

	return YES;
}

- (of_comparison_result_t)compare: (OFDataArray*)ary
{
	int cmp;
	size_t ary_count, min_count;

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

	ary_count = [ary count];
	min_count = (count > ary_count ? ary_count : count);

	if ((cmp = memcmp(data, [ary cArray], min_count * itemsize)) == 0) {







|















|







206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
}

- (BOOL)isEqual: (OFObject*)obj
{
	if (![obj isKindOfClass: [OFDataArray class]])
		return NO;
	if ([(OFDataArray*)obj count] != count ||
	    [(OFDataArray*)obj itemSize] != itemsize)
		return NO;
	if (memcmp([(OFDataArray*)obj cArray], data, count * itemsize))
		return NO;

	return YES;
}

- (of_comparison_result_t)compare: (OFDataArray*)ary
{
	int cmp;
	size_t ary_count, min_count;

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

	ary_count = [ary count];
	min_count = (count > ary_count ? ary_count : count);

	if ((cmp = memcmp(data, [ary cArray], min_count * itemsize)) == 0) {