Overview
Comment: | OFNumber: Remove ssize_t
It's a non-standard type that should only be used for matching POSIX |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
be8b4425461b6f7bd839d42c252673c6 |
User & Date: | js on 2020-08-16 18:28:17 |
Other Links: | manifest | tags |
Context
2020-08-22
| ||
18:39 | OFNumber: Don't always use the smallest type check-in: 9746cff094 user: js tags: trunk | |
2020-08-16
| ||
18:28 | OFNumber: Remove ssize_t check-in: be8b442546 user: js tags: trunk | |
2020-08-13
| ||
23:13 | Make GCC happy again check-in: 3be13d358f user: js tags: trunk | |
Changes
Modified src/OFNumber.h from [66f566bece] to [833a3447d8].
︙ | ︙ | |||
157 158 159 160 161 162 163 | @property (readonly, nonatomic) uint64_t uInt64Value; /*! * @brief The OFNumber as a `size_t`. */ @property (readonly, nonatomic) size_t sizeValue; | < < < < < | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | @property (readonly, nonatomic) uint64_t uInt64Value; /*! * @brief The OFNumber as a `size_t`. */ @property (readonly, nonatomic) size_t sizeValue; /*! * @brief The OFNumber as a `ptrdiff_t`. */ @property (readonly, nonatomic) ptrdiff_t ptrDiffValue; /*! * @brief The OFNumber as an `intptr_t`. |
︙ | ︙ | |||
363 364 365 366 367 368 369 | * @brief Creates a new OFNumber with the specified `size_t`. * * @param value The `size_t` value which the OFNumber should contain * @return A new autoreleased OFNumber */ + (instancetype)numberWithSize: (size_t)value; | < < < < < < < < | 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | * @brief Creates a new OFNumber with the specified `size_t`. * * @param value The `size_t` value which the OFNumber should contain * @return A new autoreleased OFNumber */ + (instancetype)numberWithSize: (size_t)value; /*! * @brief Creates a new OFNumber with the specified `ptrdiff_t`. * * @param value The `ptrdiff_t` value which the OFNumber should contain * @return A new autoreleased OFNumber */ + (instancetype)numberWithPtrDiff: (ptrdiff_t)value; |
︙ | ︙ | |||
597 598 599 600 601 602 603 | * @brief Initializes an already allocated OFNumber with the specified `size_t`. * * @param value The `size_t` value which the OFNumber should contain * @return An initialized OFNumber */ - (instancetype)initWithSize: (size_t)value; | < < < < < < < < < | 584 585 586 587 588 589 590 591 592 593 594 595 596 597 | * @brief Initializes an already allocated OFNumber with the specified `size_t`. * * @param value The `size_t` value which the OFNumber should contain * @return An initialized OFNumber */ - (instancetype)initWithSize: (size_t)value; /*! * @brief Initializes an already allocated OFNumber with the specified * `ptrdiff_t`. * * @param value The `ptrdiff_t` value which the OFNumber should contain * @return An initialized OFNumber */ |
︙ | ︙ |
Modified src/OFNumber.m from [a978c1217d] to [c26097a3d6].
︙ | ︙ | |||
268 269 270 271 272 273 274 | { if (value <= ULONG_MAX) return [self initWithUnsignedLong: (unsigned long)value]; return (id)[[OFNumber of_alloc] initWithSize: value]; } | < < < < < < < < < < | 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]; } #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 | } + (instancetype)numberWithSize: (size_t)value { return [[[self alloc] initWithSize: value] autorelease]; } | < < < < < | 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)numberWithPtrDiff: (ptrdiff_t)value { return [[[self alloc] initWithPtrDiff: value] autorelease]; } + (instancetype)numberWithIntPtr: (intptr_t)value { |
︙ | ︙ | |||
741 742 743 744 745 746 747 | { self = [super init]; _value.unsigned_ = value; _type = OF_NUMBER_TYPE_UNSIGNED; _typeEncoding = @encode(size_t); | < < < < < < < < < < < | 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)initWithPtrDiff: (ptrdiff_t)value { self = [super init]; |
︙ | ︙ | |||
1007 1008 1009 1010 1011 1012 1013 | } - (size_t)sizeValue { RETURN_AS(size_t) } | < < < < < | 981 982 983 984 985 986 987 988 989 990 991 992 993 994 | } - (size_t)sizeValue { RETURN_AS(size_t) } - (ptrdiff_t)ptrDiffValue { RETURN_AS(ptrdiff_t) } - (intptr_t)intPtrValue { |
︙ | ︙ |