Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -102,21 +102,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: (id)obj; +- (size_t)indexOfObject: (OFObject*)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: (id)obj; +- (size_t)indexOfObjectIdenticalTo: (OFObject*)obj; /** * \return The first object of the OFArray or nil */ - (id)firstObject; @@ -127,14 +127,14 @@ - (id)lastObject; - addObject: (OFObject*)obj; - addObject: (OFObject*)obj atIndex: (size_t)index; -- removeObject: (id)obj; -- removeObjectIdenticalTo: (id)obj; +- removeObject: (OFObject*)obj; +- removeObjectIdenticalTo: (OFObject*)obj; - removeObjectAtIndex: (size_t)index; - removeNObjects: (size_t)nobjects; - removeNObjects: (size_t)nobjects atIndex: (size_t)index; @end #import "OFMutableArray.h" Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -170,11 +170,11 @@ - (id)objectAtIndex: (size_t)index { return *((OFObject**)[array itemAtIndex: index]); } -- (size_t)indexOfObject: (id)obj +- (size_t)indexOfObject: (OFObject*)obj { id *objs = [array cArray]; size_t i, count = [array count]; if (objs == NULL) @@ -185,11 +185,11 @@ return i; return SIZE_MAX; } -- (size_t)indexOfObjectIdenticalTo: (id)obj +- (size_t)indexOfObjectIdenticalTo: (OFObject*)obj { id *objs = [array cArray]; size_t i, count = [array count]; if (objs == NULL) @@ -214,26 +214,26 @@ id *last = [array lastItem]; return (last != NULL ? *last : nil); } -- (BOOL)isEqual: (id)obj +- (BOOL)isEqual: (OFObject*)obj { OFObject **objs, **objs2; size_t i, count, count2; if (![obj isKindOfClass: [OFArray class]]) return NO; count = [array count]; - count2 = [obj count]; + count2 = [(OFArray*)obj count]; if (count != count2) return NO; objs = [array cArray]; - objs2 = [obj cArray]; + objs2 = [(OFArray*)obj cArray]; for (i = 0; i < count; i++) if (![objs[i] isEqual: objs2[i]]) return NO; @@ -286,17 +286,17 @@ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- removeObject: (id)obj +- removeObject: (OFObject*)obj { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- removeObjectIdenticalTo: (id)obj +- removeObjectIdenticalTo: (OFObject*)obj { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -210,17 +210,18 @@ fromCArray: data]; return new; } -- (BOOL)isEqual: (id)obj +- (BOOL)isEqual: (OFObject*)obj { if (![obj isKindOfClass: [OFDataArray class]]) return NO; - if ([obj count] != count || [obj itemsize] != itemsize) + if ([(OFDataArray*)obj count] != count || + [(OFDataArray*)obj itemsize] != itemsize) return NO; - if (memcmp([obj cArray], data, count * itemsize)) + if (memcmp([(OFDataArray*)obj cArray], data, count * itemsize)) return NO; return YES; } Index: src/OFList.h ================================================================== --- src/OFList.h +++ src/OFList.h @@ -56,21 +56,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*)append: (id)obj; +- (of_list_object_t*)append: (OFObject*)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*)prepend: (id)obj; +- (of_list_object_t*)prepend: (OFObject*)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 @@ -77,11 +77,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*)insert: (id)obj +- (of_list_object_t*)insert: (OFObject*)obj before: (of_list_object_t*)listobj; /** * Inserts an object after another object. * \param obj The object to insert @@ -89,11 +89,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*)insert: (id)obj +- (of_list_object_t*)insert: (OFObject*)obj after: (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*)last { return last; } -- (of_list_object_t*)append: (id)obj +- (of_list_object_t*)append: (OFObject*)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*)prepend: (id)obj +- (of_list_object_t*)prepend: (OFObject*)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*)insert: (id)obj +- (of_list_object_t*)insert: (OFObject*)obj before: (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*)insert: (id)obj +- (of_list_object_t*)insert: (OFObject*)obj after: (of_list_object_t*)listobj { of_list_object_t *o; o = [self allocMemoryWithSize: sizeof(of_list_object_t)]; @@ -173,22 +173,22 @@ - (size_t)count { return count; } -- (BOOL)isEqual: (id)obj +- (BOOL)isEqual: (OFObject*)obj { of_list_object_t *iter, *iter2; if (![obj isKindOfClass: [OFList class]]) return NO; - if ([obj count] != count) + if ([(OFList*)obj count] != count) return NO; - for (iter = first, iter2 = [obj first]; iter != NULL && iter2 != NULL; - iter = iter->next, iter2 = iter2->next) + for (iter = first, iter2 = [(OFList*)obj first]; iter != NULL && + iter2 != NULL; iter = iter->next, iter2 = iter2->next) if (![iter->object isEqual: iter2->object]) return NO; /* One is bigger than the other although we checked the count */ assert(iter == NULL && iter2 == NULL); Index: src/OFMutableArray.h ================================================================== --- src/OFMutableArray.h +++ src/OFMutableArray.h @@ -35,18 +35,18 @@ /** * Removes the first object equivalent to the specified object. * * \param obj The object to remove */ -- removeObject: (id)obj; +- removeObject: (OFObject*)obj; /** * Removes the first object that has the same address as the specified object. * * \param obj The object to remove */ -- removeObjectIdenticalTo: (id)obj; +- removeObjectIdenticalTo: (OFObject*)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 @@ -49,11 +49,11 @@ [obj retain]; return self; } -- removeObject: (id)obj +- removeObject: (OFObject*)obj { OFObject **objs = [array cArray]; size_t i, count = [array count]; for (i = 0; i < count; i++) { @@ -65,11 +65,11 @@ } return self; } -- removeObjectIdenticalTo: (id)obj +- removeObjectIdenticalTo: (OFObject*)obj { OFObject **objs = [array cArray]; size_t i, count = [array count]; for (i = 0; i < count; i++) { Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -717,11 +717,11 @@ - (long double)asLongDouble { RETURN_AS(long double) } -- (BOOL)isEqual: (id)obj +- (BOOL)isEqual: (OFObject*)obj { if (![obj isKindOfClass: [OFNumber class]]) return NO; switch (type) { @@ -733,11 +733,12 @@ case OF_NUMBER_INT16: case OF_NUMBER_INT32: case OF_NUMBER_INT64: case OF_NUMBER_INTMAX: case OF_NUMBER_PTRDIFF: - return ([obj asIntMax] == [self asIntMax] ? YES : NO); + return ([(OFNumber*)obj asIntMax] == [self asIntMax] + ? YES : NO); case OF_NUMBER_SSIZE: case OF_NUMBER_UCHAR: case OF_NUMBER_USHORT: case OF_NUMBER_UINT: case OF_NUMBER_ULONG: @@ -746,14 +747,16 @@ case OF_NUMBER_UINT32: case OF_NUMBER_UINT64: case OF_NUMBER_SIZE: case OF_NUMBER_UINTMAX: case OF_NUMBER_INTPTR: - return ([obj asUIntMax] == [self asUIntMax] ? YES : NO); + return ([(OFNumber*)obj asUIntMax] == [self asUIntMax] + ? YES : NO); case OF_NUMBER_FLOAT: case OF_NUMBER_DOUBLE: - return ([obj asDouble] == [self asDouble] ? YES : NO); + return ([(OFNumber*)obj asDouble] == [self asDouble] + ? YES : NO); default: @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; } } Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -175,11 +175,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: (id)obj; +- (BOOL)isEqual: (OFObject*)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 @@ -256,11 +256,11 @@ else return method_get_imp(class_get_class_method(isa, selector)); #endif } -- (BOOL)isEqual: (id)obj +- (BOOL)isEqual: (OFObject*)obj { /* Classes containing data should reimplement this! */ return (self == obj ? YES : NO); } Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -546,15 +546,15 @@ - (size_t)cStringLength { return length; } -- (BOOL)isEqual: (id)obj +- (BOOL)isEqual: (OFObject*)obj { if (![obj isKindOfClass: [OFString class]]) return NO; - if (strcmp(string, [obj cString])) + if (strcmp(string, [(OFString*)obj cString])) return NO; return YES; } Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -57,11 +57,11 @@ * To use it, you should create a new class derived from it and reimplement * main. */ @interface OFThread: OFObject { - id object; + OFObject *object; of_thread_t thread; BOOL running; @public id retval; @@ -69,11 +69,11 @@ /** * \param obj An object that is passed to the main method as a copy or nil * \return A new autoreleased thread */ -+ threadWithObject: (id)obj; ++ threadWithObject: (OFObject *)obj; /** * Sets the Thread Local Storage for the specified key. * * The specified object is first retained and then the object stored before is @@ -81,11 +81,11 @@ * released and don't want any new object for the TLS key. * * \param key The Thread Local Storage key * \param obj The object the Thread Local Storage key will be set to */ -+ setObject: (id)obj ++ setObject: (OFObject*)obj forTLSKey: (OFTLSKey*)key; /** * Returns the object for the specified Thread Local Storage key. * @@ -95,11 +95,11 @@ /** * \param obj An object that is passed to the main method as a copy or nil * \return An initialized OFThread. */ -- initWithObject: (id)obj; +- initWithObject: (OFObject *)obj; /** * The main routine of the thread. You need to reimplement this! * * It can access the object passed to the threadWithObject or initWithObject Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -34,16 +34,16 @@ return 0; } @implementation OFThread -+ threadWithObject: (id)obj ++ threadWithObject: (OFObject *)obj { return [[[self alloc] initWithObject: obj] autorelease]; } -+ setObject: (id)obj ++ setObject: (OFObject*)obj forTLSKey: (OFTLSKey*)key { id old = of_tlskey_get(key->key); if (!of_tlskey_set(key->key, [obj retain])) @@ -64,11 +64,11 @@ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithObject: (id)obj +- initWithObject: (OFObject *)obj { self = [super init]; object = [obj copy]; if (!of_thread_new(&thread, call_main, self)) {