Index: src/OFNumber.h ================================================================== --- src/OFNumber.h +++ src/OFNumber.h @@ -36,11 +36,10 @@ OF_NUMBER_UINTMAX, OF_NUMBER_PTRDIFF, OF_NUMBER_INTPTR, OF_NUMBER_FLOAT, OF_NUMBER_DOUBLE, - OF_NUMBER_LONG_DOUBLE }; /** * The OFNumber class provides a way to store a number in an object and * manipulate it. @@ -70,11 +69,10 @@ uintmax_t uintmax; ptrdiff_t ptrdiff; intptr_t intptr; float float_; double double_; - long double longdouble; } value; enum of_number_type type; } + numberWithChar: (char)char_; @@ -99,11 +97,10 @@ + numberWithUIntMax: (uintmax_t)uintmax; + numberWithPtrDiff: (ptrdiff_t)ptrdiff; + numberWithIntPtr: (intptr_t)intptr; + numberWithFloat: (float)float_; + numberWithDouble: (double)double_; -+ numberWithLongDouble: (long double)longdouble; - initWithChar: (char)char_; - initWithShort: (short)short_; - initWithInt: (int)int_; - initWithLong: (long)long_; @@ -125,11 +122,10 @@ - initWithUIntMax: (uintmax_t)uintmax; - initWithPtrDiff: (ptrdiff_t)ptrdiff; - initWithIntPtr: (intptr_t)intptr; - initWithFloat: (float)float_; - initWithDouble: (double)double_; -- initWithLongDouble: (long double)longdouble; - (enum of_number_type)type; - (char)asChar; - (short)asShort; @@ -153,7 +149,6 @@ - (uintmax_t)asUIntMax; - (ptrdiff_t)asPtrDiff; - (intptr_t)asIntPtr; - (float)asFloat; - (double)asDouble; -- (long double)asLongDouble; @end Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -62,12 +62,10 @@ return (t)value.intptr; \ case OF_NUMBER_FLOAT: \ return (t)value.float_; \ case OF_NUMBER_DOUBLE: \ return (t)value.double_; \ - case OF_NUMBER_LONG_DOUBLE: \ - return (t)value.longdouble; \ default: \ @throw [OFInvalidFormatException newWithClass: isa]; \ return 0; /* Make gcc happy */ \ } @@ -190,15 +188,10 @@ + numberWithDouble: (double)double_ { return [[[OFNumber alloc] initWithDouble: double_] autorelease]; } -+ numberWithLongDouble: (long double)longdouble -{ - return [[[OFNumber alloc] initWithLongDouble: longdouble] autorelease]; -} - - initWithChar: (char)char_ { if ((self = [super init])) { value.char_ = char_; type = OF_NUMBER_CHAR; @@ -435,20 +428,10 @@ } return self; } -- initWithLongDouble: (long double)longdouble -{ - if ((self = [super init])) { - value.longdouble = longdouble; - type = OF_NUMBER_LONG_DOUBLE; - } - - return self; -} - - (enum of_number_type)type { return type; } @@ -607,12 +590,11 @@ case OF_NUMBER_UINTMAX: case OF_NUMBER_INTPTR: return ([obj asUIntMax] == [self asUIntMax] ? YES : NO); case OF_NUMBER_FLOAT: case OF_NUMBER_DOUBLE: - case OF_NUMBER_LONG_DOUBLE: - return ([obj asLongDouble] == [self asLongDouble] ? YES : NO); + return ([obj asDouble] == [self asDouble] ? YES : NO); default: @throw [OFInvalidArgumentException newWithClass: isa andSelector: _cmd]; } }