Comment: | OFNumber: Remove (u)int{8,16,32,64} methods
Since C guarantees minimum sizes for char, short, int, long and long |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
25c985fec1abc4dc1c68cd8623e0ba5f |
User & Date: | js on 2020-08-25 00:11:24 |
Other Links: | manifest | tags |
2020-08-25
| ||
23:52 | OFString: Remove hack for amiga-gcc check-in: 5f494eaf81 user: js tags: trunk | |
00:11 | OFNumber: Remove (u)int{8,16,32,64} methods check-in: 25c985fec1 user: js tags: trunk | |
2020-08-22
| ||
18:39 | OFNumber: Don't always use the smallest type check-in: 9746cff094 user: js tags: trunk | |
Modified src/OFDNSResolver.m from [6319b8ebc8] to [abd3a40827].
︙ | ︙ | |||
489 490 491 492 493 494 495 | _settings = [settings copy]; _delegate = [delegate retain]; queryData = [OFMutableData dataWithCapacity: 512]; /* Header */ | | | 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 | _settings = [settings copy]; _delegate = [delegate retain]; queryData = [OFMutableData dataWithCapacity: 512]; /* Header */ tmp = OF_BSWAP16_IF_LE(_ID.unsignedShortValue); [queryData addItems: &tmp count: 2]; /* RD */ tmp = OF_BSWAP16_IF_LE(1u << 8); [queryData addItems: &tmp count: 2]; |
︙ | ︙ | |||
810 811 812 813 814 815 816 | { void *pool = objc_autoreleasePoolPush(); OFNumber *ID; OFDNSResolverContext *context; /* Random, unused ID */ do { | | | 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 | { void *pool = objc_autoreleasePoolPush(); OFNumber *ID; OFDNSResolverContext *context; /* Random, unused ID */ do { ID = [OFNumber numberWithUnsignedShort: of_random16()]; } while ([_queries objectForKey: ID] != nil); if (query.domainName.UTF8StringLength > 253) @throw [OFOutOfRangeException exception]; if (_settings->_nameServers.count == 0) { id exception = [OFDNSQueryFailedException |
︙ | ︙ | |||
909 910 911 912 913 914 915 | OFNumber *ID; OFDNSResolverContext *context; if (length < 2) /* We can't get the ID to get the context. Ignore packet. */ return true; | | | 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 | OFNumber *ID; OFDNSResolverContext *context; if (length < 2) /* We can't get the ID to get the context. Ignore packet. */ return true; ID = [OFNumber numberWithUnsignedShort: (buffer[0] << 8) | buffer[1]]; context = [[[_queries objectForKey: ID] retain] autorelease]; if (context == nil) return true; if (context->_TCPSocket != nil) { if ([_TCPQueries objectForKey: context->_TCPSocket] != context) |
︙ | ︙ |
Modified src/OFData+MessagePackParsing.m from [91d033cd37] to [464ca7dfaa].
︙ | ︙ | |||
189 190 191 192 193 194 195 | OFData *data; if (length < 1) @throw [OFTruncatedDataException exception]; /* positive fixint */ if ((buffer[0] & 0x80) == 0) { | | | | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | OFData *data; if (length < 1) @throw [OFTruncatedDataException exception]; /* positive fixint */ if ((buffer[0] & 0x80) == 0) { *object = [OFNumber numberWithUnsignedChar: buffer[0] & 0x7F]; return 1; } /* negative fixint */ if ((buffer[0] & 0xE0) == 0xE0) { *object = [OFNumber numberWithChar: ((int8_t)(buffer[0] & 0x1F)) - 32]; return 1; } /* fixstr */ if ((buffer[0] & 0xE0) == 0xA0) { count = buffer[0] & 0x1F; |
︙ | ︙ | |||
229 230 231 232 233 234 235 | /* Prefix byte */ switch (buffer[0]) { /* Unsigned integers */ case 0xCC: /* uint8 */ if (length < 2) @throw [OFTruncatedDataException exception]; | | | > | > | > | | | | | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | /* Prefix byte */ switch (buffer[0]) { /* Unsigned integers */ case 0xCC: /* uint8 */ if (length < 2) @throw [OFTruncatedDataException exception]; *object = [OFNumber numberWithUnsignedChar: buffer[1]]; return 2; case 0xCD: /* uint 16 */ if (length < 3) @throw [OFTruncatedDataException exception]; *object = [OFNumber numberWithUnsignedShort: readUInt16(buffer + 1)]; return 3; case 0xCE: /* uint 32 */ if (length < 5) @throw [OFTruncatedDataException exception]; *object = [OFNumber numberWithUnsignedLong: readUInt32(buffer + 1)]; return 5; case 0xCF: /* uint 64 */ if (length < 9) @throw [OFTruncatedDataException exception]; *object = [OFNumber numberWithUnsignedLongLong: readUInt64(buffer + 1)]; return 9; /* Signed integers */ case 0xD0: /* int 8 */ if (length < 2) @throw [OFTruncatedDataException exception]; *object = [OFNumber numberWithChar: buffer[1]]; return 2; case 0xD1: /* int 16 */ if (length < 3) @throw [OFTruncatedDataException exception]; *object = [OFNumber numberWithShort: readUInt16(buffer + 1)]; return 3; case 0xD2: /* int 32 */ if (length < 5) @throw [OFTruncatedDataException exception]; *object = [OFNumber numberWithLong: readUInt32(buffer + 1)]; return 5; case 0xD3: /* int 64 */ if (length < 9) @throw [OFTruncatedDataException exception]; *object = [OFNumber numberWithLongLong: readUInt64(buffer + 1)]; return 9; /* Floating point */ case 0xCA:; /* float 32 */ float f; if (length < 5) @throw [OFTruncatedDataException exception]; |
︙ | ︙ |
Modified src/OFFileManager.h from [fff729036e] to [2be4d0719f].
︙ | ︙ | |||
589 590 591 592 593 594 595 | /*! * @brief The @ref of_file_attribute_key_posix_permissions key from the * dictionary. * * Raises an @ref OFUndefinedKeyException if the key is missing. */ | | | | | 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 | /*! * @brief The @ref of_file_attribute_key_posix_permissions key from the * dictionary. * * Raises an @ref OFUndefinedKeyException if the key is missing. */ @property (readonly, nonatomic) unsigned long filePOSIXPermissions; /*! * @brief The @ref of_file_attribute_key_posix_uid key from the dictionary. * * Raises an @ref OFUndefinedKeyException if the key is missing. */ @property (readonly, nonatomic) unsigned long filePOSIXUID; /*! * @brief The @ref of_file_attribute_key_posix_gid key from the dictionary. * * Raises an @ref OFUndefinedKeyException if the key is missing. */ @property (readonly, nonatomic) unsigned long filePOSIXGID; /*! * @brief The @ref of_file_attribute_key_owner key from the dictionary. * * Raises an @ref OFUndefinedKeyException if the key is missing. */ @property (readonly, nonatomic) OFString *fileOwner; |
︙ | ︙ |
Modified src/OFFileManager.m from [942505065c] to [d64d08867d].
︙ | ︙ | |||
945 946 947 948 949 950 951 | } - (of_file_type_t)fileType { return attributeForKeyOrException(self, of_file_attribute_key_type); } | | | | | | | | 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 | } - (of_file_type_t)fileType { return attributeForKeyOrException(self, of_file_attribute_key_type); } - (unsigned long)filePOSIXPermissions { return [attributeForKeyOrException(self, of_file_attribute_key_posix_permissions) unsignedLongValue]; } - (unsigned long)filePOSIXUID { return [attributeForKeyOrException(self, of_file_attribute_key_posix_uid) unsignedLongValue]; } - (unsigned long)filePOSIXGID { return [attributeForKeyOrException(self, of_file_attribute_key_posix_gid) unsignedLongValue]; } - (OFString *)fileOwner { return attributeForKeyOrException(self, of_file_attribute_key_owner); } |
︙ | ︙ |
Modified src/OFFileURLHandler.m from [469f3d6619] to [987947edfd].
︙ | ︙ | |||
407 408 409 410 411 412 413 | } static void setOwnerAndGroupAttributes(of_mutable_file_attributes_t attributes, of_stat_t *s) { #ifdef OF_FILE_MANAGER_SUPPORTS_OWNER | | | | 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 | } static void setOwnerAndGroupAttributes(of_mutable_file_attributes_t attributes, of_stat_t *s) { #ifdef OF_FILE_MANAGER_SUPPORTS_OWNER [attributes setObject: [NSNumber numberWithUnsignedLong: s->st_uid] forKey: of_file_attribute_key_posix_uid]; [attributes setObject: [NSNumber numberWithUnsignedLong: s->st_gid] forKey: of_file_attribute_key_posix_gid]; # ifdef OF_HAVE_THREADS [passwdMutex lock]; @try { # endif of_string_encoding_t encoding = [OFLocale encoding]; |
︙ | ︙ | |||
621 622 623 624 625 626 627 | @throw [OFOutOfRangeException exception]; [ret setObject: [NSNumber numberWithUnsignedLongLong: s.st_size] forKey: of_file_attribute_key_size]; setTypeAttribute(ret, &s); | | | 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 | @throw [OFOutOfRangeException exception]; [ret setObject: [NSNumber numberWithUnsignedLongLong: s.st_size] forKey: of_file_attribute_key_size]; setTypeAttribute(ret, &s); [ret setObject: [NSNumber numberWithUnsignedLong: s.st_mode] forKey: of_file_attribute_key_posix_permissions]; setOwnerAndGroupAttributes(ret, &s); setDateAttributes(ret, &s); #ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS if (S_ISLNK(s.st_mode)) |
︙ | ︙ | |||
756 757 758 759 760 761 762 | } - (void)of_setPOSIXPermissions: (OFNumber *)permissions ofItemAtURL: (OFURL *)URL attributes: (of_file_attributes_t)attributes OF_DIRECT { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS | | | 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 | } - (void)of_setPOSIXPermissions: (OFNumber *)permissions ofItemAtURL: (OFURL *)URL attributes: (of_file_attributes_t)attributes OF_DIRECT { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS mode_t mode = (mode_t)permissions.unsignedLongValue; OFString *path = URL.fileSystemRepresentation; int status; # ifdef OF_WINDOWS if ([OFSystemInfo isWindowsNT]) status = _wchmod(path.UTF16String, mode); else |
︙ | ︙ |
Modified src/OFHTTPClient.m from [d541eab337] to [561ec71175].
︙ | ︙ | |||
716 717 718 719 720 721 722 | } else { sock = [OFTCPSocket socket]; port = 80; } URLPort = URL.port; if (URLPort != nil) | | | 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 | } else { sock = [OFTCPSocket socket]; port = 80; } URLPort = URL.port; if (URLPort != nil) port = URLPort.unsignedShortValue; sock.delegate = self; [sock asyncConnectToHost: URL.host port: port]; } @catch (id e) { [self raiseException: e]; } |
︙ | ︙ |
Modified src/OFHTTPServer.m from [0eb4bcc334] to [abf9a790cd].
︙ | ︙ | |||
539 540 541 542 543 544 545 | _port = [_server port]; } URL = [OFMutableURL URL]; URL.scheme = @"http"; URL.host = _host; if (_port != 80) | | | 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | _port = [_server port]; } URL = [OFMutableURL URL]; URL.scheme = @"http"; URL.host = _host; if (_port != 80) URL.port = [OFNumber numberWithUnsignedShort: _port]; if ((pos = [_path rangeOfString: @"?"].location) != OF_NOT_FOUND) { OFString *path, *query; path = [_path substringWithRange: of_range(0, pos)]; query = [_path substringWithRange: of_range(pos + 1, _path.length - pos - 1)]; |
︙ | ︙ |
Modified src/OFLHAArchiveEntry.m from [9cc455c13c] to [61acef2124].
︙ | ︙ | |||
123 124 125 126 127 128 129 | memcpy(&mode, (char *)extension.items + 1, 2); mode = OF_BSWAP16_IF_BE(mode); [entry->_mode release]; entry->_mode = nil; | | | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | memcpy(&mode, (char *)extension.items + 1, 2); mode = OF_BSWAP16_IF_BE(mode); [entry->_mode release]; entry->_mode = nil; entry->_mode = [[OFNumber alloc] initWithUnsignedShort: mode]; } static void parseGIDUIDExtension(OFLHAArchiveEntry *entry, OFData *extension, of_string_encoding_t encoding) { uint16_t UID, GID; |
︙ | ︙ | |||
147 148 149 150 151 152 153 | [entry->_GID release]; entry->_GID = nil; [entry->_UID release]; entry->_UID = nil; | | | | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | [entry->_GID release]; entry->_GID = nil; [entry->_UID release]; entry->_UID = nil; entry->_GID = [[OFNumber alloc] initWithUnsignedShort: GID]; entry->_UID = [[OFNumber alloc] initWithUnsignedShort: UID]; } static void parseGroupExtension(OFLHAArchiveEntry *entry, OFData *extension, of_string_encoding_t encoding) { [entry->_group release]; |
︙ | ︙ | |||
651 652 653 654 655 656 657 | if (_mode != nil) { tmp16 = OF_BSWAP16_IF_BE(5); [data addItems: &tmp16 count: sizeof(tmp16)]; [data addItem: "\x50"]; | | | | | 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 | if (_mode != nil) { tmp16 = OF_BSWAP16_IF_BE(5); [data addItems: &tmp16 count: sizeof(tmp16)]; [data addItem: "\x50"]; tmp16 = OF_BSWAP16_IF_BE(_mode.unsignedShortValue); [data addItems: &tmp16 count: sizeof(tmp16)]; } if (_UID != nil || _GID != nil) { if (_UID == nil || _GID == nil) @throw [OFInvalidArgumentException exception]; tmp16 = OF_BSWAP16_IF_BE(7); [data addItems: &tmp16 count: sizeof(tmp16)]; [data addItem: "\x51"]; tmp16 = OF_BSWAP16_IF_BE(_GID.unsignedShortValue); [data addItems: &tmp16 count: sizeof(tmp16)]; tmp16 = OF_BSWAP16_IF_BE(_UID.unsignedShortValue); [data addItems: &tmp16 count: sizeof(tmp16)]; } if (_group != nil) { size_t groupLength = [_group cStringLengthWithEncoding: encoding]; |
︙ | ︙ | |||
757 758 759 760 761 762 763 | objc_autoreleasePoolPop(pool); } - (OFString *)description { void *pool = objc_autoreleasePoolPush(); OFString *mode = (_mode == nil ? nil | | | 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 | objc_autoreleasePoolPop(pool); } - (OFString *)description { void *pool = objc_autoreleasePoolPush(); OFString *mode = (_mode == nil ? nil : [OFString stringWithFormat: @"%ho", _mode.unsignedShortValue]); OFString *extensions = [_extensions.description stringByReplacingOccurrencesOfString: @"\n" withString: @"\n\t"]; OFString *ret = [OFString stringWithFormat: @"<%@:\n" @"\tFile name = %@\n" @"\tCompression method = %@\n" |
︙ | ︙ |
Modified src/OFMutableTarArchiveEntry.h from [3fa49654d2] to [2a04d96f47].
︙ | ︙ | |||
34 35 36 37 38 39 40 | * @brief The file name of the entry. */ @property (readwrite, copy, nonatomic) OFString *fileName; /*! * @brief The mode of the entry. */ | | | | | | 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 | * @brief The file name of the entry. */ @property (readwrite, copy, nonatomic) OFString *fileName; /*! * @brief The mode of the entry. */ @property (readwrite, nonatomic) unsigned long mode; /*! * @brief The UID of the owner. */ @property (readwrite, nonatomic) unsigned long UID; /*! * @brief The GID of the group. */ @property (readwrite, nonatomic) unsigned long GID; /*! * @brief The size of the file. */ @property (readwrite, nonatomic) unsigned long long size; /*! * @brief The date of the last modification of the file. */ @property (readwrite, retain, nonatomic) OFDate *modificationDate; /*! |
︙ | ︙ | |||
82 83 84 85 86 87 88 | * @brief The group of the file. */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *group; /*! * @brief The device major (if the file is a device). */ | | | | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | * @brief The group of the file. */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *group; /*! * @brief The device major (if the file is a device). */ @property (readwrite, nonatomic) unsigned long deviceMajor; /*! * @brief The device major (if the file is a device). */ @property (readwrite, nonatomic) unsigned long deviceMinor; /*! * @brief Converts the OFMutableTarArchiveEntry to an immutable * OFTarArchiveEntry. */ - (void)makeImmutable; @end OF_ASSUME_NONNULL_END |
Modified src/OFMutableTarArchiveEntry.m from [11e44c30db] to [1fdec748d1].
︙ | ︙ | |||
37 38 39 40 41 42 43 | - (void)setFileName: (OFString *)fileName { OFString *old = _fileName; _fileName = [fileName copy]; [old release]; } | | | | | | 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 | - (void)setFileName: (OFString *)fileName { OFString *old = _fileName; _fileName = [fileName copy]; [old release]; } - (void)setMode: (unsigned long)mode { _mode = mode; } - (void)setUID: (unsigned long)UID { _UID = UID; } - (void)setGID: (unsigned long)GID { _GID = GID; } - (void)setSize: (unsigned long long)size { _size = size; } - (void)setModificationDate: (OFDate *)modificationDate { OFDate *old = _modificationDate; |
︙ | ︙ | |||
90 91 92 93 94 95 96 | - (void)setGroup: (OFString *)group { OFString *old = _group; _group = [group copy]; [old release]; } | | | | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | - (void)setGroup: (OFString *)group { OFString *old = _group; _group = [group copy]; [old release]; } - (void)setDeviceMajor: (unsigned long)deviceMajor { _deviceMajor = deviceMajor; } - (void)setDeviceMinor: (unsigned long)deviceMinor { _deviceMinor = deviceMinor; } - (void)makeImmutable { object_setClass(self, [OFTarArchiveEntry class]); } @end |
Modified src/OFNumber.h from [833a3447d8] to [5740ff4672].
︙ | ︙ | |||
112 113 114 115 116 117 118 | @property (readonly, nonatomic) unsigned long unsignedLongValue; /*! * @brief The OFNumber as an `unsigned long long`. */ @property (readonly, nonatomic) unsigned long long unsignedLongLongValue; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | @property (readonly, nonatomic) unsigned long unsignedLongValue; /*! * @brief The OFNumber as an `unsigned long long`. */ @property (readonly, nonatomic) unsigned long long unsignedLongLongValue; /*! * @brief The OFNumber as a `float`. */ @property (readonly, nonatomic) float floatValue; /*! * @brief The OFNumber as a `double`. |
︙ | ︙ | |||
286 287 288 289 290 291 292 | * @brief Creates a new OFNumber with the specified `unsigned long long`. * * @param value The `unsigned long long` value which the OFNumber should contain * @return A new autoreleased OFNumber */ + (instancetype)numberWithUnsignedLongLong: (unsigned long long)value; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | * @brief Creates a new OFNumber with the specified `unsigned long long`. * * @param value The `unsigned long long` value which the OFNumber should contain * @return A new autoreleased OFNumber */ + (instancetype)numberWithUnsignedLongLong: (unsigned long long)value; /*! * @brief Creates a new OFNumber with the specified `float`. * * @param value The `float` value which the OFNumber should contain * @return A new autoreleased OFNumber */ + (instancetype)numberWithFloat: (float)value; |
︙ | ︙ | |||
505 506 507 508 509 510 511 | * `unsigned long long`. * * @param value The `unsigned long long` value which the OFNumber should contain * @return An initialized OFNumber */ - (instancetype)initWithUnsignedLongLong: (unsigned long long)value; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | * `unsigned long long`. * * @param value The `unsigned long long` value which the OFNumber should contain * @return An initialized OFNumber */ - (instancetype)initWithUnsignedLongLong: (unsigned long long)value; /*! * @brief Initializes an already allocated OFNumber with the specified `float`. * * @param value The `float` value which the OFNumber should contain * @return An initialized OFNumber */ - (instancetype)initWithFloat: (float)value; |
︙ | ︙ |
Modified src/OFNumber.m from [f7c843c996] to [17a849254e].
︙ | ︙ | |||
63 64 65 66 67 68 69 | SINGLETON(longZeroNumber, initWithLong:, 0) SINGLETON(longLongZeroNumber, initWithLongLong:, 0) SINGLETON(unsignedCharZeroNumber, initWithUnsignedChar:, 0) SINGLETON(unsignedShortZeroNumber, initWithUnsignedShort:, 0) SINGLETON(unsignedIntZeroNumber, initWithUnsignedInt:, 0) SINGLETON(unsignedLongZeroNumber, initWithUnsignedLong:, 0) SINGLETON(unsignedLongLongZeroNumber, initWithUnsignedLongLong:, 0) | < < < < < < < < | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | SINGLETON(longZeroNumber, initWithLong:, 0) SINGLETON(longLongZeroNumber, initWithLongLong:, 0) SINGLETON(unsignedCharZeroNumber, initWithUnsignedChar:, 0) SINGLETON(unsignedShortZeroNumber, initWithUnsignedShort:, 0) SINGLETON(unsignedIntZeroNumber, initWithUnsignedInt:, 0) SINGLETON(unsignedLongZeroNumber, initWithUnsignedLong:, 0) SINGLETON(unsignedLongLongZeroNumber, initWithUnsignedLongLong:, 0) SINGLETON(floatZeroNumber, initWithFloat:, 0) SINGLETON(doubleZeroNumber, initWithDouble:, 0) #undef SINGLETON @implementation OFNumberPlaceholder - (instancetype)initWithBool: (bool)value { |
︙ | ︙ | |||
199 200 201 202 203 204 205 | of_once(&once, unsignedLongLongZeroNumberInit); return (id)unsignedLongLongZeroNumber; } return (id)[[OFNumber of_alloc] initWithUnsignedLongLong: value]; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | of_once(&once, unsignedLongLongZeroNumberInit); return (id)unsignedLongLongZeroNumber; } return (id)[[OFNumber of_alloc] initWithUnsignedLongLong: value]; } - (instancetype)initWithFloat: (float)value { if (value == 0) { static of_once_t once = OF_ONCE_INIT; of_once(&once, floatZeroNumberInit); return (id)floatZeroNumber; } |
︙ | ︙ | |||
431 432 433 434 435 436 437 | } + (instancetype)numberWithUnsignedLongLong: (unsigned long long)value { return [[[self alloc] initWithUnsignedLongLong: value] autorelease]; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | } + (instancetype)numberWithUnsignedLongLong: (unsigned long long)value { return [[[self alloc] initWithUnsignedLongLong: value] autorelease]; } + (instancetype)numberWithFloat: (float)value { return [[[self alloc] initWithFloat: value] autorelease]; } + (instancetype)numberWithDouble: (double)value { |
︙ | ︙ | |||
624 625 626 627 628 629 630 | { self = [super init]; _value.unsigned_ = value; _type = OF_NUMBER_TYPE_UNSIGNED; _typeEncoding = @encode(unsigned long long); | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | { self = [super init]; _value.unsigned_ = value; _type = OF_NUMBER_TYPE_UNSIGNED; _typeEncoding = @encode(unsigned long long); return self; } - (instancetype)initWithPtrDiff: (ptrdiff_t)value { self = [super init]; |
︙ | ︙ | |||
933 934 935 936 937 938 939 | } - (unsigned long long)unsignedLongLongValue { RETURN_AS(unsigned long long) } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | } - (unsigned long long)unsignedLongLongValue { RETURN_AS(unsigned long long) } - (float)floatValue { RETURN_AS(float) } - (double)doubleValue { |
︙ | ︙ |
Modified src/OFTarArchiveEntry.h from [77a315dfd8] to [c15723d4d0].
︙ | ︙ | |||
49 50 51 52 53 54 55 | * @class OFTarArchiveEntry OFTarArchiveEntry.h ObjFW/OFTarArchiveEntry.h * * @brief A class which represents an entry of a tar archive. */ @interface OFTarArchiveEntry: OFObject <OFCopying, OFMutableCopying> { OFString *_fileName; | | | | | | | | | | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | * @class OFTarArchiveEntry OFTarArchiveEntry.h ObjFW/OFTarArchiveEntry.h * * @brief A class which represents an entry of a tar archive. */ @interface OFTarArchiveEntry: OFObject <OFCopying, OFMutableCopying> { OFString *_fileName; unsigned long _mode; unsigned long long _size; unsigned long _UID, _GID; OFDate *_modificationDate; of_tar_archive_entry_type_t _type; OFString *_Nullable _targetFileName; OFString *_Nullable _owner, *_Nullable _group; unsigned long _deviceMajor, _deviceMinor; OF_RESERVE_IVARS(4) } /*! * @brief The file name of the entry. */ @property (readonly, copy, nonatomic) OFString *fileName; /*! * @brief The mode of the entry. */ @property (readonly, nonatomic) unsigned long mode; /*! * @brief The UID of the owner. */ @property (readonly, nonatomic) unsigned long UID; /*! * @brief The GID of the group. */ @property (readonly, nonatomic) unsigned long GID; /*! * @brief The size of the file. */ @property (readonly, nonatomic) unsigned long long size; /*! * @brief The date of the last modification of the file. */ @property (readonly, retain, nonatomic) OFDate *modificationDate; /*! |
︙ | ︙ | |||
116 117 118 119 120 121 122 | * @brief The group of the file. */ @property OF_NULLABLE_PROPERTY (readonly, copy, nonatomic) OFString *group; /*! * @brief The device major (if the file is a device). */ | | | | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | * @brief The group of the file. */ @property OF_NULLABLE_PROPERTY (readonly, copy, nonatomic) OFString *group; /*! * @brief The device major (if the file is a device). */ @property (readonly, nonatomic) unsigned long deviceMajor; /*! * @brief The device major (if the file is a device). */ @property (readonly, nonatomic) unsigned long deviceMinor; /*! * @brief Creates a new OFTarArchiveEntry with the specified file name. * * @param fileName The file name for the OFTarArchiveEntry * @return A new, autoreleased OFTarArchiveEntry */ |
︙ | ︙ |
Modified src/OFTarArchiveEntry.m from [91482cd774] to [5e09222260].
︙ | ︙ | |||
92 93 94 95 96 97 98 | self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); OFString *targetFileName; _fileName = [stringFromBuffer(header, 100, encoding) copy]; | | | | | | | | | | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); OFString *targetFileName; _fileName = [stringFromBuffer(header, 100, encoding) copy]; _mode = (unsigned long)octalValueFromBuffer( header + 100, 8, ULONG_MAX); _UID = (unsigned long)octalValueFromBuffer( header + 108, 8, ULONG_MAX); _GID = (unsigned long)octalValueFromBuffer( header + 116, 8, ULONG_MAX); _size = (unsigned long long)octalValueFromBuffer( header + 124, 12, ULLONG_MAX); _modificationDate = [[OFDate alloc] initWithTimeIntervalSince1970: (of_time_interval_t)octalValueFromBuffer( header + 136, 12, ULLONG_MAX)]; _type = header[156]; targetFileName = stringFromBuffer(header + 157, 100, encoding); |
︙ | ︙ | |||
121 122 123 124 125 126 127 | OFString *prefix; _owner = [stringFromBuffer(header + 265, 32, encoding) copy]; _group = [stringFromBuffer(header + 297, 32, encoding) copy]; | | | | | | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | OFString *prefix; _owner = [stringFromBuffer(header + 265, 32, encoding) copy]; _group = [stringFromBuffer(header + 297, 32, encoding) copy]; _deviceMajor = (unsigned long)octalValueFromBuffer( header + 329, 8, ULONG_MAX); _deviceMinor = (unsigned long)octalValueFromBuffer( header + 337, 8, ULONG_MAX); prefix = stringFromBuffer(header + 345, 155, encoding); if (prefix.length > 0) { OFString *fileName = [OFString stringWithFormat: @"%@/%@", prefix, _fileName]; [_fileName release]; |
︙ | ︙ | |||
205 206 207 208 209 210 211 | } - (OFString *)fileName { return _fileName; } | | | | | | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | } - (OFString *)fileName { return _fileName; } - (unsigned long)mode { return _mode; } - (unsigned long)UID { return _UID; } - (unsigned long)GID { return _GID; } - (unsigned long long)size { return _size; } - (OFDate *)modificationDate { return _modificationDate; |
︙ | ︙ | |||
250 251 252 253 254 255 256 | } - (OFString *)group { return _group; } | | | | 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | } - (OFString *)group { return _group; } - (unsigned long)deviceMajor { return _deviceMajor; } - (unsigned long)deviceMinor { return _deviceMinor; } - (OFString *)description { void *pool = objc_autoreleasePoolPush(); |
︙ | ︙ | |||
291 292 293 294 295 296 297 | return [ret autorelease]; } - (void)of_writeToStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding { unsigned char buffer[512]; | | | | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | return [ret autorelease]; } - (void)of_writeToStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding { unsigned char buffer[512]; unsigned long long modificationDate; uint16_t checksum = 0; stringToBuffer(buffer, _fileName, 100, encoding); stringToBuffer(buffer + 100, [OFString stringWithFormat: @"%06" PRIo16 " ", _mode], 8, OF_STRING_ENCODING_ASCII); stringToBuffer(buffer + 108, [OFString stringWithFormat: @"%06" PRIo16 " ", _UID], 8, OF_STRING_ENCODING_ASCII); stringToBuffer(buffer + 116, [OFString stringWithFormat: @"%06" PRIo16 " ", _GID], 8, OF_STRING_ENCODING_ASCII); stringToBuffer(buffer + 124, [OFString stringWithFormat: @"%011" PRIo64 " ", _size], 12, OF_STRING_ENCODING_ASCII); modificationDate = _modificationDate.timeIntervalSince1970; stringToBuffer(buffer + 136, [OFString stringWithFormat: @"%011llo", modificationDate], 12, OF_STRING_ENCODING_ASCII); /* * During checksumming, the checksum field is expected to be set to 8 * spaces. */ memset(buffer + 148, ' ', 8); |
︙ | ︙ |
Modified src/OFURL.m from [50000beafa] to [a6ef5631a2].
︙ | ︙ | |||
488 489 490 491 492 493 494 | length: UTF8String - tmp2]; if (portString.length == 0 || portString.unsignedLongLongValue > 65535) @throw [OFInvalidFormatException exception]; | | | | | | 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 | length: UTF8String - tmp2]; if (portString.length == 0 || portString.unsignedLongLongValue > 65535) @throw [OFInvalidFormatException exception]; _port = [[OFNumber alloc] initWithUnsignedShort: portString.unsignedLongLongValue]; } else if (*UTF8String != '\0') @throw [OFInvalidFormatException exception]; isIPv6Host = true; } else if ((tmp2 = strchr(UTF8String, ':')) != NULL) { OFString *portString; *tmp2 = '\0'; tmp2++; _URLEncodedHost = [[OFString alloc] initWithUTF8String: UTF8String]; portString = [OFString stringWithUTF8String: tmp2]; if (portString.unsignedLongLongValue > 65535) @throw [OFInvalidFormatException exception]; _port = [[OFNumber alloc] initWithUnsignedShort: portString.unsignedLongLongValue]; } else _URLEncodedHost = [[OFString alloc] initWithUTF8String: UTF8String]; if (!isIPv6Host) of_url_verify_escaped(_URLEncodedHost, [OFCharacterSet URLHostAllowedCharacterSet]); |
︙ | ︙ |
Modified tests/OFArrayTests.m from [52ca507d81] to [650205073d].
︙ | ︙ | |||
418 419 420 421 422 423 424 | return left; }]) #endif TEST(@"-[valueForKey:]", [[[arrayClass arrayWithObjects: @"foo", @"bar", @"quxqux", nil] valueForKey: @"length"] isEqual: | | | | | 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | return left; }]) #endif TEST(@"-[valueForKey:]", [[[arrayClass arrayWithObjects: @"foo", @"bar", @"quxqux", nil] valueForKey: @"length"] isEqual: [arrayClass arrayWithObjects: [OFNumber numberWithInt: 3], [OFNumber numberWithInt: 3], [OFNumber numberWithInt: 6], nil]] && [[[arrayClass arrayWithObjects: @"1", @"2", nil] valueForKey: @"@count"] isEqual: [OFNumber numberWithInt: 2]]) m[0] = [mutableArrayClass arrayWithObjects: [OFMutableURL URLWithString: @"http://foo.bar/"], [OFMutableURL URLWithString: @"http://bar.qux/"], [OFMutableURL URLWithString: @"http://qux.quxqux/"], nil]; TEST(@"-[setValue:forKey:]", R([m[0] setValue: [OFNumber numberWithShort: 1234] |
︙ | ︙ |
Modified tests/OFDictionaryTests.m from [f19c5b9455] to [a25483183f].
︙ | ︙ | |||
178 179 180 181 182 183 184 | [[mutDict objectForKey: keys[0]] isEqual: values[0]] && [[mutDict objectForKey: keys[1]] isEqual: values[1]] && [mutDict objectForKey: @"key3"] == nil) TEST(@"-[valueForKey:]", [[mutDict valueForKey: keys[0]] isEqual: values[0]] && [[mutDict valueForKey: @"@count"] isEqual: | | | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | [[mutDict objectForKey: keys[0]] isEqual: values[0]] && [[mutDict objectForKey: keys[1]] isEqual: values[1]] && [mutDict objectForKey: @"key3"] == nil) TEST(@"-[valueForKey:]", [[mutDict valueForKey: keys[0]] isEqual: values[0]] && [[mutDict valueForKey: @"@count"] isEqual: [OFNumber numberWithInt: 2]]) EXPECT_EXCEPTION(@"Catching -[setValue:forKey:] on immutable " @"dictionary", OFUndefinedKeyException, [[dictionaryClass dictionary] setValue: @"x" forKey: @"x"]) TEST(@"-[containsObject:]", |
︙ | ︙ |
Modified tests/OFNumberTests.m from [05bc33864e] to [ccb8cb8682].
︙ | ︙ | |||
27 28 29 30 31 32 33 | void *pool = objc_autoreleasePoolPush(); OFNumber *num; TEST(@"+[numberWithLongLong:]", (num = [OFNumber numberWithLongLong: 123456789])) TEST(@"-[isEqual:]", | | | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | void *pool = objc_autoreleasePoolPush(); OFNumber *num; TEST(@"+[numberWithLongLong:]", (num = [OFNumber numberWithLongLong: 123456789])) TEST(@"-[isEqual:]", [num isEqual: [OFNumber numberWithLong: 123456789]]) TEST(@"-[hash]", num.hash == 0x82D8BC42) TEST(@"-[charValue]", num.charValue == 21) TEST(@"-[doubleValue]", num.doubleValue == 123456789.L) |
︙ | ︙ |
Modified tests/OFSetTests.m from [5ad06a7715] to [1aa6d32b7b].
︙ | ︙ | |||
274 275 276 277 278 279 280 | } TEST(@"Detection of mutation during Fast Enumeration", ok); TEST(@"-[valueForKey:]", [(set1 = [[setClass setWithObjects: @"a", @"ab", @"abc", @"b", nil] valueForKey: @"length"]) isEqual: [setClass setWithObjects: | | | | | 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | } TEST(@"Detection of mutation during Fast Enumeration", ok); TEST(@"-[valueForKey:]", [(set1 = [[setClass setWithObjects: @"a", @"ab", @"abc", @"b", nil] valueForKey: @"length"]) isEqual: [setClass setWithObjects: [OFNumber numberWithInt: 1], [OFNumber numberWithInt: 2], [OFNumber numberWithInt: 3], nil]] && [[set1 valueForKey: @"@count"] isEqual: [OFNumber numberWithInt: 3]]) objc_autoreleasePoolPop(pool); } - (void)setTests { module = @"OFSet"; |
︙ | ︙ |
Modified tests/OFURLTests.m from [8b6c1d8b68] to [52cea266a3].
︙ | ︙ | |||
152 153 154 155 156 157 158 | TEST(@"-[user]", [u1.user isEqual: @"us:er"] && u4.user == nil) TEST(@"-[password]", [u1.password isEqual: @"p@w"] && u4.password == nil) TEST(@"-[host]", [u1.host isEqual: @"ho:st"] && [u6.host isEqual: @"12:34::56:abcd"] && [u7.host isEqual: @"12:34::56:abcd"]) | | | < | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | TEST(@"-[user]", [u1.user isEqual: @"us:er"] && u4.user == nil) TEST(@"-[password]", [u1.password isEqual: @"p@w"] && u4.password == nil) TEST(@"-[host]", [u1.host isEqual: @"ho:st"] && [u6.host isEqual: @"12:34::56:abcd"] && [u7.host isEqual: @"12:34::56:abcd"]) TEST(@"-[port]", u1.port.unsignedShortValue == 1234 && [u4 port] == nil && u7.port.unsignedShortValue == 234) TEST(@"-[path]", [u1.path isEqual: @"/pa?th"] && [u4.path isEqual: @"/etc/passwd"]) TEST(@"-[pathComponents]", [u1.pathComponents isEqual: [OFArray arrayWithObjects: @"/", @"pa?th", nil]] && [u4.pathComponents isEqual: [OFArray arrayWithObjects: @"/", @"etc", @"passwd", nil]] && |
︙ | ︙ |
Modified utils/ofarc/LHAArchive.m from [cb999e6ec3] to [da084987c7].
︙ | ︙ | |||
42 43 44 45 46 47 48 49 50 51 52 53 54 55 | setPermissions(OFString *path, OFLHAArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS OFNumber *mode = entry.mode; if (mode == nil) return; of_file_attributes_t attributes = [OFDictionary dictionaryWithObject: mode forKey: of_file_attribute_key_posix_permissions]; [[OFFileManager defaultManager] setAttributes: attributes ofItemAtPath: path]; | > > > | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | setPermissions(OFString *path, OFLHAArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS OFNumber *mode = entry.mode; if (mode == nil) return; mode = [OFNumber numberWithUnsignedShort: mode.unsignedShortValue & 0777]; of_file_attributes_t attributes = [OFDictionary dictionaryWithObject: mode forKey: of_file_attribute_key_posix_permissions]; [[OFFileManager defaultManager] setAttributes: attributes ofItemAtPath: path]; |
︙ | ︙ | |||
177 178 179 180 181 182 183 | [of_stdout writeLine: OF_LOCALIZED(@"list_date", @"Date: %[date]", @"date", date)]; if (entry.mode != nil) { OFString *modeString = [OFString stringWithFormat: | | | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | [of_stdout writeLine: OF_LOCALIZED(@"list_date", @"Date: %[date]", @"date", date)]; if (entry.mode != nil) { OFString *modeString = [OFString stringWithFormat: @"%ho", entry.mode.unsignedShortValue]; [of_stdout writeString: @"\t"]; [of_stdout writeLine: OF_LOCALIZED(@"list_mode", @"Mode: %[mode]", @"mode", modeString)]; } if (entry.UID != nil) { |
︙ | ︙ | |||
465 466 467 468 469 470 471 | @"file", fileName)]; attributes = [fileManager attributesOfItemAtPath: fileName]; type = attributes.fileType; entry = [OFMutableLHAArchiveEntry entryWithFileName: fileName]; #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS | | | | | 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | @"file", fileName)]; attributes = [fileManager attributesOfItemAtPath: fileName]; type = attributes.fileType; entry = [OFMutableLHAArchiveEntry entryWithFileName: fileName]; #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS entry.mode = [OFNumber numberWithUnsignedLong: attributes.filePOSIXPermissions]; #endif entry.date = attributes.fileModificationDate; #ifdef OF_FILE_MANAGER_SUPPORTS_OWNER entry.UID = [OFNumber numberWithUnsignedLong: attributes.filePOSIXUID]; entry.GID = [OFNumber numberWithUnsignedLong: attributes.filePOSIXGID]; entry.owner = attributes.fileOwner; entry.group = attributes.fileGroup; #endif if ([type isEqual: of_file_type_directory]) entry.compressionMethod = @"-lhd-"; |
︙ | ︙ |
Modified utils/ofarc/TarArchive.m from [ec05b83de8] to [3ca97fcaef].
︙ | ︙ | |||
31 32 33 34 35 36 37 38 | static OFArc *app; static void setPermissions(OFString *path, OFTarArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS of_file_attributes_t attributes = [OFDictionary | > | | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | static OFArc *app; static void setPermissions(OFString *path, OFTarArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS OFNumber *mode = [OFNumber numberWithUnsignedShort: entry.mode & 0777]; of_file_attributes_t attributes = [OFDictionary dictionaryWithObject: mode forKey: of_file_attribute_key_posix_permissions]; [[OFFileManager defaultManager] setAttributes: attributes ofItemAtPath: path]; #endif } |
︙ | ︙ |
Modified utils/ofarc/ZIPArchive.m from [64fc6c92d3] to [4b4d3715d0].
︙ | ︙ | |||
40 41 42 43 44 45 46 | static void setPermissions(OFString *path, OFZIPArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS if ((entry.versionMadeBy >> 8) == OF_ZIP_ARCHIVE_ENTRY_ATTR_COMPAT_UNIX) { | > | | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | static void setPermissions(OFString *path, OFZIPArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS if ((entry.versionMadeBy >> 8) == OF_ZIP_ARCHIVE_ENTRY_ATTR_COMPAT_UNIX) { OFNumber *mode = [OFNumber numberWithUnsignedShort: (entry.versionSpecificAttributes >> 16) & 0777]; of_file_attribute_key_t key = of_file_attribute_key_posix_permissions; of_file_attributes_t attributes = [OFDictionary dictionaryWithObject: mode forKey: key]; [[OFFileManager defaultManager] setAttributes: attributes ofItemAtPath: path]; } #endif } |
︙ | ︙ |
Modified utils/ofsock/OFSock.m from [0c75e9be8d] to [9ce3b460c5].
︙ | ︙ | |||
58 59 60 61 62 63 64 | if (URL.port == nil) { [of_stderr writeLine: @"Need a port!"]; [OFApplication terminateWithStatus: 1]; } [sock connectToHost: URL.host | | | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | if (URL.port == nil) { [of_stderr writeLine: @"Need a port!"]; [OFApplication terminateWithStatus: 1]; } [sock connectToHost: URL.host port: URL.port.shortValue]; return [OFPair pairWithFirstObject: sock secondObject: sock]; } [of_stderr writeFormat: @"Invalid protocol: %@\n", scheme]; [OFApplication terminateWithStatus: 1]; |
︙ | ︙ |