Overview
Comment: | Fix -[OFNumber isEqual:]. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
b791e6fcc4b8a4991bbb65a5d70a8552 |
User & Date: | js on 2012-09-09 14:14:02 |
Other Links: | manifest | tags |
Context
2012-09-09
| ||
14:36 | OFNumber: Implement OFComparing. check-in: 56df9c44de user: js tags: trunk | |
14:14 | Fix -[OFNumber isEqual:]. check-in: b791e6fcc4 user: js tags: trunk | |
12:31 | Loop forever after applicationDidFinishLaunching. check-in: 24622e8913 user: js tags: trunk | |
Changes
Modified src/OFNumber.h from [5d5851287a] to [bb4111628a].
︙ | ︙ | |||
27 28 29 30 31 32 33 | #import "OFSerialization.h" #import "OFJSONRepresentation.h" /** * \brief The type of a number. */ typedef enum of_number_type_t { | | | | | | | | | | | | | | | | | | | | | > | > | | < | | | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | #import "OFSerialization.h" #import "OFJSONRepresentation.h" /** * \brief The type of a number. */ typedef enum of_number_type_t { OF_NUMBER_BOOL = 0x01, OF_NUMBER_UCHAR = 0x02, OF_NUMBER_USHORT = 0x03, OF_NUMBER_UINT = 0x04, OF_NUMBER_ULONG = 0x05, OF_NUMBER_SIZE = 0x06, OF_NUMBER_UINT8 = 0x07, OF_NUMBER_UINT16 = 0x08, OF_NUMBER_UINT32 = 0x09, OF_NUMBER_UINT64 = 0x0A, OF_NUMBER_UINTPTR = 0x0B, OF_NUMBER_UINTMAX = 0x0C, OF_NUMBER_SIGNED = 0x10, OF_NUMBER_CHAR = OF_NUMBER_UCHAR | OF_NUMBER_SIGNED, OF_NUMBER_SHORT = OF_NUMBER_USHORT | OF_NUMBER_SIGNED, OF_NUMBER_INT = OF_NUMBER_UINT | OF_NUMBER_SIGNED, OF_NUMBER_LONG = OF_NUMBER_ULONG | OF_NUMBER_SIGNED, OF_NUMBER_INT8 = OF_NUMBER_UINT8 | OF_NUMBER_SIGNED, OF_NUMBER_INT16 = OF_NUMBER_UINT16 | OF_NUMBER_SIGNED, OF_NUMBER_INT32 = OF_NUMBER_UINT32 | OF_NUMBER_SIGNED, OF_NUMBER_INT64 = OF_NUMBER_UINT64 | OF_NUMBER_SIGNED, OF_NUMBER_SSIZE = OF_NUMBER_SIZE | OF_NUMBER_SIGNED, OF_NUMBER_INTMAX = OF_NUMBER_UINTMAX | OF_NUMBER_SIGNED, OF_NUMBER_PTRDIFF = 0x0D | OF_NUMBER_SIGNED, OF_NUMBER_INTPTR = 0x0E | OF_NUMBER_SIGNED, OF_NUMBER_FLOAT = 0x20, OF_NUMBER_DOUBLE = 0x40 | OF_NUMBER_FLOAT, } of_number_type_t; /** * \brief Provides a way to store a number in an object. */ @interface OFNumber: OFObject <OFCopying, OFSerialization, OFJSONRepresentation> { |
︙ | ︙ |
Modified src/OFNumber.m from [70f21d39ef] to [494724f548].
︙ | ︙ | |||
925 926 927 928 929 930 931 | OFNumber *number; if (![object isKindOfClass: [OFNumber class]]) return NO; number = object; | < | > | | < < < < < < < < | < < < < < < < < < < < < | < < < < < < | 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 | OFNumber *number; if (![object isKindOfClass: [OFNumber class]]) return NO; number = object; if (type & OF_NUMBER_FLOAT || number->type & OF_NUMBER_FLOAT) return ([number doubleValue] == [self doubleValue]); if (type & OF_NUMBER_SIGNED || number->type & OF_NUMBER_SIGNED) return ([number intMaxValue] == [self intMaxValue]); return ([number uIntMaxValue] == [self uIntMaxValue]); } - (uint32_t)hash { uint32_t hash; uint8_t i; |
︙ | ︙ |