ObjFW  Diff

Differences From Artifact [f7c843c996]:

To Artifact [17a849254e]:


63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
SINGLETON(longZeroNumber, initWithLong:, 0)
SINGLETON(longLongZeroNumber, initWithLongLong:, 0)
SINGLETON(unsignedCharZeroNumber, initWithUnsignedChar:, 0)
SINGLETON(unsignedShortZeroNumber, initWithUnsignedShort:, 0)
SINGLETON(unsignedIntZeroNumber, initWithUnsignedInt:, 0)
SINGLETON(unsignedLongZeroNumber, initWithUnsignedLong:, 0)
SINGLETON(unsignedLongLongZeroNumber, initWithUnsignedLongLong:, 0)
SINGLETON(int8ZeroNumber, initWithInt8:, 0)
SINGLETON(int16ZeroNumber, initWithInt16:, 0)
SINGLETON(int32ZeroNumber, initWithInt32:, 0)
SINGLETON(int64ZeroNumber, initWithInt64:, 0)
SINGLETON(uInt8ZeroNumber, initWithUInt8:, 0)
SINGLETON(uInt16ZeroNumber, initWithUInt16:, 0)
SINGLETON(uInt32ZeroNumber, initWithUInt32:, 0)
SINGLETON(uInt64ZeroNumber, initWithUInt64:, 0)
SINGLETON(floatZeroNumber, initWithFloat:, 0)
SINGLETON(doubleZeroNumber, initWithDouble:, 0)
#undef SINGLETON

@implementation OFNumberPlaceholder
- (instancetype)initWithBool: (bool)value
{







<
<
<
<
<
<
<
<







63
64
65
66
67
68
69








70
71
72
73
74
75
76
SINGLETON(longZeroNumber, initWithLong:, 0)
SINGLETON(longLongZeroNumber, initWithLongLong:, 0)
SINGLETON(unsignedCharZeroNumber, initWithUnsignedChar:, 0)
SINGLETON(unsignedShortZeroNumber, initWithUnsignedShort:, 0)
SINGLETON(unsignedIntZeroNumber, initWithUnsignedInt:, 0)
SINGLETON(unsignedLongZeroNumber, initWithUnsignedLong:, 0)
SINGLETON(unsignedLongLongZeroNumber, initWithUnsignedLongLong:, 0)








SINGLETON(floatZeroNumber, initWithFloat:, 0)
SINGLETON(doubleZeroNumber, initWithDouble:, 0)
#undef SINGLETON

@implementation OFNumberPlaceholder
- (instancetype)initWithBool: (bool)value
{
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
		of_once(&once, unsignedLongLongZeroNumberInit);
		return (id)unsignedLongLongZeroNumber;
	}

	return (id)[[OFNumber of_alloc] initWithUnsignedLongLong: value];
}

- (instancetype)initWithInt8: (int8_t)value
{
	if (value == 0) {
		static of_once_t once = OF_ONCE_INIT;
		of_once(&once, int8ZeroNumberInit);
		return (id)int8ZeroNumber;
	}

	return (id)[[OFNumber of_alloc] initWithInt8: value];
}

- (instancetype)initWithInt16: (int16_t)value
{
	if (value == 0) {
		static of_once_t once = OF_ONCE_INIT;
		of_once(&once, int16ZeroNumberInit);
		return (id)int16ZeroNumber;
	}

	return (id)[[OFNumber of_alloc] initWithInt16: value];
}

- (instancetype)initWithInt32: (int32_t)value
{
	if (value == 0) {
		static of_once_t once = OF_ONCE_INIT;
		of_once(&once, int32ZeroNumberInit);
		return (id)int32ZeroNumber;
	}

	return (id)[[OFNumber of_alloc] initWithInt32: value];
}

- (instancetype)initWithInt64: (int64_t)value
{
	if (value == 0) {
		static of_once_t once = OF_ONCE_INIT;
		of_once(&once, int64ZeroNumberInit);
		return (id)int64ZeroNumber;
	}

	return (id)[[OFNumber of_alloc] initWithInt64: value];
}

- (instancetype)initWithUInt8: (uint8_t)value
{
	if (value == 0) {
		static of_once_t once = OF_ONCE_INIT;
		of_once(&once, uInt8ZeroNumberInit);
		return (id)uInt8ZeroNumber;
	}

	return (id)[[OFNumber of_alloc] initWithUInt8: value];
}

- (instancetype)initWithUInt16: (uint16_t)value
{
	if (value == 0) {
		static of_once_t once = OF_ONCE_INIT;
		of_once(&once, uInt16ZeroNumberInit);
		return (id)uInt16ZeroNumber;
	}

	return (id)[[OFNumber of_alloc] initWithUInt16: value];
}

- (instancetype)initWithUInt32: (uint32_t)value
{
	if (value == 0) {
		static of_once_t once = OF_ONCE_INIT;
		of_once(&once, uInt32ZeroNumberInit);
		return (id)uInt32ZeroNumber;
	}

	return (id)[[OFNumber of_alloc] initWithUInt32: value];
}

- (instancetype)initWithUInt64: (uint64_t)value
{
	if (value == 0) {
		static of_once_t once = OF_ONCE_INIT;
		of_once(&once, uInt64ZeroNumberInit);
		return (id)uInt64ZeroNumber;
	}

	return (id)[[OFNumber of_alloc] initWithUInt64: value];
}

- (instancetype)initWithSize: (size_t)value
{
	return (id)[[OFNumber of_alloc] initWithSize: value];
}

- (instancetype)initWithPtrDiff: (ptrdiff_t)value
{
	return (id)[[OFNumber of_alloc] initWithPtrDiff: value];
}

- (instancetype)initWithIntPtr: (intptr_t)value
{
	return (id)[[OFNumber of_alloc] initWithIntPtr: value];
}

- (instancetype)initWithUIntPtr: (uintptr_t)value
{
	return (id)[[OFNumber of_alloc] initWithUIntPtr: value];
}

- (instancetype)initWithFloat: (float)value
{
	if (value == 0) {
		static of_once_t once = OF_ONCE_INIT;
		of_once(&once, floatZeroNumberInit);
		return (id)floatZeroNumber;
	}







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







191
192
193
194
195
196
197












































































































198
199
200
201
202
203
204
		of_once(&once, unsignedLongLongZeroNumberInit);
		return (id)unsignedLongLongZeroNumber;
	}

	return (id)[[OFNumber of_alloc] initWithUnsignedLongLong: value];
}













































































































- (instancetype)initWithFloat: (float)value
{
	if (value == 0) {
		static of_once_t once = OF_ONCE_INIT;
		of_once(&once, floatZeroNumberInit);
		return (id)floatZeroNumber;
	}
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
}

+ (instancetype)numberWithUnsignedLongLong: (unsigned long long)value
{
	return [[[self alloc] initWithUnsignedLongLong: value] autorelease];
}

+ (instancetype)numberWithInt8: (int8_t)value
{
	return [[[self alloc] initWithInt8: value] autorelease];
}

+ (instancetype)numberWithInt16: (int16_t)value
{
	return [[[self alloc] initWithInt16: value] autorelease];
}

+ (instancetype)numberWithInt32: (int32_t)value
{
	return [[[self alloc] initWithInt32: value] autorelease];
}

+ (instancetype)numberWithInt64: (int64_t)value
{
	return [[[self alloc] initWithInt64: value] autorelease];
}

+ (instancetype)numberWithUInt8: (uint8_t)value
{
	return [[[self alloc] initWithUInt8: value] autorelease];
}

+ (instancetype)numberWithUInt16: (uint16_t)value
{
	return [[[self alloc] initWithUInt16: value] autorelease];
}

+ (instancetype)numberWithUInt32: (uint32_t)value
{
	return [[[self alloc] initWithUInt32: value] autorelease];
}

+ (instancetype)numberWithUInt64: (uint64_t)value
{
	return [[[self alloc] initWithUInt64: value] autorelease];
}

+ (instancetype)numberWithSize: (size_t)value
{
	return [[[self alloc] initWithSize: value] autorelease];
}

+ (instancetype)numberWithPtrDiff: (ptrdiff_t)value
{
	return [[[self alloc] initWithPtrDiff: value] autorelease];
}

+ (instancetype)numberWithIntPtr: (intptr_t)value
{
	return [[[self alloc] initWithIntPtr: value] autorelease];
}

+ (instancetype)numberWithUIntPtr: (uintptr_t)value
{
	return [[[self alloc] initWithUIntPtr: value] autorelease];
}

+ (instancetype)numberWithFloat: (float)value
{
	return [[[self alloc] initWithFloat: value] autorelease];
}

+ (instancetype)numberWithDouble: (double)value
{







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







315
316
317
318
319
320
321




























































322
323
324
325
326
327
328
}

+ (instancetype)numberWithUnsignedLongLong: (unsigned long long)value
{
	return [[[self alloc] initWithUnsignedLongLong: value] autorelease];
}





























































+ (instancetype)numberWithFloat: (float)value
{
	return [[[self alloc] initWithFloat: value] autorelease];
}

+ (instancetype)numberWithDouble: (double)value
{
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
{
	self = [super init];

	_value.unsigned_ = value;
	_type = OF_NUMBER_TYPE_UNSIGNED;
	_typeEncoding = @encode(unsigned long long);

	return self;
}

- (instancetype)initWithInt8: (int8_t)value
{
	self = [super init];

	_value.signed_ = value;
	_type = OF_NUMBER_TYPE_SIGNED;
	_typeEncoding = @encode(int8_t);

	return self;
}

- (instancetype)initWithInt16: (int16_t)value
{
	self = [super init];

	_value.signed_ = value;
	_type = OF_NUMBER_TYPE_SIGNED;
	_typeEncoding = @encode(int16_t);

	return self;
}

- (instancetype)initWithInt32: (int32_t)value
{
	self = [super init];

	_value.signed_ = value;
	_type = OF_NUMBER_TYPE_SIGNED;
	_typeEncoding = @encode(int32_t);

	return self;
}

- (instancetype)initWithInt64: (int64_t)value
{
	self = [super init];

	_value.signed_ = value;
	_type = OF_NUMBER_TYPE_SIGNED;
	_typeEncoding = @encode(int64_t);

	return self;
}

- (instancetype)initWithUInt8: (uint8_t)value
{
	self = [super init];

	_value.unsigned_ = value;
	_type = OF_NUMBER_TYPE_UNSIGNED;
	_typeEncoding = @encode(uint8_t);

	return self;
}

- (instancetype)initWithUInt16: (uint16_t)value
{
	self = [super init];

	_value.unsigned_ = value;
	_type = OF_NUMBER_TYPE_UNSIGNED;
	_typeEncoding = @encode(uint16_t);

	return self;
}

- (instancetype)initWithUInt32: (uint32_t)value
{
	self = [super init];

	_value.unsigned_ = value;
	_type = OF_NUMBER_TYPE_UNSIGNED;
	_typeEncoding = @encode(uint32_t);

	return self;
}

- (instancetype)initWithUInt64: (uint64_t)value
{
	self = [super init];

	_value.unsigned_ = value;
	_type = OF_NUMBER_TYPE_UNSIGNED;
	_typeEncoding = @encode(uint64_t);

	return self;
}

- (instancetype)initWithSize: (size_t)value
{
	self = [super init];

	_value.unsigned_ = value;
	_type = OF_NUMBER_TYPE_UNSIGNED;
	_typeEncoding = @encode(size_t);

	return self;
}

- (instancetype)initWithPtrDiff: (ptrdiff_t)value
{
	self = [super init];








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







448
449
450
451
452
453
454



































































































455
456
457
458
459
460
461
{
	self = [super init];

	_value.unsigned_ = value;
	_type = OF_NUMBER_TYPE_UNSIGNED;
	_typeEncoding = @encode(unsigned long long);




































































































	return self;
}

- (instancetype)initWithPtrDiff: (ptrdiff_t)value
{
	self = [super init];

933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
}

- (unsigned long long)unsignedLongLongValue
{
	RETURN_AS(unsigned long long)
}

- (int8_t)int8Value
{
	RETURN_AS(int8_t)
}

- (int16_t)int16Value
{
	RETURN_AS(int16_t)
}

- (int32_t)int32Value
{
	RETURN_AS(int32_t)
}

- (int64_t)int64Value
{
	RETURN_AS(int64_t)
}

- (uint8_t)uInt8Value
{
	RETURN_AS(uint8_t)
}

- (uint16_t)uInt16Value
{
	RETURN_AS(uint16_t)
}

- (uint32_t)uInt32Value
{
	RETURN_AS(uint32_t)
}

- (uint64_t)uInt64Value
{
	RETURN_AS(uint64_t)
}

- (size_t)sizeValue
{
	RETURN_AS(size_t)
}

- (ptrdiff_t)ptrDiffValue
{
	RETURN_AS(ptrdiff_t)
}

- (intptr_t)intPtrValue
{
	RETURN_AS(intptr_t)
}

- (uintptr_t)uIntPtrValue
{
	RETURN_AS(uintptr_t)
}

- (float)floatValue
{
	RETURN_AS(float)
}

- (double)doubleValue
{







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







658
659
660
661
662
663
664




























































665
666
667
668
669
670
671
}

- (unsigned long long)unsignedLongLongValue
{
	RETURN_AS(unsigned long long)
}





























































- (float)floatValue
{
	RETURN_AS(float)
}

- (double)doubleValue
{