@@ -148,16 +148,16 @@ @implementation OFNumberPlaceholder - (instancetype)initWithBool: (bool)value { if (value) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, trueNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, trueNumberInit); return (id)trueNumber; } else { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, falseNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, falseNumberInit); return (id)falseNumber; } } #ifdef __clang__ @@ -165,12 +165,12 @@ # pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare" #endif - (instancetype)initWithChar: (signed char)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, charZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, charZeroNumberInit); return (id)charZeroNumber; #ifdef OF_OBJFW_RUNTIME } else if ((unsigned char)value <= (UINTPTR_MAX >> TAG_BITS)) { id ret = objc_createTaggedPointer(numberTag, ((uintptr_t)(unsigned char)value << TAG_BITS) | TAG_CHAR); @@ -184,12 +184,12 @@ } - (instancetype)initWithShort: (short)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, shortZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, shortZeroNumberInit); return (id)shortZeroNumber; #ifdef OF_OBJFW_RUNTIME } else if ((unsigned short)value <= (UINTPTR_MAX >> TAG_BITS)) { id ret = objc_createTaggedPointer(numberTag, ((uintptr_t)(unsigned short)value << TAG_BITS) | TAG_SHORT); @@ -203,12 +203,12 @@ } - (instancetype)initWithInt: (int)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, intZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, intZeroNumberInit); return (id)intZeroNumber; #ifdef OF_OBJFW_RUNTIME } else if ((unsigned int)value <= (UINTPTR_MAX >> TAG_BITS)) { id ret = objc_createTaggedPointer(numberTag, ((uintptr_t)(unsigned int)value << TAG_BITS) | TAG_INT); @@ -222,12 +222,12 @@ } - (instancetype)initWithLong: (long)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, longZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, longZeroNumberInit); return (id)longZeroNumber; #ifdef OF_OBJFW_RUNTIME } else if ((unsigned long)value <= (UINTPTR_MAX >> TAG_BITS)) { id ret = objc_createTaggedPointer(numberTag, ((uintptr_t)(unsigned long)value << TAG_BITS) | TAG_LONG); @@ -241,12 +241,12 @@ } - (instancetype)initWithLongLong: (long long)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, longLongZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, longLongZeroNumberInit); return (id)longLongZeroNumber; #ifdef OF_OBJFW_RUNTIME } else if ((unsigned long long)value <= (UINTPTR_MAX >> TAG_BITS)) { id ret = objc_createTaggedPointer(numberTag, ((uintptr_t)(unsigned long long)value << TAG_BITS) | @@ -261,12 +261,12 @@ } - (instancetype)initWithUnsignedChar: (unsigned char)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, unsignedCharZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, unsignedCharZeroNumberInit); return (id)unsignedCharZeroNumber; #ifdef OF_OBJFW_RUNTIME } else if (value <= (UINTPTR_MAX >> TAG_BITS)) { id ret = objc_createTaggedPointer(numberTag, ((uintptr_t)value << TAG_BITS) | TAG_UNSIGNED_CHAR); @@ -280,12 +280,12 @@ } - (instancetype)initWithUnsignedShort: (unsigned short)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, unsignedShortZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, unsignedShortZeroNumberInit); return (id)unsignedShortZeroNumber; #ifdef OF_OBJFW_RUNTIME } else if (value <= (UINTPTR_MAX >> TAG_BITS)) { id ret = objc_createTaggedPointer(numberTag, ((uintptr_t)value << TAG_BITS) | TAG_UNSIGNED_SHORT); @@ -299,12 +299,12 @@ } - (instancetype)initWithUnsignedInt: (unsigned int)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, unsignedIntZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, unsignedIntZeroNumberInit); return (id)unsignedIntZeroNumber; #ifdef OF_OBJFW_RUNTIME } else if (value <= (UINTPTR_MAX >> TAG_BITS)) { id ret = objc_createTaggedPointer(numberTag, ((uintptr_t)value << TAG_BITS) | TAG_UNSIGNED_INT); @@ -318,12 +318,12 @@ } - (instancetype)initWithUnsignedLong: (unsigned long)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, unsignedLongZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, unsignedLongZeroNumberInit); return (id)unsignedLongZeroNumber; #ifdef OF_OBJFW_RUNTIME } else if (value <= (UINTPTR_MAX >> TAG_BITS)) { id ret = objc_createTaggedPointer(numberTag, ((uintptr_t)value << TAG_BITS) | TAG_UNSIGNED_LONG); @@ -337,12 +337,12 @@ } - (instancetype)initWithUnsignedLongLong: (unsigned long long)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, unsignedLongLongZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, unsignedLongLongZeroNumberInit); return (id)unsignedLongLongZeroNumber; #ifdef OF_OBJFW_RUNTIME } else if (value <= (UINTPTR_MAX >> TAG_BITS)) { id ret = objc_createTaggedPointer(numberTag, ((uintptr_t)value << TAG_BITS) | TAG_UNSIGNED_LONG_LONG); @@ -356,23 +356,23 @@ } - (instancetype)initWithFloat: (float)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, floatZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, floatZeroNumberInit); return (id)floatZeroNumber; } return (id)[[OFNumber of_alloc] initWithFloat: value]; } - (instancetype)initWithDouble: (double)value { if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, doubleZeroNumberInit); + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, doubleZeroNumberInit); return (id)doubleZeroNumber; } return (id)[[OFNumber of_alloc] initWithDouble: value]; }