Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -46,18 +46,18 @@ @interface OFApplication: OFObject { OFString *programName; OFMutableArray *arguments; OFMutableDictionary *environment; - OFObject *delegate; + id delegate; } #ifdef OF_HAVE_PROPERTIES @property (readonly, retain) OFString *programName; @property (readonly, retain) OFArray *arguments; @property (readonly, retain) OFDictionary *environment; -@property (retain) OFObject *delegate; +@property (retain) id delegate; #endif /** * \return The only OFApplication instance in the application */ @@ -117,18 +117,18 @@ - (OFDictionary*)environment; /** * \return The delegate of the application */ -- (OFObject *)delegate; +- (id )delegate; /** * Sets the delegate of the application. * * \param delegate The delegate for the application */ -- (void)setDelegate: (OFObject *)delegate; +- (void)setDelegate: (id )delegate; /** * Starts the application after everything has been initialized. */ - (void)run; Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -31,20 +31,20 @@ static OFApplication *app = nil; static void atexit_handler() { - id delegate = [app delegate]; + id delegate = [app delegate]; [delegate applicationWillTerminate]; } int of_application_main(int argc, char *argv[], Class cls) { OFApplication *app; - OFObject *delegate = nil; + id delegate = nil; if (cls != Nil) delegate = [[cls alloc] init]; app = [OFApplication sharedApplication]; @@ -51,11 +51,11 @@ [app setArgumentCount: argc andArgumentValues: argv]; [app setDelegate: delegate]; - [delegate release]; + [(id)delegate release]; [app run]; return 0; } @@ -166,19 +166,19 @@ - (OFDictionary*)environment { return [[environment retain] autorelease]; } -- (OFObject *)delegate +- (id )delegate { - return [[delegate retain] autorelease]; + return [[(id)delegate retain] autorelease]; } -- (void)setDelegate: (OFObject *)delegate_ +- (void)setDelegate: (id )delegate_ { - [delegate_ retain]; - [delegate release]; + [(id)delegate_ retain]; + [(id)delegate release]; delegate = delegate_; } - (void)run { @@ -197,11 +197,11 @@ - (void)dealloc { [arguments release]; [environment release]; - [delegate release]; + [(id)delegate release]; [super dealloc]; } @end Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -38,82 +38,82 @@ * Creates a new OFArray with the specified object. * * \param obj An object * \return A new autoreleased OFArray */ -+ arrayWithObject: (OFObject*)obj; ++ arrayWithObject: (id)obj; /** * Creates a new OFArray with the specified objects, terminated by nil. * * \param first The first object in the array * \return A new autoreleased OFArray */ -+ arrayWithObjects: (OFObject*)first, ...; ++ arrayWithObjects: (id)first, ...; /** * Creates a new OFArray with the objects from the specified C array. * * \param objs A C array of objects, terminated with nil * \return A new autoreleased OFArray */ -+ arrayWithCArray: (OFObject**)objs; ++ arrayWithCArray: (id*)objs; /** * Creates a new OFArray with the objects from the specified C array of the * specified length. * * \param objs A C array of objects * \param len The length of the C array * \return A new autoreleased OFArray */ -+ arrayWithCArray: (OFObject**)objs ++ arrayWithCArray: (id*)objs length: (size_t)length; /** * Initializes an OFArray with the specified object. * * \param obj An object * \return An initialized OFArray */ -- initWithObject: (OFObject*)obj; +- initWithObject: (id)obj; /** * Initializes an OFArray with the specified objects. * * \param first The first object * \return An initialized OFArray */ -- initWithObjects: (OFObject*)first, ...; +- initWithObjects: (id)first, ...; /** * Initializes an OFArray with the specified object and a va_list. * * \param first The first object * \param args A va_list * \return An initialized OFArray */ -- initWithObject: (OFObject*)first +- initWithObject: (id)first argList: (va_list)args; /** * Initializes an OFArray with the objects from the specified C array. * * \param objs A C array of objects, terminated with nil * \return An initialized OFArray */ -- initWithCArray: (OFObject**)objs; +- initWithCArray: (id*)objs; /** * Initializes an OFArray with the objects from the specified C array of the * specified length. * * \param objs A C array of objects * \param len The length of the C array * \return An initialized OFArray */ -- initWithCArray: (OFObject**)objs +- initWithCArray: (id*)objs length: (size_t)len; /** * \return The number of objects in the array */ @@ -140,21 +140,21 @@ * object. * * \param obj The object whose index is returned * \return The index of the first object equivalent to the specified object */ -- (size_t)indexOfObject: (OFObject*)obj; +- (size_t)indexOfObject: (id)obj; /** * Returns the index of the first object that has the same address as the * specified object. * * \param obj The object whose index is returned * \return The index of the first object that has the same aaddress as * the specified object */ -- (size_t)indexOfObjectIdenticalTo: (OFObject*)obj; +- (size_t)indexOfObjectIdenticalTo: (id)obj; /** * Returns the first object of the array or nil. * * The returned object is not retained and autoreleased for performance Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -23,16 +23,16 @@ + array { return [[[self alloc] init] autorelease]; } -+ arrayWithObject: (OFObject*)obj ++ arrayWithObject: (id)obj { return [[[self alloc] initWithObject: obj] autorelease]; } -+ arrayWithObjects: (OFObject*)first, ... ++ arrayWithObjects: (id)first, ... { id ret; va_list args; va_start(args, first); @@ -41,16 +41,16 @@ va_end(args); return ret; } -+ arrayWithCArray: (OFObject**)objs ++ arrayWithCArray: (id*)objs { return [[[self alloc] initWithCArray: objs] autorelease]; } -+ arrayWithCArray: (OFObject**)objs ++ arrayWithCArray: (id*)objs length: (size_t)len { return [[[self alloc] initWithCArray: objs length: len] autorelease]; } @@ -58,12 +58,11 @@ - init { self = [super init]; @try { - array = [[OFDataArray alloc] - initWithItemSize: sizeof(OFObject*)]; + array = [[OFDataArray alloc] initWithItemSize: sizeof(id)]; } @catch (OFException *e) { /* * We can't use [super dealloc] on OS X here. Compiler bug? * [self dealloc] will do here as we check for nil in dealloc. */ @@ -72,11 +71,11 @@ } return self; } -- initWithObject: (OFObject*)obj +- initWithObject: (id)obj { self = [self init]; @try { [array addItem: &obj]; @@ -88,11 +87,11 @@ [obj retain]; return self; } -- initWithObjects: (OFObject*)first, ... +- initWithObjects: (id)first, ... { id ret; va_list args; va_start(args, first); @@ -101,11 +100,11 @@ va_end(args); return ret; } -- initWithObject: (OFObject*)first +- initWithObject: (id)first argList: (va_list)args { id obj; self = [self init]; @@ -122,11 +121,11 @@ } return self; } -- initWithCArray: (OFObject**)objs +- initWithCArray: (id*)objs { id *obj; size_t count; self = [self init]; @@ -150,11 +149,11 @@ } return self; } -- initWithCArray: (OFObject**)objs +- initWithCArray: (id*)objs length: (size_t)len { size_t i; self = [self init]; @@ -192,11 +191,11 @@ } - mutableCopy { OFArray *new = [[OFMutableArray alloc] init]; - OFObject **objs; + id *objs; size_t count, i; objs = [array cArray]; count = [array count]; @@ -212,11 +211,11 @@ - (id)objectAtIndex: (size_t)index { return *((id*)[array itemAtIndex: index]); } -- (size_t)indexOfObject: (OFObject*)obj +- (size_t)indexOfObject: (id)obj { id *objs = [array cArray]; size_t i, count = [array count]; if (objs == NULL) @@ -227,11 +226,11 @@ return i; return SIZE_MAX; } -- (size_t)indexOfObjectIdenticalTo: (OFObject*)obj +- (size_t)indexOfObjectIdenticalTo: (id)obj { id *objs = [array cArray]; size_t i, count = [array count]; if (objs == NULL) @@ -261,32 +260,38 @@ - (OFString*)componentsJoinedByString: (OFString*)separator { OFString *str; OFString **objs = [array cArray]; size_t i, count = [array count]; + Class cls; IMP append; if (count == 0) return @""; if (count == 1) return [objs[0] retain]; str = [OFMutableString string]; + cls = [OFString class]; append = [str methodForSelector: @selector(appendString:)]; for (i = 0; i < count - 1; i++) { + if (![objs[i] isKindOfClass: cls]) + @throw [OFInvalidArgumentException newWithClass: isa + selector: _cmd]; + append(str, @selector(appendString:), objs[i]); append(str, @selector(appendString:), separator); } append(str, @selector(appendString:), objs[i]); return str; } -- (BOOL)isEqual: (OFObject*)obj +- (BOOL)isEqual: (id)obj { - OFObject **objs, **objs2; + id *objs, *objs2; size_t i, count, count2; if (![obj isKindOfClass: [OFArray class]]) return NO; @@ -306,11 +311,11 @@ return YES; } - (uint32_t)hash { - OFObject **objs = [array cArray]; + id *objs = [array cArray]; size_t i, count = [array count]; uint32_t hash; OF_HASH_INIT(hash); @@ -352,11 +357,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; for (i = 0; i < count && !stop; i++) block(objs[i], i, &stop); @@ -363,11 +368,11 @@ } #endif - (void)dealloc { - OFObject **objs = [array cArray]; + id *objs = [array cArray]; size_t i, count = [array count]; for (i = 0; i < count; i++) [objs[i] release]; @@ -396,11 +401,11 @@ { if (mutationsPtr != NULL && *mutationsPtr != mutations) @throw [OFEnumerationMutationException newWithClass: isa]; if (pos < count) - return *(OFObject**)[array itemAtIndex: pos++]; + return *(id*)[array itemAtIndex: pos++]; return nil; } - (void)reset Index: src/OFAutoreleasePool.h ================================================================== --- src/OFAutoreleasePool.h +++ src/OFAutoreleasePool.h @@ -30,20 +30,20 @@ * 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)addObjectToTopmostPool: (OFObject*)obj; ++ (void)addObjectToTopmostPool: (id)obj; + (void)releaseAll; /** * Adds an object to the specific autorelease pool. * * \param obj The object to add to the autorelease pool */ -- (void)addObject: (OFObject*)obj; +- (void)addObject: (id)obj; /** * Releases all objects in the autorelease pool. * * This does not free the memory allocated to store pointers to the objects in Index: src/OFAutoreleasePool.m ================================================================== --- src/OFAutoreleasePool.m +++ src/OFAutoreleasePool.m @@ -37,11 +37,11 @@ if (!of_tlskey_new(&first_key) || !of_tlskey_new(&last_key)) @throw [OFInitializationFailedException newWithClass: self]; } #endif -+ (void)addObjectToTopmostPool: (OFObject*)obj ++ (void)addObjectToTopmostPool: (id)obj { #ifdef OF_THREADS id last = of_tlskey_get(last_key); #endif @@ -131,11 +131,11 @@ } return self; } -- (void)addObject: (OFObject*)obj +- (void)addObject: (id)obj { if (count + 1 > size) { objects = [self resizeMemory: objects toNItems: size + GROW_SIZE withSize: sizeof(id)]; Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -21,12 +21,12 @@ #endif /// \cond internal struct of_dictionary_bucket { - OFObject *key; - OFObject *object; + id key; + id object; uint32_t hash; }; /// \endcond /** @@ -64,12 +64,12 @@ * * \param key The key * \param obj The object * \return A new autoreleased OFDictionary */ -+ dictionaryWithObject: (OFObject*)obj - forKey: (OFObject *)key; ++ dictionaryWithObject: (id)obj + forKey: (id )key; /** * Creates a new OFDictionary with the specified keys and objects. * * \param keys An array of keys @@ -83,11 +83,11 @@ * Creates a new OFDictionary with the specified keys objects. * * \param key The first key * \return A new autoreleased OFDictionary */ -+ dictionaryWithKeysAndObjects: (OFObject *)key, ...; ++ dictionaryWithKeysAndObjects: (id )key, ...; /** * Initializes an already allocated OFDictionary. * * \return An initialized OFDictionary @@ -109,12 +109,12 @@ * * \param key The key * \param obj The object * \return A new initialized OFDictionary */ -- initWithObject: (OFObject*)obj - forKey: (OFObject *)key; +- initWithObject: (id)obj + forKey: (id )key; /** * Initializes an already allocated OFDictionary with the specified keys and * objects. * @@ -130,21 +130,21 @@ * objects. * * \param first The first key * \return A new initialized OFDictionary */ -- initWithKeysAndObjects: (OFObject *)first, ...; +- initWithKeysAndObjects: (id )first, ...; /** * Initializes an already allocated OFDictionary with the specified key and * va_list. * * \param first The first key * \param args A va_list of the other arguments * \return A new initialized OFDictionary */ -- initWithKey: (OFObject *)first +- initWithKey: (id )first argList: (va_list)args; /** * Returns the object for the given key or nil if the key was not found. * @@ -152,11 +152,11 @@ * reasons! * * \param key The key whose object should be returned * \return The object for the given key or nil if the key was not found */ -- (id)objectForKey: (OFObject *)key; +- (id)objectForKey: (id)key; /** * \return The number of objects in the dictionary */ - (size_t)count; Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -34,12 +34,12 @@ + dictionaryWithDictionary: (OFDictionary*)dict { return [[[self alloc] initWithDictionary: dict] autorelease]; } -+ dictionaryWithObject: (OFObject*)obj - forKey: (OFObject *)key ++ dictionaryWithObject: (id)obj + forKey: (id )key { return [[[self alloc] initWithObject: obj forKey: key] autorelease]; } @@ -48,11 +48,11 @@ { return [[[self alloc] initWithObjects: objs forKeys: keys] autorelease]; } -+ dictionaryWithKeysAndObjects: (OFObject *)first, ... ++ dictionaryWithKeysAndObjects: (id )first, ... { id ret; va_list args; va_start(args, first); @@ -117,11 +117,11 @@ size = dict->size; count = dict->count; for (i = 0; i < size; i++) { - OFObject *key; + id key; BUCKET *b; if (dict->data[i] == NULL || dict->data[i] == DELETED) continue; @@ -134,11 +134,11 @@ } @try { [dict->data[i]->object retain]; } @catch (OFException *e) { - [key release]; + [(id)key release]; [self dealloc]; @throw e; } b->key = key; @@ -148,12 +148,12 @@ } return self; } -- initWithObject: (OFObject*)obj - forKey: (OFObject *)key +- initWithObject: (id)obj + forKey: (id )key { uint32_t i; BUCKET *b; self = [self init]; @@ -173,11 +173,11 @@ */ [self dealloc]; @throw e; } - i = [key hash] & 1; + i = [(id)key hash] & 1; @try { b = [self allocMemoryWithSize: sizeof(BUCKET)]; key = [key copy]; } @catch (OFException *e) { @@ -186,18 +186,18 @@ } @try { [obj retain]; } @catch (OFException *e) { - [key release]; + [(id)key release]; [self dealloc]; @throw e; } b->key = key; b->object = obj; - b->hash = [key hash]; + b->hash = [(id)key hash]; data[i] = b; count = 1; return self; } @@ -245,27 +245,27 @@ hash = [keys_carray[i] hash]; last = size; for (j = hash & (size - 1); j < last && data[j] != NULL; j++) - if ([data[j]->key isEqual: keys_carray[i]]) + if ([(id)data[j]->key isEqual: keys_carray[i]]) break; /* In case the last bucket is already used */ if (j >= last) { last = hash & (size - 1); for (j = 0; j < last && data[j] != NULL; j++) - if ([data[j]->key isEqual: keys_carray[i]]) + if ([(id)data[j]->key isEqual: keys_carray[i]]) break; } /* Key not in dictionary */ if (j >= last || data[j] == NULL || - ![data[j]->key isEqual: keys_carray[i]]) { + ![(id)data[j]->key isEqual: keys_carray[i]]) { BUCKET *b; - OFObject *key; + id key; last = size; j = hash & (size - 1); for (; j < last && data[j] != NULL; j++); @@ -292,11 +292,11 @@ } @try { [objs_carray[i] retain]; } @catch (OFException *e) { - [key release]; + [(id)key release]; [self dealloc]; @throw e; } b->key = key; @@ -331,11 +331,11 @@ } return self; } -- initWithKeysAndObjects: (OFObject *)first, ... +- initWithKeysAndObjects: (id )first, ... { id ret; va_list args; va_start(args, first); @@ -344,23 +344,23 @@ va_end(args); return ret; } -- initWithKey: (OFObject *)key +- initWithKey: (id )key argList: (va_list)args { BUCKET *b; - OFObject *obj; + id obj; size_t i; uint32_t j, hash; va_list args2; self = [super init]; count = 1; - for (va_copy(args2, args); va_arg(args2, OFObject*) != nil; count++); + for (va_copy(args2, args); va_arg(args2, id) != nil; count++); count >>= 1; if (count > UINT32_MAX) { Class c = isa; [self dealloc]; @@ -397,19 +397,19 @@ [self dealloc]; @throw [OFInvalidArgumentException newWithClass: c selector: _cmd]; } - if ((obj = va_arg(args, OFObject*)) == nil) { + if ((obj = va_arg(args, id)) == nil) { Class c = isa; [self dealloc]; @throw [OFInvalidArgumentException newWithClass: c selector: _cmd]; } /* Add first key / object pair */ - hash = [key hash]; + hash = [(id)key hash]; j = hash & (size - 1); @try { b = [self allocMemoryWithSize: sizeof(BUCKET)]; key = [key copy]; @@ -419,11 +419,11 @@ } @try { [obj retain]; } @catch (OFException *e) { - [key release]; + [(id)key release]; [self dealloc]; @throw e; } b->key = key; @@ -432,39 +432,39 @@ data[j] = b; for (i = 1; i < count; i++) { uint32_t last; - key = va_arg(args, OFObject *); - obj = va_arg(args, OFObject*); + key = va_arg(args, id ); + obj = va_arg(args, id); if (key == nil || obj == nil) { Class c = isa; [self dealloc]; @throw [OFInvalidArgumentException newWithClass: c selector: _cmd]; } - hash = [key hash]; + hash = [(id)key hash]; last = size; for (j = hash & (size - 1); j < last && data[j] != NULL; j++) - if ([data[j]->key isEqual: key]) + if ([(id)data[j]->key isEqual: key]) break; /* In case the last bucket is already used */ if (j >= last) { last = hash & (size - 1); for (j = 0; j < last && data[j] != NULL; j++) - if ([data[j]->key isEqual: key]) + if ([(id)data[j]->key isEqual: key]) break; } /* Key not in dictionary */ if (j >= last || data[j] == NULL || - ![data[j]->key isEqual: key]) { + ![(id)data[j]->key isEqual: key]) { last = size; j = hash & (size - 1); for (; j < last && data[j] != NULL; j++); @@ -490,11 +490,11 @@ } @try { [obj retain]; } @catch (OFException *e) { - [key release]; + [(id)key release]; [self dealloc]; @throw e; } b->key = key; @@ -529,11 +529,11 @@ } return self; } -- (id)objectForKey: (OFObject *)key +- (id)objectForKey: (id)key { uint32_t i, hash, last; if (key == nil) @throw [OFInvalidArgumentException newWithClass: isa @@ -544,11 +544,11 @@ for (i = hash & (size - 1); i < last && data[i] != NULL; i++) { if (data[i] == DELETED) continue; - if ([data[i]->key isEqual: key]) + if ([(id)data[i]->key isEqual: key]) return data[i]->object; } if (i < last) return nil; @@ -558,11 +558,11 @@ for (i = 0; i < last && data[i] != NULL; i++) { if (data[i] == DELETED) continue; - if ([data[i]->key isEqual: key]) + if ([(id)data[i]->key isEqual: key]) return data[i]->object; } return nil; } @@ -654,11 +654,11 @@ { uint32_t i; for (i = 0; i < size; i++) { if (data[i] != NULL && data[i] != DELETED) { - [data[i]->key release]; + [(id)data[i]->key release]; [data[i]->object release]; } } [super dealloc]; Index: src/OFList.h ================================================================== --- src/OFList.h +++ src/OFList.h @@ -63,21 +63,21 @@ * \param obj The object to append * \return An of_list_object_t, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need * its of_list_object_t. */ -- (of_list_object_t*)appendObject: (OFObject*)obj; +- (of_list_object_t*)appendObject: (id)obj; /** * Prepends an object to the list. * * \param obj The object to prepend * \return An of_list_object_t, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need * its of_list_object_t. */ -- (of_list_object_t*)prependObject: (OFObject*)obj; +- (of_list_object_t*)prependObject: (id)obj; /** * Inserts an object before another object. * \param obj The object to insert * \param listobj The of_list_object_t of the object before which it should be @@ -84,11 +84,11 @@ * inserted * \return An of_list_object_t, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need * its of_list_object_t. */ -- (of_list_object_t*)insertObject: (OFObject*)obj +- (of_list_object_t*)insertObject: (id)obj beforeListObject: (of_list_object_t*)listobj; /** * Inserts an object after another object. * \param obj The object to insert @@ -96,11 +96,11 @@ * inserted * \return An of_list_object_t, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need * its of_list_object_t. */ -- (of_list_object_t*)insertObject: (OFObject*)obj +- (of_list_object_t*)insertObject: (id)obj afterListObject: (of_list_object_t*)listobj; /** * Removes the object with the specified list object from the list. * Index: src/OFList.m ================================================================== --- src/OFList.m +++ src/OFList.m @@ -51,11 +51,11 @@ - (of_list_object_t*)lastListObject; { return lastListObject; } -- (of_list_object_t*)appendObject: (OFObject*)obj +- (of_list_object_t*)appendObject: (id)obj { of_list_object_t *o; o = [self allocMemoryWithSize: sizeof(of_list_object_t)]; o->object = [obj retain]; @@ -74,11 +74,11 @@ [obj retain]; return o; } -- (of_list_object_t*)prependObject: (OFObject*)obj +- (of_list_object_t*)prependObject: (id)obj { of_list_object_t *o; o = [self allocMemoryWithSize: sizeof(of_list_object_t)]; o->object = [obj retain]; @@ -97,11 +97,11 @@ [obj retain]; return o; } -- (of_list_object_t*)insertObject: (OFObject*)obj +- (of_list_object_t*)insertObject: (id)obj beforeListObject: (of_list_object_t*)listobj { of_list_object_t *o; o = [self allocMemoryWithSize: sizeof(of_list_object_t)]; @@ -122,11 +122,11 @@ [obj retain]; return o; } -- (of_list_object_t*)insertObject: (OFObject*)obj +- (of_list_object_t*)insertObject: (id)obj afterListObject: (of_list_object_t*)listobj { of_list_object_t *o; o = [self allocMemoryWithSize: sizeof(of_list_object_t)]; @@ -171,11 +171,11 @@ - (size_t)count { return count; } -- (BOOL)isEqual: (OFObject*)obj +- (BOOL)isEqual: (id)obj { of_list_object_t *iter, *iter2; if (![obj isKindOfClass: [OFList class]]) return NO; Index: src/OFMutableArray.h ================================================================== --- src/OFMutableArray.h +++ src/OFMutableArray.h @@ -26,64 +26,64 @@ /** * Adds an object to the OFArray. * * \param obj An object to add */ -- (void)addObject: (OFObject*)obj; +- (void)addObject: (id)obj; /** * Adds an object to the OFArray at the specified index. * * \param obj An object to add * \param index The index where the object should be added */ -- (void)addObject: (OFObject*)obj +- (void)addObject: (id)obj atIndex: (size_t)index; /** * Replaces all objects equivalent to the first specified object with the * second specified object. * * \param old The object to replace * \param new The replacement object */ -- (void)replaceObject: (OFObject*)old - withObject: (OFObject*)new; +- (void)replaceObject: (id)old + withObject: (id)new; /** * Replaces the object at the specified index with the specified object. * * \param index The index of the object to replace * \param obj The replacement object * \return The old object, autoreleased */ - (id)replaceObjectAtIndex: (size_t)index - withObject: (OFObject*)obj; + withObject: (id)obj; /** * Replaces all objects that have the same address as the first specified object * with the second specified object. * * \param old The object to replace * \param new The replacement object */ -- (void)replaceObjectIdenticalTo: (OFObject*)old - withObject: (OFObject*)new; +- (void)replaceObjectIdenticalTo: (id)old + withObject: (id)new; /** * Removes all objects equivalent to the specified object. * * \param obj The object to remove */ -- (void)removeObject: (OFObject*)obj; +- (void)removeObject: (id)obj; /** * Removes all objects that have the same address as the specified object. * * \param obj The object to remove */ -- (void)removeObjectIdenticalTo: (OFObject*)obj; +- (void)removeObjectIdenticalTo: (id)obj; /** * Removes the object at the specified index. * * \param index The index of the object to remove Index: src/OFMutableArray.m ================================================================== --- src/OFMutableArray.m +++ src/OFMutableArray.m @@ -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++) { Index: src/OFMutableDictionary.h ================================================================== --- src/OFMutableDictionary.h +++ src/OFMutableDictionary.h @@ -28,19 +28,19 @@ * A key can be any object. * * \param key The key to set * \param obj The object to set the key to */ -- (void)setObject: (OFObject*)obj - forKey: (OFObject *)key; +- (void)setObject: (id)obj + forKey: (id )key; /** * Remove the object with the given key from the dictionary. * * \param key The key whose object should be removed */ -- (void)removeObjectForKey: (OFObject*)key; +- (void)removeObjectForKey: (id)key; #ifdef OF_HAVE_BLOCKS /** * Replaces each object with the object returned by the block. * Index: src/OFMutableDictionary.m ================================================================== --- src/OFMutableDictionary.m +++ src/OFMutableDictionary.m @@ -77,28 +77,28 @@ [self freeMemory: data]; data = newdata; size = newsize; } -- (void)setObject: (OFObject*)obj - forKey: (OFObject *)key +- (void)setObject: (id)obj + forKey: (id )key { uint32_t i, hash, last; id old; if (key == nil || obj == nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; - hash = [key hash]; + hash = [(id)key hash]; last = size; for (i = hash & (size - 1); i < last && data[i] != NULL; i++) { if (data[i] == DELETED) continue; - if ([data[i]->key isEqual: key]) + if ([(id)data[i]->key isEqual: key]) break; } /* In case the last bucket is already used */ if (i >= last) { @@ -106,18 +106,18 @@ for (i = 0; i < last && data[i] != NULL; i++) { if (data[i] == DELETED) continue; - if ([data[i]->key isEqual: key]) + if ([(id)data[i]->key isEqual: key]) break; } } /* Key not in dictionary */ if (i >= last || data[i] == NULL || data[i] == DELETED || - ![data[i]->key isEqual: key]) { + ![(id)data[i]->key isEqual: key]) { BUCKET *b; [self _resizeForCount: count + 1]; mutations++; @@ -147,11 +147,11 @@ @try { [obj retain]; } @catch (OFException *e) { [self freeMemory: b]; - [key release]; + [(id)key release]; @throw e; } b->key = key; b->object = obj; @@ -165,11 +165,11 @@ old = data[i]->object; data[i]->object = [obj retain]; [old release]; } -- (void)removeObjectForKey: (OFObject*)key +- (void)removeObjectForKey: (id)key { uint32_t i, hash, last; if (key == nil) @throw [OFInvalidArgumentException newWithClass: isa @@ -180,12 +180,12 @@ for (i = hash & (size - 1); i < last && data[i] != NULL; i++) { if (data[i] == DELETED) continue; - if ([data[i]->key isEqual: key]) { - [data[i]->key release]; + if ([(id)data[i]->key isEqual: key]) { + [(id)data[i]->key release]; [data[i]->object release]; [self freeMemory: data[i]]; data[i] = DELETED; count--; @@ -204,12 +204,12 @@ for (i = 0; i < last && data[i] != NULL; i++) { if (data[i] == DELETED) continue; - if ([data[i]->key isEqual: key]) { - [data[i]->key release]; + if ([(id)data[i]->key isEqual: key]) { + [(id)data[i]->key release]; [data[i]->object release]; [self freeMemory: data[i]]; data[i] = DELETED; count--; Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -216,11 +216,11 @@ * this! * * \param obj The object which should be tested for equality * \return A boolean whether the object is equal to the specified object */ -- (BOOL)isEqual: (OFObject*)obj; +- (BOOL)isEqual: (id)obj; /** * Calculates a hash for the object. * * Classes containing data (like strings, arrays, lists etc.) should reimplement Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -401,11 +401,11 @@ #else return objc_msg_lookup(self, selector); #endif } -- (BOOL)isEqual: (OFObject*)obj +- (BOOL)isEqual: (id)obj { /* Classes containing data should reimplement this! */ return (self == obj ? YES : NO); } Index: src/OFStreamObserver.h ================================================================== --- src/OFStreamObserver.h +++ src/OFStreamObserver.h @@ -52,11 +52,11 @@ /** * \brief A class that can observe multiple streams at once. */ @interface OFStreamObserver: OFObject { - OFObject *delegate; + id delegate; #ifdef OF_HAVE_POLL OFDataArray *fds; #else fd_set readfds; fd_set writefds; @@ -64,11 +64,11 @@ #endif OFMutableDictionary *fdToStream; } #ifdef OF_HAVE_PROPERTIES -@property (retain) OFObject *delegate; +@property (retain) id delegate; #endif /** * \return A new, autoreleased OFStreamObserver */ @@ -75,18 +75,18 @@ + streamObserver; /** * \return The delegate for the OFStreamObserver */ -- (OFObject *)delegate; +- (id )delegate; /** * Sets the delegate for the OFStreamObserver. * * \param delegate The delegate for the OFStreamObserver */ -- (void)setDelegate: (OFObject *)delegate; +- (void)setDelegate: (id )delegate; /** * Adds a stream to observe for reading. * * \param stream The stream to observe for reading Index: src/OFStreamObserver.m ================================================================== --- src/OFStreamObserver.m +++ src/OFStreamObserver.m @@ -46,28 +46,28 @@ return self; } - (void)dealloc { - [delegate release]; + [(id)delegate release]; #ifdef OF_HAVE_POLL [fds release]; #endif [fdToStream release]; [super dealloc]; } -- (OFObject *)delegate +- (id )delegate { - return [[delegate retain] autorelease]; + return [[(id)delegate retain] autorelease]; } -- (void)setDelegate: (OFObject *)delegate_ +- (void)setDelegate: (id )delegate_ { - [delegate_ retain]; - [delegate release]; + [(id)delegate_ retain]; + [(id)delegate release]; delegate = delegate_; } #ifdef OF_HAVE_POLL - (void)_addStream: (OFStream*)stream Index: src/OFString+XMLUnescaping.h ================================================================== --- src/OFString+XMLUnescaping.h +++ src/OFString+XMLUnescaping.h @@ -45,7 +45,7 @@ * entities. * * \param h An OFXMLUnescapingDelegate as a handler for unknown entities */ - (OFString*)stringByXMLUnescapingWithDelegate: - (OFObject *)delegate; + (id )delegate; @end Index: src/OFString+XMLUnescaping.m ================================================================== --- src/OFString+XMLUnescaping.m +++ src/OFString+XMLUnescaping.m @@ -73,11 +73,11 @@ { return [self stringByXMLUnescapingWithDelegate: nil]; } - (OFString*)stringByXMLUnescapingWithDelegate: - (OFObject *)delegate + (id )delegate { size_t i, last; BOOL in_entity; OFMutableString *ret; Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -85,11 +85,11 @@ * * \param key The Thread Local Storage key * \param obj The object the Thread Local Storage key will be set to * \return The old object, autoreleased */ -+ (id)setObject: (OFObject*)obj ++ (id)setObject: (id)obj forTLSKey: (OFTLSKey*)key; /** * Returns the object for the specified Thread Local Storage key. * Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -66,11 +66,11 @@ + threadWithObject: (id)obj { return [[[self alloc] initWithObject: obj] autorelease]; } -+ (id)setObject: (OFObject*)obj ++ (id)setObject: (id)obj forTLSKey: (OFTLSKey*)key { id old = of_tlskey_get(key->key); if (!of_tlskey_set(key->key, [obj retain])) Index: src/OFXMLElementBuilder.h ================================================================== --- src/OFXMLElementBuilder.h +++ src/OFXMLElementBuilder.h @@ -43,15 +43,15 @@ * setting the OFXMLElementBuilder as delegate for the parser. */ @interface OFXMLElementBuilder: OFObject { OFMutableArray *stack; - OFObject *delegate; + id delegate; } #ifdef OF_HAVE_PROPERTIES -@property (retain) OFObject *delegate; +@property (retain) id delegate; #endif /** * \return A new, autoreleased OFXMLElementBuilder */ @@ -58,14 +58,14 @@ + elementBuilder; /** * \return The delegate for the OFXMLElementBuilder */ -- (OFObject *)delegate; +- (id )delegate; /** * Sets the delegate for the OFXMLElementBuilder. * * \param delegate The delegate for the OFXMLElementBuilder */ -- (void)setDelegate: (OFObject *)delegate; +- (void)setDelegate: (id )delegate; @end Index: src/OFXMLElementBuilder.m ================================================================== --- src/OFXMLElementBuilder.m +++ src/OFXMLElementBuilder.m @@ -33,24 +33,24 @@ } - (void)dealloc { [stack release]; - [delegate release]; + [(id)delegate release]; [super dealloc]; } -- (OFObject *)delegate -{ - return [[delegate retain] autorelease]; -} - -- (void)setDelegate: (OFObject *)delegate_ -{ - [delegate_ retain]; - [delegate release]; +- (id )delegate +{ + return [[(id)delegate retain] autorelease]; +} + +- (void)setDelegate: (id )delegate_ +{ + [(id)delegate_ retain]; + [(id)delegate release]; delegate = delegate_; } - (void)parser: (OFXMLParser*)parser didStartElement: (OFString*)name Index: src/OFXMLParser.h ================================================================== --- src/OFXMLParser.h +++ src/OFXMLParser.h @@ -99,11 +99,11 @@ * OFXMLParser is an event-based XML parser which calls the delegate's callbacks * as soon asit finds something, thus suitable for streams as well. */ @interface OFXMLParser: OFObject { - OFObject *delegate; + id delegate; enum { OF_XMLPARSER_OUTSIDE_TAG, OF_XMLPARSER_TAG_OPENED, OF_XMLPARSER_IN_PROLOG, OF_XMLPARSER_IN_TAG_NAME, @@ -139,11 +139,11 @@ char delim; OFMutableArray *previous; } #ifdef OF_HAVE_PROPERTIES -@property (retain) OFObject *delegate; +@property (retain) id delegate; #endif /** * \return A new, autoreleased OFXMLParser */ @@ -150,18 +150,18 @@ + parser; /** * \return The delegate that is used by the XML parser */ -- (OFObject *)delegate; +- (id )delegate; /** * Sets the delegate the OFXMLParser should use. * * \param delegate The delegate to use */ -- (void)setDelegate: (OFObject *)delegate; +- (void)setDelegate: (id )delegate; /** * Parses a buffer with the specified size. * * \param buf The buffer to parse Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -105,11 +105,11 @@ return self; } - (void)dealloc { - [delegate release]; + [(id)delegate release]; [cache release]; [name release]; [prefix release]; [namespaces release]; @@ -119,19 +119,19 @@ [previous release]; [super dealloc]; } -- (OFObject *)delegate +- (id )delegate { - return [[delegate retain] autorelease]; + return [[(id)delegate retain] autorelease]; } -- (void)setDelegate: (OFObject *)delegate_ +- (void)setDelegate: (id )delegate_ { - [delegate_ retain]; - [delegate release]; + [(id)delegate_ retain]; + [(id)delegate release]; delegate = delegate_; } - (void)parseBuffer: (const char*)buf withSize: (size_t)size