Overview
Context
Changes
Modified src/Makefile
from [2728704c39]
to [ea86bff181].
︙ | | |
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
+
+
|
asprintf.h \
${ATOMIC_H} \
macros.h \
objfw-defs.h \
${THREADING_H}
SRCS += OFArray_adjacent.m \
OFArray_adjacentSubarray.m \
OFArray_subarray.m \
OFCountedSet_hashtable.m \
OFDictionary_hashtable.m \
OFMutableArray_adjacent.m \
OFMutableDictionary_hashtable.m \
OFMutableSet_hashtable.m \
OFSet_hashtable.m \
${OFSTREAMPOLLOBSERVER_M} \
|
︙ | | |
Modified src/OFArray.m
from [7b80c238f7]
to [de78bb7da7].
︙ | | |
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
+
|
*/
#include "config.h"
#include <stdarg.h>
#import "OFArray.h"
#import "OFArray_subarray.h"
#import "OFArray_adjacent.h"
#import "OFString.h"
#import "OFXMLElement.h"
#import "OFAutoreleasePool.h"
#import "OFEnumerationMutationException.h"
#import "OFInvalidArgumentException.h"
|
︙ | | |
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
|
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
|
+
+
+
+
+
+
-
+
|
return nil;
}
- (OFArray*)objectsInRange: (of_range_t)range
{
OFArray *ret;
id *buffer;
if (![self isKindOfClass: [OFMutableArray class]])
return [OFArray_subarray arrayWithArray: self
range: range];
id *buffer = [self allocMemoryForNItems: range.length
buffer = [self allocMemoryForNItems: range.length
withSize: sizeof(*buffer)];
@try {
[self getObjects: buffer
inRange: range];
ret = [OFArray arrayWithCArray: buffer
|
︙ | | |
Modified src/OFArray_adjacent.m
from [f4dc3297f2]
to [831950ce9b].
︙ | | |
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
+
|
#include "config.h"
#include <stdarg.h>
#import "OFArray_adjacent.h"
#import "OFMutableArray_adjacent.h"
#import "OFArray_adjacentSubarray.h"
#import "OFDataArray.h"
#import "OFString.h"
#import "OFXMLElement.h"
#import "OFAutoreleasePool.h"
#import "OFEnumerationMutationException.h"
#import "OFInvalidArgumentException.h"
|
︙ | | |
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
|
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
|
+
+
+
+
+
+
-
+
-
+
+
|
return OF_INVALID_INDEX;
}
- (OFArray*)objectsInRange: (of_range_t)range
{
size_t count;
if (![self isKindOfClass: [OFMutableArray class]])
return [OFArray_adjacentSubarray arrayWithArray: self
range: range];
size_t count = [array count];
count = [array count];
if (range.start + range.length > count)
@throw [OFOutOfRangeException newWithClass: isa];
return [OFArray arrayWithCArray: (id*)[array cArray] + range.start
length: range.length];
}
- (BOOL)isEqual: (id)object
{
OFArray *otherArray;
id *cArray, *otherCArray;
size_t i, count;
if ([object class] != [OFArray_adjacent class] &&
[object class] != [OFMutableArray_adjacent class])
[object class] != [OFMutableArray_adjacent class] &&
[object class] != [OFArray_adjacentSubarray class])
return [super isEqual: object];
otherArray = object;
count = [array count];
if (count != [otherArray count])
|
︙ | | |
Added src/OFArray_adjacentSubarray.h version [7db578123a].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFArray_subarray.h"
@interface OFArray_adjacentSubarray: OFArray_subarray
@end
|
| | | | | | | | | | | | | | | | | | |
Added src/OFArray_adjacentSubarray.m version [995549be46].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#include "config.h"
#import "OFArray_adjacentSubarray.h"
#import "OFArray_adjacent.h"
#import "OFMutableArray_adjacent.h"
@implementation OFArray_adjacentSubarray
- (id*)cArray
{
return [array cArray] + range.start;
}
- (BOOL)isEqual: (id)object
{
OFArray *otherArray;
id *cArray, *otherCArray;
size_t i;
if ([object class] != [OFArray_adjacent class] &&
[object class] != [OFMutableArray_adjacent class] &&
[object class] != [OFArray_adjacentSubarray class])
return [super isEqual: object];
otherArray = object;
if (range.length != [otherArray count])
return NO;
cArray = [self cArray];
otherCArray = [otherArray cArray];
for (i = 0; i < range.length; i++)
if (![cArray[i] isEqual: otherCArray[i]])
return NO;
return YES;
}
#ifdef OF_HAVE_BLOCKS
- (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block
{
id *cArray = [self cArray];
size_t i;
BOOL stop = NO;
for (i = 0; i < range.length && !stop; i++)
block(cArray[i], i, &stop);
}
#endif
@end
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added src/OFArray_subarray.h version [92dc57f885].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFArray.h"
@interface OFArray_subarray: OFArray
{
OFArray *array;
of_range_t range;
}
+ arrayWithArray: (OFArray*)array
range: (of_range_t)range;
- initWithArray: (OFArray*)array
range: (of_range_t)range;
@end
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added src/OFArray_subarray.m version [bf200eb01f].