@@ -82,11 +82,12 @@ case OF_NUMBER_FLOAT: \ return (t)value.float_; \ case OF_NUMBER_DOUBLE: \ return (t)value.double_; \ default: \ - @throw [OFInvalidFormatException newWithClass: isa]; \ + @throw [OFInvalidFormatException \ + exceptionWithClass: isa]; \ } #define CALCULATE(o, n) \ switch (type) { \ case OF_NUMBER_BOOL: \ return [OFNumber numberWithBool: \ @@ -165,11 +166,12 @@ value.float_ o [n floatValue]]; \ case OF_NUMBER_DOUBLE: \ return [OFNumber numberWithDouble: \ value.double_ o [n doubleValue]]; \ default: \ - @throw [OFInvalidFormatException newWithClass: isa]; \ + @throw [OFInvalidFormatException \ + exceptionWithClass: isa]; \ } #define CALCULATE2(o, n) \ switch (type) { \ case OF_NUMBER_BOOL: \ return [OFNumber numberWithBool: \ @@ -243,14 +245,16 @@ case OF_NUMBER_UINTPTR: \ return [OFNumber numberWithUIntPtr: \ value.uintptr o [n uIntPtrValue]]; \ case OF_NUMBER_FLOAT: \ case OF_NUMBER_DOUBLE: \ - @throw [OFNotImplementedException newWithClass: isa \ - selector: _cmd]; \ + @throw [OFNotImplementedException \ + exceptionWithClass: isa \ + selector: _cmd]; \ default: \ - @throw [OFInvalidFormatException newWithClass: isa]; \ + @throw [OFInvalidFormatException \ + exceptionWithClass: isa]; \ } #define CALCULATE3(o) \ switch (type) { \ case OF_NUMBER_BOOL: \ return [OFNumber numberWithBool: value.bool_ o]; \ @@ -306,11 +310,12 @@ case OF_NUMBER_FLOAT: \ return [OFNumber numberWithFloat: value.float_ o]; \ case OF_NUMBER_DOUBLE: \ return [OFNumber numberWithDouble: value.double_ o]; \ default: \ - @throw [OFInvalidFormatException newWithClass: isa]; \ + @throw [OFInvalidFormatException \ + exceptionWithClass: isa]; \ } @implementation OFNumber + numberWithBool: (BOOL)bool_ { @@ -442,12 +447,12 @@ return [[[self alloc] initWithDouble: double_] autorelease]; } - init { - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; + @throw [OFNotImplementedException exceptionWithClass: isa + selector: _cmd]; } - initWithBool: (BOOL)bool_ { self = [super init]; @@ -716,12 +721,13 @@ OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFString *typeString; if (![[element name] isEqual: [self className]] || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: isa + selector: _cmd]; typeString = [[element attributeForName: @"type"] stringValue]; if ([typeString isEqual: @"boolean"]) { type = OF_NUMBER_BOOL; @@ -730,12 +736,12 @@ value.bool_ = YES; else if ([[element stringValue] isEqual: @"NO"]) value.bool_ = NO; else @throw [OFInvalidArgumentException - newWithClass: isa - selector: _cmd]; + exceptionWithClass: isa + selector: _cmd]; } else if ([typeString isEqual: @"unsigned"]) { /* * FIXME: This will fail if the value is bigger than * INTMAX_MAX! */ @@ -749,12 +755,13 @@ value.float_ = [element floatValue]; } else if ([typeString isEqual: @"double"]) { type = OF_NUMBER_DOUBLE; value.double_ = [element doubleValue]; } else - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: isa + selector: _cmd]; [pool release]; } @catch (id e) { [self release]; @throw e; @@ -1116,11 +1123,11 @@ numberWithFloat: fmodf(value.float_, [number floatValue])]; case OF_NUMBER_DOUBLE: return [OFNumber numberWithDouble: fmod(value.double_, [number doubleValue])]; default: - @throw [OFInvalidFormatException newWithClass: isa]; + @throw [OFInvalidFormatException exceptionWithClass: isa]; } } - copy { @@ -1160,11 +1167,11 @@ case OF_NUMBER_FLOAT: return [OFString stringWithFormat: @"%g", value.float_]; case OF_NUMBER_DOUBLE: return [OFString stringWithFormat: @"%lg", value.double_]; default: - @throw [OFInvalidFormatException newWithClass: isa]; + @throw [OFInvalidFormatException exceptionWithClass: isa]; } } - (OFXMLElement*)XMLElementBySerializing { @@ -1222,15 +1229,15 @@ [element setStringValue: [OFString stringWithFormat: @"%la", value.double_]]; break; default: - @throw [OFInvalidFormatException newWithClass: isa]; + @throw [OFInvalidFormatException exceptionWithClass: isa]; } [element retain]; [pool release]; [element autorelease]; return element; } @end