ObjFW  Diff

Differences From Artifact [706da4f76f]:

To Artifact [d9547cea8c]:


134
135
136
137
138
139
140
141

142
143
144
145
146

147
148
149
150
151

152
153
154
155
156

157
158
159
160
161
162
163
164
165
166
167
168
169
170


171
172
173
174
175
176

177
178
179
180
181
182


183
184
185
186
187
188

189
190
191
192
193
194

195
196
197
198
199

200
201
202
203
204
205
206
134
135
136
137
138
139
140

141
142
143
144
145

146
147
148
149
150

151
152
153
154
155

156
157
158
159
160
161
162
163
164
165
166
167
168


169
170
171
172
173
174
175

176
177
178
179
180


181
182
183
184
185
186
187

188
189
190
191
192
193

194
195
196
197
198

199
200
201
202
203
204
205
206







-
+




-
+




-
+




-
+












-
-
+
+





-
+




-
-
+
+





-
+





-
+




-
+








		left = i + 1;
	}
}
#endif

@implementation OFMutableArray_placeholder
- init
- (instancetype)init
{
	return (id)[[OFMutableArray_adjacent alloc] init];
}

- initWithCapacity: (size_t)capacity
- (instancetype)initWithCapacity: (size_t)capacity
{
	return (id)[[OFMutableArray_adjacent alloc] initWithCapacity: capacity];
}

- initWithObject: (id)object
- (instancetype)initWithObject: (id)object
{
	return (id)[[OFMutableArray_adjacent alloc] initWithObject: object];
}

- initWithObjects: (id)firstObject, ...
- (instancetype)initWithObjects: (id)firstObject, ...
{
	id ret;
	va_list arguments;

	va_start(arguments, firstObject);
	ret = [[OFMutableArray_adjacent alloc] initWithObject: firstObject
						    arguments: arguments];
	va_end(arguments);

	return ret;
}

- initWithObject: (id)firstObject
       arguments: (va_list)arguments
- (instancetype)initWithObject: (id)firstObject
		     arguments: (va_list)arguments
{
	return (id)[[OFMutableArray_adjacent alloc] initWithObject: firstObject
							 arguments: arguments];
}

- initWithArray: (OFArray *)array
- (instancetype)initWithArray: (OFArray *)array
{
	return (id)[[OFMutableArray_adjacent alloc] initWithArray: array];
}

- initWithObjects: (id const *)objects
	    count: (size_t)count
- (instancetype)initWithObjects: (id const *)objects
			  count: (size_t)count
{
	return (id)[[OFMutableArray_adjacent alloc] initWithObjects: objects
							      count: count];
}

- initWithSerialization: (OFXMLElement *)element
- (instancetype)initWithSerialization: (OFXMLElement *)element
{
	return (id)[[OFMutableArray_adjacent alloc]
	    initWithSerialization: element];
}

- retain
- (instancetype)retain
{
	return self;
}

- autorelease
- (instancetype)autorelease
{
	return self;
}

- (void)release
{
}
214
215
216
217
218
219
220
221

222
223
224
225
226
227
228
229
230
231
232
233
234

235
236
237
238
239
240
241
242
243
244
245
246
247
248
249

250
251
252
253
254

255
256
257
258
259
260
261
214
215
216
217
218
219
220

221
222
223
224
225
226
227
228
229
230
231
232
233

234
235
236
237
238
239
240
241
242
243
244
245
246
247
248

249
250
251
252
253

254
255
256
257
258
259
260
261







-
+












-
+














-
+




-
+







@implementation OFMutableArray
+ (void)initialize
{
	if (self == [OFMutableArray class])
		placeholder.isa = [OFMutableArray_placeholder class];
}

+ alloc
+ (instancetype)alloc
{
	if (self == [OFMutableArray class])
		return (id)&placeholder;

	return [super alloc];
}

+ (instancetype)arrayWithCapacity: (size_t)capacity
{
	return [[[self alloc] initWithCapacity: capacity] autorelease];
}

- init
- (instancetype)init
{
	if (object_getClass(self) == [OFMutableArray class]) {
		@try {
			[self doesNotRecognizeSelector: _cmd];
			abort();
		} @catch (id e) {
			[self release];
			@throw e;
		}
	}

	return [super init];
}

- initWithCapacity: (size_t)capacity
- (instancetype)initWithCapacity: (size_t)capacity
{
	OF_INVALID_INIT_METHOD
}

- copy
- (id)copy
{
	return [[OFArray alloc] initWithArray: self];
}

- (void)addObject: (id)object
{
	[self insertObject: object