ObjFW  Diff

Differences From Artifact [a85051edf1]:

To Artifact [b2cd72f318]:


18
19
20
21
22
23
24
25
26
27
28
29
30
31

32
33
34
35
36
37
38

#include <string.h>

#include <assert.h>

#import "OFMutableArray.h"
#import "OFMutableArray_adjacent.h"
#import "OFAutoreleasePool.h"

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


#import "macros.h"

static struct {
	Class isa;
} placeholder;

@interface OFMutableArray_placeholder: OFMutableArray







<






>







18
19
20
21
22
23
24

25
26
27
28
29
30
31
32
33
34
35
36
37
38

#include <string.h>

#include <assert.h>

#import "OFMutableArray.h"
#import "OFMutableArray_adjacent.h"


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

#import "autorelease.h"
#import "macros.h"

static struct {
	Class isa;
} placeholder;

@interface OFMutableArray_placeholder: OFMutableArray
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
}

- (void)insertObjectsFromArray: (OFArray*)array
		       atIndex: (size_t)index
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFEnumerator *enumerator = [array objectEnumerator];
	size_t i, count = [array count];

	for (i = 0; i < count; i++) {
		id object = [enumerator nextObject];

		assert(object != nil);

		[self insertObject: object
			   atIndex: index + i];
	}

	[pool release];
}

- (void)replaceObjectAtIndex: (size_t)index
		  withObject: (id)object
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];







|












|







196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
}

- (void)insertObjectsFromArray: (OFArray*)array
		       atIndex: (size_t)index
{
	void *pool = objc_autoreleasePoolPush();
	OFEnumerator *enumerator = [array objectEnumerator];
	size_t i, count = [array count];

	for (i = 0; i < count; i++) {
		id object = [enumerator nextObject];

		assert(object != nil);

		[self insertObject: object
			   atIndex: index + i];
	}

	objc_autoreleasePoolPop(pool);
}

- (void)replaceObjectAtIndex: (size_t)index
		  withObject: (id)object
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];