ObjFW  Diff

Differences From Artifact [a978c1217d]:

To Artifact [c26097a3d6]:


268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
268
269
270
271
272
273
274










275
276
277
278
279
280
281







-
-
-
-
-
-
-
-
-
-







{
	if (value <= ULONG_MAX)
		return [self initWithUnsignedLong: (unsigned long)value];

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

- (instancetype)initWithSSize: (ssize_t)value
{
	if (value >= 0)
		return [self initWithSize: value];
	if (value <= LONG_MIN)
		return [self initWithLong: (long)value];

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

#ifdef __clang__
/*
 * This warning should probably not exist at all, as it prevents checking
 * whether one type fits into another in a portable way.
 */
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare"
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
479
480
481
482
483
484
485





486
487
488
489
490
491
492







-
-
-
-
-







}

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

+ (instancetype)numberWithSSize: (ssize_t)value
{
	return [[[self alloc] initWithSSize: value] autorelease];
}

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

+ (instancetype)numberWithIntPtr: (intptr_t)value
{
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
726
727
728
729
730
731
732











733
734
735
736
737
738
739







-
-
-
-
-
-
-
-
-
-
-







{
	self = [super init];

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

	return self;
}

- (instancetype)initWithSSize: (ssize_t)value
{
	self = [super init];

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

	return self;
}

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

1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
981
982
983
984
985
986
987





988
989
990
991
992
993
994







-
-
-
-
-







}

- (size_t)sizeValue
{
	RETURN_AS(size_t)
}

- (ssize_t)sSizeValue
{
	RETURN_AS(ssize_t)
}

- (ptrdiff_t)ptrDiffValue
{
	RETURN_AS(ptrdiff_t)
}

- (intptr_t)intPtrValue
{