Differences From Artifact [7ed514fdca]:
- File src/OFNumber.m — part of check-in [8939cbdb52] at 2023-01-06 09:04:02 on branch trunk — Update copyright (user: js, size: 28201) [annotate] [blame] [check-ins using]
To Artifact [b9b4334494]:
- File
src/OFNumber.m
— part of check-in
[6ce0093f8d]
at
2023-04-10 19:22:32
on branch trunk
— Remove OFSerialization
While the idea sounds nice that the tag name is the class, this means the
serialization includes whether something is mutable or immutable. This means
doing as much as making something immutable changes the serialization, which
can then cause issues after being deserialized. (user: js, size: 25689) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
16 17 18 19 20 21 22 | #define OF_NUMBER_M #include "config.h" #include <math.h> #import "OFNumber.h" | | < < | | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #define OF_NUMBER_M #include "config.h" #include <math.h> #import "OFNumber.h" #import "OFData.h" #import "OFString.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" @interface OFNumber () + (instancetype)of_alloc; |
︙ | ︙ | |||
373 374 375 376 377 378 379 | static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, doubleZeroNumberInit); return (id)doubleZeroNumber; } return (id)[[OFNumber of_alloc] initWithDouble: value]; } | < < < < < | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, doubleZeroNumberInit); return (id)doubleZeroNumber; } return (id)[[OFNumber of_alloc] initWithDouble: value]; } #ifdef __clang__ # pragma clang diagnostic pop #endif @end @implementation OFNumberSingleton - (instancetype)autorelease |
︙ | ︙ | |||
780 781 782 783 784 785 786 | _value.float_ = value; _typeEncoding = @encode(double); return self; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 773 774 775 776 777 778 779 780 781 782 783 784 785 786 | _value.float_ = value; _typeEncoding = @encode(double); return self; } - (const char *)objCType { return _typeEncoding; } - (void)getValue: (void *)value size: (size_t)size { |
︙ | ︙ | |||
1075 1076 1077 1078 1079 1080 1081 | if (isUnsigned(self)) return [OFString stringWithFormat: @"%llu", self.unsignedLongLongValue]; @throw [OFInvalidFormatException exception]; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 | if (isUnsigned(self)) return [OFString stringWithFormat: @"%llu", self.unsignedLongLongValue]; @throw [OFInvalidFormatException exception]; } - (OFString *)JSONRepresentation { return [self of_JSONRepresentationWithOptions: 0 depth: 0]; } - (OFString *)JSONRepresentationWithOptions: (OFJSONRepresentationOptions)options |
︙ | ︙ |