Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -98,18 +98,18 @@ - (id)objectAtIndex: (size_t)index; /** * \return The last object of the OFDataArray */ -- (id)last; +- (id)lastObject; /** * Adds an object to the OFDataArray. * * \param obj An object to add */ -- add: (OFObject*)obj; +- addObject: (OFObject*)obj; /** * Removes the specified amount of object from the end of the OFDataArray. * * \param nobjects The number of objects to remove Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -67,11 +67,11 @@ - initWithObject: (OFObject*)obj { self = [self init]; @try { - [array add: &obj]; + [array addItem: &obj]; } @catch (OFException *e) { [self dealloc]; @throw e; } @@ -99,13 +99,13 @@ id obj; self = [self init]; @try { - [array add: &first]; + [array addItem: &first]; while ((obj = va_arg(args, id)) != nil) { - [array add: &obj]; + [array addItem: &obj]; [obj retain]; } } @catch (OFException *e) { [self dealloc]; @throw e; @@ -120,11 +120,11 @@ self = [self init]; @try { for (obj = objs; *obj != nil; obj++) { - [array add: obj]; + [array addItem: obj]; [*obj retain]; } } @catch (OFException *e) { [self dealloc]; @throw e; @@ -169,13 +169,13 @@ - (id)objectAtIndex: (size_t)index { return *((OFObject**)[array itemAtIndex: index]); } -- (id)last +- (id)lastObject { - return *((OFObject**)[array last]); + return *((OFObject**)[array lastItem]); } - (BOOL)isEqual: (id)obj { OFObject **objs, **objs2; @@ -198,11 +198,11 @@ return NO; return YES; } -- add: (OFObject*)obj +- addObject: (OFObject*)obj { @throw [OFNotImplementedException newWithClass: isa andSelector: _cmd]; } Index: src/OFAutoreleasePool.h ================================================================== --- src/OFAutoreleasePool.h +++ src/OFAutoreleasePool.h @@ -28,20 +28,19 @@ * Adds an object to the autorelease pool at the top of the thread-specific * stack. * * \param obj The object to add to the autorelease pool */ -+ (void)addToPool: (OFObject*)obj; ++ (void)addObjectToTopmostPool: (OFObject*)obj; /** * Adds an object to the specific autorelease pool. - * stack. * * \param obj The object to add to the autorelease pool */ -- addToPool: (OFObject*)obj; +- addObject: (OFObject*)obj; /** * Releases all objects in the autorelease pool. */ - releaseObjects; @end Index: src/OFAutoreleasePool.m ================================================================== --- src/OFAutoreleasePool.m +++ src/OFAutoreleasePool.m @@ -42,11 +42,11 @@ return; pool_list_key = [[OFTLSKey alloc] initWithDestructor: release_list]; } -+ (void)addToPool: (OFObject*)obj ++ (void)addObjectToTopmostPool: (OFObject*)obj { OFList *pool_list = [OFThread objectForTLSKey: pool_list_key]; if (pool_list == nil || [pool_list last] == NULL) { @try { @@ -62,11 +62,11 @@ [obj release]; @throw [OFInitializationFailedException newWithClass: self]; } @try { - [[pool_list last]->object addToPool: obj]; + [[pool_list last]->object addObject: obj]; } @catch (OFException *e) { [obj release]; @throw e; } } @@ -123,16 +123,16 @@ [[OFThread objectForTLSKey: pool_list_key] remove: listobj]; [super dealloc]; } -- addToPool: (OFObject*)obj +- addObject: (OFObject*)obj { if (objects == nil) objects = [[OFMutableArray alloc] init]; - [objects add: obj]; + [objects addObject: obj]; [obj release]; return self; } Index: src/OFDataArray.h ================================================================== --- src/OFDataArray.h +++ src/OFDataArray.h @@ -75,18 +75,18 @@ - (void*)itemAtIndex: (size_t)index; /** * \return The last item of the OFDataArray */ -- (void*)last; +- (void*)lastItem; /** * Adds an item to the OFDataArray. * * \param item A pointer to an arbitrary item */ -- add: (void*)item; +- addItem: (void*)item; /** * Adds items from a C array to the OFDataArray. * * \param nitems The number of items to add Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -69,16 +69,16 @@ @throw [OFOutOfRangeException newWithClass: isa]; return data + index * itemsize; } -- (void*)last +- (void*)lastItem { return data + (count - 1) * itemsize; } -- add: (void*)item +- addItem: (void*)item { if (SIZE_MAX - count < 1) @throw [OFOutOfRangeException newWithClass: isa]; data = [self resizeMem: data @@ -191,11 +191,11 @@ lastpagebyte = getpagesize() - 1; return self; } -- add: (void*)item +- addItem: (void*)item { size_t nsize; if (SIZE_MAX - count < 1 || count + 1 > SIZE_MAX / itemsize) @throw [OFOutOfRangeException newWithClass: isa]; Index: src/OFMutableArray.m ================================================================== --- src/OFMutableArray.m +++ src/OFMutableArray.m @@ -31,13 +31,13 @@ [objs[i] retain]; return new; } -- add: (OFObject*)obj +- addObject: (OFObject*)obj { - [array add: &obj]; + [array addItem: &obj]; [obj retain]; return self; } Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -132,11 +132,11 @@ * This is useful to add memory allocated by functions such as asprintf to the * pool so it gets free'd automatically when the object is deallocated. * * \param ptr A pointer to add to the memory pool */ -- addToMemoryPool: (void*)ptr; +- addItemToMemoryPool: (void*)ptr; /** * Allocate memory and store it in the objects memory pool so it can be free'd * automatically when the object is deallocated. * Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -184,11 +184,11 @@ { /* Classes containing data should reimplement this! */ return (uint32_t)(intptr_t)self; } -- addToMemoryPool: (void*)ptr +- addItemToMemoryPool: (void*)ptr { void **memchunks; size_t memchunks_size; memchunks_size = PRE_IVAR->memchunks_size + 1; @@ -356,11 +356,11 @@ return self; } - autorelease { - [OFAutoreleasePool addToPool: self]; + [OFAutoreleasePool addObjectToTopmostPool: self]; return self; } - (size_t)retainCount Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -220,11 +220,11 @@ [super dealloc]; @throw [OFInvalidEncodingException newWithClass: c]; } @try { - [self addToMemoryPool: string]; + [self addItemToMemoryPool: string]; } @catch (OFException *e) { free(string); @throw e; } @@ -352,11 +352,11 @@ if (delim_len > length) { str = [self copy]; @try { - [array add: str]; + [array addObject: str]; } @finally { [str release]; } [array retain]; @@ -384,20 +384,20 @@ str = [OFString stringWithCString: tmp]; } @finally { free(tmp); } - [array add: str]; + [array addObject: str]; [array retain]; [pool releaseObjects]; i += delim_len - 1; last = i + 1; } - [array add: [OFString stringWithCString: string + last]]; + [array addObject: [OFString stringWithCString: string + last]]; [array retain]; [pool release]; return array; } @end Index: tests/OFArray/OFArray.m ================================================================== --- tests/OFArray/OFArray.m +++ tests/OFArray/OFArray.m @@ -43,28 +43,28 @@ { OFArray *a = [OFArray arrayWithObjects: @"Foo", @"Bar", @"Baz", nil]; OFArray *b = [OFMutableArray array]; OFArray *c = [OFArray arrayWithCArray: c_array]; - [b add: @"Foo"]; - [b add: @"Bar"]; - [b add: @"Baz"]; + [b addObject: @"Foo"]; + [b addObject: @"Bar"]; + [b addObject: @"Baz"]; assert([a count] == 3); assert([b count] == 3); assert([c count] == 3); assert([a isEqual: b]); assert([a isEqual: c]); [b removeNObjects: 1]; - [b add: @"Baz"]; + [b addObject: @"Baz"]; assert([a isEqual: b]); [b removeNObjects: 1]; - [b add: @"Qux"]; + [b addObject: @"Qux"]; assert(![a isEqual: b]); CATCH_EXCEPTION([a objectAtIndex: 3], OFOutOfRangeException) - CATCH_EXCEPTION([a add: @"foo"], OFNotImplementedException) + CATCH_EXCEPTION([a addObject: @"foo"], OFNotImplementedException) return 0; } Index: tests/OFDataArray/OFDataArray.m ================================================================== --- tests/OFDataArray/OFDataArray.m +++ tests/OFDataArray/OFDataArray.m @@ -42,43 +42,43 @@ OFOutOfRangeException) \ \ puts("Trying to add something after that error..."); \ p = [a allocWithSize: 4096]; \ memset(p, 255, 4096); \ - [a add: p]; \ - if (!memcmp([a last], p, 4096)) \ - puts("[a last] matches with p!"); \ + [a addItem: p]; \ + if (!memcmp([a lastItem], p, 4096)) \ + puts("[a lastItem] matches with p!"); \ else { \ - puts("[a last] does not match p!"); \ + puts("[a lastItem] does not match p!"); \ abort(); \ } \ [a freeMem: p]; \ \ puts("Adding more data..."); \ q = [a allocWithSize: 4096]; \ memset(q, 42, 4096); \ - [a add: q]; \ - if (!memcmp([a last], q, 4096)) \ - puts("[a last] matches with q!"); \ + [a addItem: q]; \ + if (!memcmp([a lastItem], q, 4096)) \ + puts("[a lastItem] matches with q!"); \ else { \ - puts("[a last] does not match q!"); \ + puts("[a lastItem] does not match q!"); \ abort(); \ } \ [a freeMem: q]; \ \ puts("Adding multiple items at once..."); \ p = [a allocWithSize: 8192]; \ memset(p, 64, 8192); \ [a addNItems: 2 \ fromCArray: p]; \ - if (!memcmp([a last], [a itemAtIndex: [a count] - 2], 4096) && \ + if (!memcmp([a lastItem], [a itemAtIndex: [a count] - 2], 4096) && \ !memcmp([a itemAtIndex: [a count] - 2], p, 4096)) \ - puts("[a last], [a itemAtIndex: [a count] - 2] and p " \ - "match!"); \ + puts("[a lastItem], [a itemAtIndex: [a count] - 2] " \ + "and p match!"); \ else { \ - puts("[a last], [a itemAtIndex: [a count] - 2] and p " \ - "do not match!"); \ + puts("[a lastItem], [a itemAtIndex: [a count] - 2] " \ + "and p do not match!"); \ abort(); \ } \ [a freeMem: p]; \ \ i = [a count]; \ @@ -101,12 +101,12 @@ \ puts("Creating new array and using it to build a string..."); \ a = [[type alloc] initWithItemSize: 1]; \ \ for (i = 0; i < strlen(str); i++) \ - [a add: (void*)&str[i]]; \ - [a add: ""]; \ + [a addItem: (void*)&str[i]]; \ + [a addItem: ""]; \ \ if (!strcmp([a data], str)) \ puts("Built string matches!"); \ else { \ puts("Built string does not match!"); \ @@ -142,11 +142,11 @@ if ([x hash] != [y hash]) { puts("FAIL 2!"); return 1; } - [x add: "x"]; + [x addItem: "x"]; if ([x isEqual: y]) { puts("FAIL 3!"); return 1; } [pool releaseObjects]; @@ -167,11 +167,11 @@ if ([x compare: y]) { puts("FAIL 5!"); return 1; } - [y add: "de"]; + [y addItem: "de"]; if ([x compare: y] != -100) { puts("FAIL 6!"); return 1; }