@@ -37,24 +37,12 @@ /** * @class OFNumber OFNumber.h ObjFW/OFNumber.h * * @brief Provides a way to store a number in an object. */ -#ifndef OF_NUMBER_M -OF_SUBCLASSING_RESTRICTED -#endif @interface OFNumber: OFValue -{ - union { - double float_; - long long signed_; - unsigned long long unsigned_; - } _value; - const char *_typeEncoding; -} - /** * @brief The OFNumber as a `bool`. */ @property (readonly, nonatomic) bool boolValue; @@ -121,12 +109,10 @@ /** * @brief The OFNumber as a string. */ @property (readonly, nonatomic) OFString *stringValue; -+ (instancetype)valueWithBytes: (const void *)bytes - objCType: (const char *)objCType OF_UNAVAILABLE; + (instancetype)valueWithPointer: (const void *)pointer OF_UNAVAILABLE; + (instancetype)valueWithNonretainedObject: (id)object OF_UNAVAILABLE; + (instancetype)valueWithRange: (OFRange)range OF_UNAVAILABLE; + (instancetype)valueWithPoint: (OFPoint)point OF_UNAVAILABLE; + (instancetype)valueWithSize: (OFSize)size OF_UNAVAILABLE; @@ -234,14 +220,10 @@ * @param value The `double` value which the OFNumber should contain * @return A new autoreleased OFNumber */ + (instancetype)numberWithDouble: (double)value; -- (instancetype)init OF_UNAVAILABLE; -- (instancetype)initWithBytes: (const void *)bytes - objCType: (const char *)objCType OF_UNAVAILABLE; - /** * @brief Initializes an already allocated OFNumber with the specified `bool`. * * @param value The `bool` value which the OFNumber should contain * @return An initialized OFNumber