ObjFW  Check-in [6d3b3d0468]

Overview
Comment:Use isa as class for the copy where useful.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6d3b3d046885b742fe374b2e794b149278a2e29415faf7c8b8000f0d8ab61788
User & Date: js on 2011-06-28 22:20:19
Other Links: manifest | tags
Context
2011-06-28
22:21
Add OFCopying to OFXMLElement. check-in: 33ac65f8f7 user: js tags: trunk
22:20
Use isa as class for the copy where useful. check-in: 6d3b3d0468 user: js tags: trunk
21:07
Add serialization and deserialization to OFDataArray. check-in: bfa01e9b5c user: js tags: trunk
Changes

Modified src/OFDataArray.m from [3b5c7f98e9] to [5113b26e1a].

353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
		/* We don't care, as we only made it smaller */
		[e release];
	}
}

- copy
{
	OFDataArray *copy = [[OFDataArray alloc] initWithItemSize: itemSize];

	[copy addNItems: count
	     fromCArray: data];

	return copy;
}








|







353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
		/* We don't care, as we only made it smaller */
		[e release];
	}
}

- copy
{
	OFDataArray *copy = [[isa alloc] initWithItemSize: itemSize];

	[copy addNItems: count
	     fromCArray: data];

	return copy;
}

573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
	newSize = (count * itemSize + lastPageByte) & ~lastPageByte;

	if (size != newSize)
		data = [self resizeMemory: data
				   toSize: newSize];
	size = newSize;
}

- copy
{
	OFDataArray *copy = [[OFBigDataArray alloc] initWithItemSize: itemSize];

	[copy addNItems: count
	     fromCArray: data];

	return copy;
}
@end







<
<
<
<
<
<
<
<
<
<

573
574
575
576
577
578
579










580
	newSize = (count * itemSize + lastPageByte) & ~lastPageByte;

	if (size != newSize)
		data = [self resizeMemory: data
				   toSize: newSize];
	size = newSize;
}










@end

Modified src/OFList.m from [037aaf69fa] to [422b33ae63].

269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
			return YES;

	return NO;
}

- copy
{
	OFList *copy = [[OFList alloc] init];
	of_list_object_t *iter, *listObject, *previous;

	listObject = NULL;
	previous = NULL;

	@try {
		for (iter = firstListObject; iter != NULL; iter = iter->next) {







|







269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
			return YES;

	return NO;
}

- copy
{
	OFList *copy = [[isa alloc] init];
	of_list_object_t *iter, *listObject, *previous;

	listObject = NULL;
	previous = NULL;

	@try {
		for (iter = firstListObject; iter != NULL; iter = iter->next) {

Modified src/OFURL.m from [e46fcb96eb] to [221a47cb00].

373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
	OF_HASH_FINALIZE(hash);

	return hash;
}

- copy
{
	OFURL *copy = [[OFURL alloc] init];

	@try {
		copy->scheme = [scheme copy];
		copy->host = [host copy];
		copy->port = port;
		copy->user = [user copy];
		copy->password = [password copy];







|







373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
	OF_HASH_FINALIZE(hash);

	return hash;
}

- copy
{
	OFURL *copy = [[isa alloc] init];

	@try {
		copy->scheme = [scheme copy];
		copy->host = [host copy];
		copy->port = port;
		copy->user = [user copy];
		copy->password = [password copy];