@@ -19,11 +19,11 @@ @implementation OFMutableArray - copy { OFArray *new = [[OFArray alloc] init]; - OFObject **objs; + id *objs; size_t count, i; objs = [array cArray]; count = [array count]; @@ -34,32 +34,32 @@ [objs[i] retain]; return new; } -- (void)addObject: (OFObject*)obj +- (void)addObject: (id)obj { [array addItem: &obj]; [obj retain]; mutations++; } -- (void)addObject: (OFObject*)obj +- (void)addObject: (id)obj atIndex: (size_t)index { [array addItem: &obj atIndex: index]; [obj retain]; mutations++; } -- (void)replaceObject: (OFObject*)old - withObject: (OFObject*)new +- (void)replaceObject: (id)old + withObject: (id)new { - OFObject **objs = [array cArray]; + id *objs = [array cArray]; size_t i, count = [array count]; for (i = 0; i < count; i++) { if ([objs[i] isEqual: old]) { [new retain]; @@ -68,13 +68,13 @@ } } } - (id)replaceObjectAtIndex: (size_t)index - withObject: (OFObject*)obj + withObject: (id)obj { - OFObject **objs = [array cArray]; + id *objs = [array cArray]; id old; if (index >= [array count]) @throw [OFOutOfRangeException newWithClass: isa]; @@ -82,14 +82,14 @@ objs[index] = [obj retain]; return [old autorelease]; } -- (void)replaceObjectIdenticalTo: (OFObject*)old - withObject: (OFObject*)new +- (void)replaceObjectIdenticalTo: (id)old + withObject: (id)new { - OFObject **objs = [array cArray]; + id *objs = [array cArray]; size_t i, count = [array count]; for (i = 0; i < count; i++) { if (objs[i] == old) { [new retain]; @@ -97,18 +97,18 @@ objs[i] = new; } } } -- (void)removeObject: (OFObject*)obj +- (void)removeObject: (id)obj { - OFObject **objs = [array cArray]; + id *objs = [array cArray]; size_t i, count = [array count]; for (i = 0; i < count; i++) { if ([objs[i] isEqual: obj]) { - OFObject *obj = objs[i]; + id obj = objs[i]; [array removeItemAtIndex: i]; mutations++; [obj release]; @@ -126,13 +126,13 @@ i--; } } } -- (void)removeObjectIdenticalTo: (OFObject*)obj +- (void)removeObjectIdenticalTo: (id)obj { - OFObject **objs = [array cArray]; + id *objs = [array cArray]; size_t i, count = [array count]; for (i = 0; i < count; i++) { if (objs[i] == obj) { [array removeItemAtIndex: i]; @@ -165,19 +165,19 @@ return old; } - (void)removeNObjects: (size_t)nobjects { - OFObject **objs = [array cArray], **copy; + id *objs = [array cArray], *copy; size_t i, count = [array count]; if (nobjects > count) @throw [OFOutOfRangeException newWithClass: isa]; copy = [self allocMemoryForNItems: nobjects - withSize: sizeof(OFObject*)]; - memcpy(copy, objs + (count - nobjects), nobjects * sizeof(OFObject*)); + withSize: sizeof(id)]; + memcpy(copy, objs + (count - nobjects), nobjects * sizeof(id)); @try { [array removeNItems: nobjects]; mutations++; @@ -189,19 +189,19 @@ } - (void)removeNObjects: (size_t)nobjects atIndex: (size_t)index { - OFObject **objs = [array cArray], **copy; + id *objs = [array cArray], *copy; size_t i, count = [array count]; if (nobjects > count - index) @throw [OFOutOfRangeException newWithClass: isa]; copy = [self allocMemoryForNItems: nobjects - withSize: sizeof(OFObject*)]; - memcpy(copy, objs + index, nobjects * sizeof(OFObject*)); + withSize: sizeof(id)]; + memcpy(copy, objs + index, nobjects * sizeof(id)); @try { [array removeNItems: nobjects atIndex: index]; mutations++; @@ -237,11 +237,11 @@ } #ifdef OF_HAVE_BLOCKS - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block { - OFObject **objs = [array cArray]; + id *objs = [array cArray]; size_t i, count = [array count]; BOOL stop = NO; unsigned long mutations2 = mutations; for (i = 0; i < count && !stop; i++) { @@ -253,11 +253,11 @@ } } - (void)replaceObjectsUsingBlock: (of_array_replace_block_t)block { - OFObject **objs = [array cArray]; + id *objs = [array cArray]; size_t i, count = [array count]; BOOL stop = NO; unsigned long mutations2 = mutations; for (i = 0; i < count && !stop; i++) {