ObjFW  Diff

Differences From Artifact [82eb4472bd]:

To Artifact [44b277b096]:


32
33
34
35
36
37
38

39
40
41
42
43
44
45
	OF_NUMBER_UINT64,
	OF_NUMBER_SIZE,
	OF_NUMBER_SSIZE,
	OF_NUMBER_INTMAX,
	OF_NUMBER_UINTMAX,
	OF_NUMBER_PTRDIFF,
	OF_NUMBER_INTPTR,

	OF_NUMBER_FLOAT,
	OF_NUMBER_DOUBLE,
};

/**
 * \brief Provides a way to store a number in an object.
 */







>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
	OF_NUMBER_UINT64,
	OF_NUMBER_SIZE,
	OF_NUMBER_SSIZE,
	OF_NUMBER_INTMAX,
	OF_NUMBER_UINTMAX,
	OF_NUMBER_PTRDIFF,
	OF_NUMBER_INTPTR,
	OF_NUMBER_UINTPTR,
	OF_NUMBER_FLOAT,
	OF_NUMBER_DOUBLE,
};

/**
 * \brief Provides a way to store a number in an object.
 */
64
65
66
67
68
69
70

71
72
73
74
75
76
77
		uint64_t       uint64;
		size_t	       size;
		ssize_t	       ssize;
		intmax_t       intmax;
		uintmax_t      uintmax;
		ptrdiff_t      ptrdiff;
		intptr_t       intptr;

		float	       float_;
		double	       double_;
	} value;
	enum of_number_type type;
}

/**







>







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
		uint64_t       uint64;
		size_t	       size;
		ssize_t	       ssize;
		intmax_t       intmax;
		uintmax_t      uintmax;
		ptrdiff_t      ptrdiff;
		intptr_t       intptr;
		uintptr_t      uintptr;
		float	       float_;
		double	       double_;
	} value;
	enum of_number_type type;
}

/**
202
203
204
205
206
207
208






209
210
211
212
213
214
215

/**
 * \param intptr An intptr_t which the OFNumber should contain
 * \return A new autoreleased OFNumber
 */
+ numberWithIntPtr: (intptr_t)intptr;







/**
 * \param float_ A float which the OFNumber should contain
 * \return A new autoreleased OFNumber
 */
+ numberWithFloat: (float)float_;

/**







>
>
>
>
>
>







204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223

/**
 * \param intptr An intptr_t which the OFNumber should contain
 * \return A new autoreleased OFNumber
 */
+ numberWithIntPtr: (intptr_t)intptr;

/**
 * \param uintptr An uintptr_t which the OFNumber should contain
 * \return A new autoreleased OFNumber
 */
+ numberWithUIntPtr: (uintptr_t)uintptr;

/**
 * \param float_ A float which the OFNumber should contain
 * \return A new autoreleased OFNumber
 */
+ numberWithFloat: (float)float_;

/**
390
391
392
393
394
395
396








397
398
399
400
401
402
403
 * Initializes an already allocated OFNumber with the specified intptr_t.
 *
 * \param intptr An intptr_t which the OFNumber should contain
 * \return An initialized OFNumber
 */
- initWithIntPtr: (intptr_t)intptr;









/**
 * Initializes an already allocated OFNumber with the specified float.
 *
 * \param float_ A float which the OFNumber should contain
 * \return An initialized OFNumber
 */
- initWithFloat: (float)float_;







>
>
>
>
>
>
>
>







398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
 * Initializes an already allocated OFNumber with the specified intptr_t.
 *
 * \param intptr An intptr_t which the OFNumber should contain
 * \return An initialized OFNumber
 */
- initWithIntPtr: (intptr_t)intptr;

/**
 * Initializes an already allocated OFNumber with the specified uintptr_t.
 *
 * \param uintptr An uintptr_t which the OFNumber should contain
 * \return An initialized OFNumber
 */
- initWithUIntPtr: (uintptr_t)uintptr;

/**
 * Initializes an already allocated OFNumber with the specified float.
 *
 * \param float_ A float which the OFNumber should contain
 * \return An initialized OFNumber
 */
- initWithFloat: (float)float_;
522
523
524
525
526
527
528





529
530
531
532
533
534
535
- (ptrdiff_t)asPtrDiff;

/**
 * \return The OFNumber as an intptr_t
 */
- (intptr_t)asIntPtr;






/**
 * \return The OFNumber as a float
 */
- (float)asFloat;

/**
 * \return The OFNumber as a double







>
>
>
>
>







538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
- (ptrdiff_t)asPtrDiff;

/**
 * \return The OFNumber as an intptr_t
 */
- (intptr_t)asIntPtr;

/**
 * \return The OFNumber as an uintptr_t
 */
- (uintptr_t)asUIntPtr;

/**
 * \return The OFNumber as a float
 */
- (float)asFloat;

/**
 * \return The OFNumber as a double