Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -184,16 +184,16 @@ - (id*)cArray { return [array cArray]; } -- (id)copy +- copy { return [self retain]; } -- (id)mutableCopy +- mutableCopy { OFArray *new = [[OFMutableArray alloc] init]; OFObject **objs; size_t count, i; Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -184,11 +184,11 @@ /* We don't really care, as we only made it smaller */ [e dealloc]; } } -- (id)copy +- copy { OFDataArray *new = [[OFDataArray alloc] initWithItemSize: itemsize]; [new addNItems: count fromCArray: data]; @@ -354,15 +354,15 @@ data = [self resizeMemory: data toSize: nsize]; size = nsize; } -- (id)copy +- copy { OFDataArray *new = [[OFBigDataArray alloc] initWithItemSize: itemsize]; [new addNItems: count fromCArray: data]; return new; } @end Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -570,16 +570,16 @@ - (size_t)count { return count; } -- (id)copy +- copy { return [self retain]; } -- (id)mutableCopy +- mutableCopy { return [[OFMutableDictionary alloc] initWithDictionary: self]; } - (BOOL)isEqual: (OFDictionary*)dict Index: src/OFList.m ================================================================== --- src/OFList.m +++ src/OFList.m @@ -192,11 +192,11 @@ assert(iter == NULL && iter2 == NULL); return YES; } -- (id)copy +- copy { OFList *new = [[OFList alloc] init]; of_list_object_t *iter, *o, *prev; o = NULL; Index: src/OFMutableArray.m ================================================================== --- src/OFMutableArray.m +++ src/OFMutableArray.m @@ -16,11 +16,11 @@ #import "OFMutableArray.h" #import "OFDataArray.h" #import "OFExceptions.h" @implementation OFMutableArray -- (id)copy +- copy { OFArray *new = [[OFArray alloc] init]; OFObject **objs; size_t count, i; Index: src/OFMutableDictionary.m ================================================================== --- src/OFMutableDictionary.m +++ src/OFMutableDictionary.m @@ -225,11 +225,11 @@ } return nil; } -- (id)copy +- copy { return [[OFDictionary alloc] initWithDictionary: self]; } - (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -518,10 +518,10 @@ /* We don't really care, as we only made it smaller */ [e dealloc]; } } -- (id)copy +- copy { return [[OFString alloc] initWithString: self]; } @end Index: src/OFNumber.h ================================================================== --- src/OFNumber.h +++ src/OFNumber.h @@ -559,59 +559,59 @@ /** * \param num The OFNumber to add * \return A new autoreleased OFNumber added with the specified OFNumber */ -- (OFNumber*)add: (OFNumber*)num; +- (OFNumber*)numberByAdding: (OFNumber*)num; /** * \param num The OFNumber to substract * \return A new autoreleased OFNumber subtracted by the specified OFNumber */ -- (OFNumber*)subtract: (OFNumber*)num; +- (OFNumber*)numberBySubtracting: (OFNumber*)num; /** * \param num The OFNumber to multiply with * \return A new autoreleased OFNumber multiplied with the specified OFNumber */ -- (OFNumber*)multiplyWith: (OFNumber*)num; +- (OFNumber*)numberByMultiplyingWith: (OFNumber*)num; /** * \param num The OFNumber to divide by * \return A new autoreleased OFNumber devided by the specified OFNumber */ -- (OFNumber*)divideBy: (OFNumber*)num; +- (OFNumber*)numberByDividingBy: (OFNumber*)num; /** * ANDs two OFNumbers, returning a new one. * * Does not work with floating point types! * * \param num The number to AND with. * \return A new autoreleased OFNumber ANDed with the specified OFNumber */ -- (OFNumber*)and: (OFNumber*)num; +- (OFNumber*)numberByANDing: (OFNumber*)num; /** * ORs two OFNumbers, returning a new one. * * Does not work with floating point types! * * \param num The number to OR with. * \return A new autoreleased OFNumber ORed with the specified OFNumber */ -- (OFNumber*)or: (OFNumber*)num; +- (OFNumber*)numberByORing: (OFNumber*)num; /** * XORs two OFNumbers, returning a new one. * * Does not work with floating point types! * * \param num The number to XOR with. * \return A new autoreleased OFNumber XORed with the specified OFNumber */ -- (OFNumber*)xor: (OFNumber*)num; +- (OFNumber*)numberByXORing: (OFNumber*)num; /** * Bitshifts the OFNumber to the left by the specified OFNumber, returning a new * one. * @@ -619,11 +619,11 @@ * * \param num The number of bits to shift to the left * \return A new autoreleased OFNumber bitshifted to the left with the * specified OFNumber */ -- (OFNumber*)shiftLeft: (OFNumber*)num; +- (OFNumber*)numberByShiftingLeftBy: (OFNumber*)num; /** * Bitshifts the OFNumber to the right by the specified OFNumber, returning a * new one. * @@ -631,17 +631,17 @@ * * \param num The number of bits to shift to the right * \return A new autoreleased OFNumber bitshifted to the right with the * specified OFNumber */ -- (OFNumber*)shiftRight: (OFNumber*)num; +- (OFNumber*)numberByShiftingRightBy: (OFNumber*)num; /** * \return A new autoreleased OFNumber with the value increased by one. */ -- (OFNumber*)increase; +- (OFNumber*)numberByIncreasing; /** * \return A new autoreleased OFNumber with the value decreased by one. */ -- (OFNumber*)decrease; +- (OFNumber*)numberByDecreasing; @end Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -862,60 +862,60 @@ default: return [self asUInt32]; } } -- (OFNumber*)add: (OFNumber*)num +- (OFNumber*)numberByAdding: (OFNumber*)num { CALCULATE(+, num) } -- (OFNumber*)subtract: (OFNumber*)num +- (OFNumber*)numberBySubtracting: (OFNumber*)num { CALCULATE(-, num) } -- (OFNumber*)multiplyWith: (OFNumber*)num +- (OFNumber*)numberByMultiplyingWith: (OFNumber*)num { CALCULATE(*, num) } -- (OFNumber*)divideBy: (OFNumber*)num +- (OFNumber*)numberByDividingBy: (OFNumber*)num { CALCULATE(/, num) } -- (OFNumber*)and: (OFNumber*)num +- (OFNumber*)numberByANDing: (OFNumber*)num { CALCULATE2(&, num) } -- (OFNumber*)or: (OFNumber*)num +- (OFNumber*)numberByORing: (OFNumber*)num { CALCULATE2(|, num) } -- (OFNumber*)xor: (OFNumber*)num +- (OFNumber*)numberByXORing: (OFNumber*)num { CALCULATE2(^, num) } -- (OFNumber*)shiftLeft: (OFNumber*)num +- (OFNumber*)numberByShiftingLeftBy: (OFNumber*)num { CALCULATE2(<<, num) } -- (OFNumber*)shiftRight: (OFNumber*)num +- (OFNumber*)numberByShiftingRightBy: (OFNumber*)num { CALCULATE2(>>, num) } -- (OFNumber*)increase +- (OFNumber*)numberByIncreasing { CALCULATE3(+ 1) } -- (OFNumber*)decrease +- (OFNumber*)numberByDecreasing { CALCULATE3(- 1) } @end Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -332,11 +332,11 @@ */ @protocol OFCopying /** * \return A copy of the object */ -- (id)copy; +- copy; @end /** * \brief A protocol for the creation of mutable copies. * @@ -345,9 +345,9 @@ */ @protocol OFMutableCopying /** * \return A copy of the object */ -- (id)mutableCopy; +- mutableCopy; @end extern size_t of_pagesize; Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -620,20 +620,20 @@ free((char*)self - PRE_IVAR_ALIGN); } /* Required to use properties with the Apple runtime */ -- (id)copyWithZone: (void*)zone +- copyWithZone: (void*)zone { if (zone != NULL) @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; return [(id)self copy]; } -- (id)mutableCopyWithZone: (void*)zone +- mutableCopyWithZone: (void*)zone { if (zone != NULL) @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; @@ -707,17 +707,17 @@ { @throw [OFNotImplementedException newWithClass: self selector: _cmd]; } -+ (id)copyWithZone: (void*)zone ++ copyWithZone: (void*)zone { @throw [OFNotImplementedException newWithClass: self selector: _cmd]; } -+ (id)mutableCopyWithZone: (void*)zone ++ mutableCopyWithZone: (void*)zone { @throw [OFNotImplementedException newWithClass: self selector: _cmd]; } @end Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -717,16 +717,16 @@ return NO; return YES; } -- (id)copy +- copy { return [self retain]; } -- (id)mutableCopy +- mutableCopy { return [[OFMutableString alloc] initWithString: self]; } - (of_comparison_result_t)compare: (OFString*)str Index: tests/OFNumberTests.m ================================================================== --- tests/OFNumberTests.m +++ tests/OFNumberTests.m @@ -33,20 +33,24 @@ TEST(@"-[hash]", [num hash] == 123456789) TEST(@"-[asDouble]", [num asDouble] == 123456789.L) - TEST(@"-[decrease]", - [[num decrease] isEqual: [OFNumber numberWithInt32: 123456788]]) - - TEST(@"-[divideBy:]", - [[num divideBy: [OFNumber numberWithInt: 2]] asInt] == 61728394) - - TEST(@"-[xor:]", - [[num xor: [OFNumber numberWithInt: 123456831]] asInt] == 42) - - TEST(@"-[shiftRight:]", - [[num shiftRight: [OFNumber numberWithInt: 8]] asInt] == 482253) + TEST(@"-[numberByDecreasing]", + [[num numberByDecreasing] + isEqual: [OFNumber numberWithInt32: 123456788]]) + + TEST(@"-[numberByDividingBy:]", + [[num numberByDividingBy: [OFNumber numberWithInt: 2]] asInt] == + 61728394) + + TEST(@"-[numberByXORing:]", + [[num numberByXORing: [OFNumber numberWithInt: 123456831]] asInt] == + 42) + + TEST(@"-[numberByShiftingRightBy:]", + [[num numberByShiftingRightBy: [OFNumber numberWithInt: 8]] + asInt] == 482253) [pool drain]; } @end