@@ -73,15 +73,15 @@ - initWithArray: (OFArray*)array { return (id)[[OFArray_adjacent alloc] initWithArray: array]; } -- initWithCArray: (id*)objects - length: (size_t)length +- initWithObjects: (id*)objects + count: (size_t)count { - return (id)[[OFArray_adjacent alloc] initWithCArray: objects - length: length]; + return (id)[[OFArray_adjacent alloc] initWithObjects: objects + count: count]; } - initWithSerialization: (OFXMLElement*)element { return (id)[[OFArray_adjacent alloc] initWithSerialization: element]; @@ -150,15 +150,15 @@ + arrayWithArray: (OFArray*)array { return [[[self alloc] initWithArray: array] autorelease]; } -+ arrayWithCArray: (id*)objects - length: (size_t)length ++ arrayWithObjects: (id*)objects + count: (size_t)count { - return [[[self alloc] initWithCArray: objects - length: length] autorelease]; + return [[[self alloc] initWithObjects: objects + count: count] autorelease]; } - init { if (isa == [OFArray class]) { @@ -204,12 +204,12 @@ [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } -- initWithCArray: (id*)objects - length: (size_t)length +- initWithObjects: (id*)objects + count: (size_t)count { Class c = isa; [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; @@ -236,11 +236,11 @@ for (i = 0; i < range.length; i++) buffer[i] = [self objectAtIndex: range.start + i]; } -- (id*)cArray +- (id*)objects { OFObject *container; size_t count; id *buffer; @@ -335,12 +335,12 @@ @try { [self getObjects: buffer inRange: range]; - ret = [OFArray arrayWithCArray: buffer - length: range.length]; + ret = [OFArray arrayWithObjects: buffer + count: range.length]; } @finally { [self freeMemory: buffer]; } return ret; @@ -355,11 +355,11 @@ - (OFString*)componentsJoinedByString: (OFString*)separator usingSelector: (SEL)selector { OFAutoreleasePool *pool, *pool2; OFMutableString *ret; - id *cArray; + id *objects; size_t i, count = [self count]; IMP append; if (count == 0) return @""; @@ -368,23 +368,23 @@ ret = [OFMutableString string]; append = [ret methodForSelector: @selector(appendString:)]; pool = [[OFAutoreleasePool alloc] init]; - cArray = [self cArray]; + objects = [self objects]; pool2 = [[OFAutoreleasePool alloc] init]; for (i = 0; i < count - 1; i++) { append(ret, @selector(appendString:), - [cArray[i] performSelector: selector]); + [objects[i] performSelector: selector]); append(ret, @selector(appendString:), separator); [pool2 releaseObjects]; } append(ret, @selector(appendString:), - [cArray[i] performSelector: selector]); + [objects[i] performSelector: selector]); [ret makeImmutable]; [pool release]; @@ -415,18 +415,18 @@ return YES; } - (uint32_t)hash { - id *cArray = [self cArray]; + id *objects = [self objects]; size_t i, count = [self count]; uint32_t hash; OF_HASH_INIT(hash); for (i = 0; i < count; i++) { - uint32_t h = [cArray[i] hash]; + uint32_t h = [objects[i] hash]; OF_HASH_ADD(hash, h >> 24); OF_HASH_ADD(hash, (h >> 16) & 0xFF); OF_HASH_ADD(hash, (h >> 8) & 0xFF); OF_HASH_ADD(hash, h & 0xFF); @@ -469,11 +469,11 @@ - (OFXMLElement*)XMLElementBySerializing { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFAutoreleasePool *pool2; OFXMLElement *element; - id *cArray = [self cArray]; + id *objects = [self objects]; size_t i, count = [self count]; if ([self isKindOfClass: [OFMutableArray class]]) element = [OFXMLElement elementWithName: @"OFMutableArray" namespace: OF_SERIALIZATION_NS]; @@ -482,11 +482,11 @@ namespace: OF_SERIALIZATION_NS]; pool2 = [[OFAutoreleasePool alloc] init]; for (i = 0; i < count; i++) { - [element addChild: [cArray[i] XMLElementBySerializing]]; + [element addChild: [objects[i] XMLElementBySerializing]]; [pool2 releaseObjects]; } [element retain]; @@ -515,27 +515,27 @@ return JSON; } - (void)makeObjectsPerformSelector: (SEL)selector { - id *cArray = [self cArray]; + id *objects = [self objects]; size_t i, count = [self count]; for (i = 0; i < count; i++) - ((void(*)(id, SEL))[cArray[i] - methodForSelector: selector])(cArray[i], selector); + ((void(*)(id, SEL))[objects[i] + methodForSelector: selector])(objects[i], selector); } - (void)makeObjectsPerformSelector: (SEL)selector withObject: (id)object { - id *cArray = [self cArray]; + id *objects = [self objects]; size_t i, count = [self count]; for (i = 0; i < count; i++) - ((void(*)(id, SEL, id))[cArray[i] - methodForSelector: selector])(cArray[i], selector, object); + ((void(*)(id, SEL, id))[objects[i] + methodForSelector: selector])(objects[i], selector, object); } - (OFArray*)sortedArray { OFMutableArray *new = [[self mutableCopy] autorelease]; @@ -570,11 +570,11 @@ if (state->state >= count) return 0; state->state = count; - state->itemsPtr = [self cArray]; + state->itemsPtr = [self objects]; state->mutationsPtr = (unsigned long*)self; return (int)count; } @@ -611,12 +611,12 @@ [self enumerateObjectsUsingBlock: ^ (id object, size_t index, BOOL *stop) { tmp[index] = block(object, index); }]; - ret = [OFArray arrayWithCArray: tmp - length: count]; + ret = [OFArray arrayWithObjects: tmp + count: count]; } @finally { [self freeMemory: tmp]; } return ret; @@ -636,12 +636,12 @@ BOOL *stop) { if (block(object, index)) tmp[i++] = object; }]; - ret = [OFArray arrayWithCArray: tmp - length: i]; + ret = [OFArray arrayWithObjects: tmp + count: i]; } @finally { [self freeMemory: tmp]; } return ret;