Index: src/OFDNSResolver.m ================================================================== --- src/OFDNSResolver.m +++ src/OFDNSResolver.m @@ -491,11 +491,11 @@ queryData = [OFMutableData dataWithCapacity: 512]; /* Header */ - tmp = OF_BSWAP16_IF_LE(_ID.uInt16Value); + tmp = OF_BSWAP16_IF_LE(_ID.unsignedShortValue); [queryData addItems: &tmp count: 2]; /* RD */ tmp = OF_BSWAP16_IF_LE(1u << 8); @@ -812,11 +812,11 @@ OFNumber *ID; OFDNSResolverContext *context; /* Random, unused ID */ do { - ID = [OFNumber numberWithUInt16: of_random16()]; + ID = [OFNumber numberWithUnsignedShort: of_random16()]; } while ([_queries objectForKey: ID] != nil); if (query.domainName.UTF8StringLength > 253) @throw [OFOutOfRangeException exception]; @@ -911,11 +911,11 @@ if (length < 2) /* We can't get the ID to get the context. Ignore packet. */ return true; - ID = [OFNumber numberWithUInt16: (buffer[0] << 8) | buffer[1]]; + ID = [OFNumber numberWithUnsignedShort: (buffer[0] << 8) | buffer[1]]; context = [[[_queries objectForKey: ID] retain] autorelease]; if (context == nil) return true; Index: src/OFData+MessagePackParsing.m ================================================================== --- src/OFData+MessagePackParsing.m +++ src/OFData+MessagePackParsing.m @@ -191,16 +191,16 @@ if (length < 1) @throw [OFTruncatedDataException exception]; /* positive fixint */ if ((buffer[0] & 0x80) == 0) { - *object = [OFNumber numberWithUInt8: buffer[0] & 0x7F]; + *object = [OFNumber numberWithUnsignedChar: buffer[0] & 0x7F]; return 1; } /* negative fixint */ if ((buffer[0] & 0xE0) == 0xE0) { - *object = [OFNumber numberWithInt8: + *object = [OFNumber numberWithChar: ((int8_t)(buffer[0] & 0x1F)) - 32]; return 1; } /* fixstr */ @@ -231,54 +231,57 @@ /* Unsigned integers */ case 0xCC: /* uint8 */ if (length < 2) @throw [OFTruncatedDataException exception]; - *object = [OFNumber numberWithUInt8: buffer[1]]; + *object = [OFNumber numberWithUnsignedChar: buffer[1]]; return 2; case 0xCD: /* uint 16 */ if (length < 3) @throw [OFTruncatedDataException exception]; - *object = [OFNumber numberWithUInt16: readUInt16(buffer + 1)]; + *object = [OFNumber numberWithUnsignedShort: + readUInt16(buffer + 1)]; return 3; case 0xCE: /* uint 32 */ if (length < 5) @throw [OFTruncatedDataException exception]; - *object = [OFNumber numberWithUInt32: readUInt32(buffer + 1)]; + *object = [OFNumber numberWithUnsignedLong: + readUInt32(buffer + 1)]; return 5; case 0xCF: /* uint 64 */ if (length < 9) @throw [OFTruncatedDataException exception]; - *object = [OFNumber numberWithUInt64: readUInt64(buffer + 1)]; + *object = [OFNumber numberWithUnsignedLongLong: + readUInt64(buffer + 1)]; return 9; /* Signed integers */ case 0xD0: /* int 8 */ if (length < 2) @throw [OFTruncatedDataException exception]; - *object = [OFNumber numberWithInt8: buffer[1]]; + *object = [OFNumber numberWithChar: buffer[1]]; return 2; case 0xD1: /* int 16 */ if (length < 3) @throw [OFTruncatedDataException exception]; - *object = [OFNumber numberWithInt16: readUInt16(buffer + 1)]; + *object = [OFNumber numberWithShort: readUInt16(buffer + 1)]; return 3; case 0xD2: /* int 32 */ if (length < 5) @throw [OFTruncatedDataException exception]; - *object = [OFNumber numberWithInt32: readUInt32(buffer + 1)]; + *object = [OFNumber numberWithLong: readUInt32(buffer + 1)]; return 5; case 0xD3: /* int 64 */ if (length < 9) @throw [OFTruncatedDataException exception]; - *object = [OFNumber numberWithInt64: readUInt64(buffer + 1)]; + *object = [OFNumber numberWithLongLong: readUInt64(buffer + 1)]; return 9; /* Floating point */ case 0xCA:; /* float 32 */ float f; Index: src/OFFileManager.h ================================================================== --- src/OFFileManager.h +++ src/OFFileManager.h @@ -591,25 +591,25 @@ * @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) uint16_t filePOSIXPermissions; +@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) uint32_t filePOSIXUID; +@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) uint32_t filePOSIXGID; +@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. Index: src/OFFileManager.m ================================================================== --- src/OFFileManager.m +++ src/OFFileManager.m @@ -947,26 +947,26 @@ - (of_file_type_t)fileType { return attributeForKeyOrException(self, of_file_attribute_key_type); } -- (uint16_t)filePOSIXPermissions -{ - return [attributeForKeyOrException(self, - of_file_attribute_key_posix_permissions) uInt16Value]; -} - -- (uint32_t)filePOSIXUID -{ - return [attributeForKeyOrException(self, - of_file_attribute_key_posix_uid) uInt32Value]; -} - -- (uint32_t)filePOSIXGID -{ - return [attributeForKeyOrException(self, - of_file_attribute_key_posix_gid) uInt32Value]; +- (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); Index: src/OFFileURLHandler.m ================================================================== --- src/OFFileURLHandler.m +++ src/OFFileURLHandler.m @@ -409,13 +409,13 @@ static void setOwnerAndGroupAttributes(of_mutable_file_attributes_t attributes, of_stat_t *s) { #ifdef OF_FILE_MANAGER_SUPPORTS_OWNER - [attributes setObject: [NSNumber numberWithUInt16: s->st_uid] + [attributes setObject: [NSNumber numberWithUnsignedLong: s->st_uid] forKey: of_file_attribute_key_posix_uid]; - [attributes setObject: [NSNumber numberWithUInt16: s->st_gid] + [attributes setObject: [NSNumber numberWithUnsignedLong: s->st_gid] forKey: of_file_attribute_key_posix_gid]; # ifdef OF_HAVE_THREADS [passwdMutex lock]; @try { @@ -623,11 +623,11 @@ [ret setObject: [NSNumber numberWithUnsignedLongLong: s.st_size] forKey: of_file_attribute_key_size]; setTypeAttribute(ret, &s); - [ret setObject: [NSNumber numberWithUInt16: s.st_mode & 07777] + [ret setObject: [NSNumber numberWithUnsignedLong: s.st_mode] forKey: of_file_attribute_key_posix_permissions]; setOwnerAndGroupAttributes(ret, &s); setDateAttributes(ret, &s); @@ -758,11 +758,11 @@ - (void)of_setPOSIXPermissions: (OFNumber *)permissions ofItemAtURL: (OFURL *)URL attributes: (of_file_attributes_t)attributes OF_DIRECT { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS - uint16_t mode = permissions.uInt16Value & 0777; + mode_t mode = (mode_t)permissions.unsignedLongValue; OFString *path = URL.fileSystemRepresentation; int status; # ifdef OF_WINDOWS if ([OFSystemInfo isWindowsNT]) Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -718,11 +718,11 @@ port = 80; } URLPort = URL.port; if (URLPort != nil) - port = URLPort.uInt16Value; + port = URLPort.unsignedShortValue; sock.delegate = self; [sock asyncConnectToHost: URL.host port: port]; } @catch (id e) { Index: src/OFHTTPServer.m ================================================================== --- src/OFHTTPServer.m +++ src/OFHTTPServer.m @@ -541,11 +541,11 @@ URL = [OFMutableURL URL]; URL.scheme = @"http"; URL.host = _host; if (_port != 80) - URL.port = [OFNumber numberWithUInt16: _port]; + URL.port = [OFNumber numberWithUnsignedShort: _port]; if ((pos = [_path rangeOfString: @"?"].location) != OF_NOT_FOUND) { OFString *path, *query; path = [_path substringWithRange: of_range(0, pos)]; Index: src/OFLHAArchiveEntry.m ================================================================== --- src/OFLHAArchiveEntry.m +++ src/OFLHAArchiveEntry.m @@ -125,11 +125,11 @@ mode = OF_BSWAP16_IF_BE(mode); [entry->_mode release]; entry->_mode = nil; - entry->_mode = [[OFNumber alloc] initWithUInt16: mode]; + entry->_mode = [[OFNumber alloc] initWithUnsignedShort: mode]; } static void parseGIDUIDExtension(OFLHAArchiveEntry *entry, OFData *extension, of_string_encoding_t encoding) @@ -149,12 +149,12 @@ entry->_GID = nil; [entry->_UID release]; entry->_UID = nil; - entry->_GID = [[OFNumber alloc] initWithUInt16: GID]; - entry->_UID = [[OFNumber alloc] initWithUInt16: UID]; + entry->_GID = [[OFNumber alloc] initWithUnsignedShort: GID]; + entry->_UID = [[OFNumber alloc] initWithUnsignedShort: UID]; } static void parseGroupExtension(OFLHAArchiveEntry *entry, OFData *extension, of_string_encoding_t encoding) @@ -653,11 +653,11 @@ tmp16 = OF_BSWAP16_IF_BE(5); [data addItems: &tmp16 count: sizeof(tmp16)]; [data addItem: "\x50"]; - tmp16 = OF_BSWAP16_IF_BE(_mode.uInt16Value); + tmp16 = OF_BSWAP16_IF_BE(_mode.unsignedShortValue); [data addItems: &tmp16 count: sizeof(tmp16)]; } if (_UID != nil || _GID != nil) { @@ -667,15 +667,15 @@ tmp16 = OF_BSWAP16_IF_BE(7); [data addItems: &tmp16 count: sizeof(tmp16)]; [data addItem: "\x51"]; - tmp16 = OF_BSWAP16_IF_BE(_GID.uInt16Value); + tmp16 = OF_BSWAP16_IF_BE(_GID.unsignedShortValue); [data addItems: &tmp16 count: sizeof(tmp16)]; - tmp16 = OF_BSWAP16_IF_BE(_UID.uInt16Value); + tmp16 = OF_BSWAP16_IF_BE(_UID.unsignedShortValue); [data addItems: &tmp16 count: sizeof(tmp16)]; } if (_group != nil) { @@ -759,11 +759,11 @@ - (OFString *)description { void *pool = objc_autoreleasePoolPush(); OFString *mode = (_mode == nil ? nil - : [OFString stringWithFormat: @"%" PRIo16, _mode.uInt16Value]); + : [OFString stringWithFormat: @"%ho", _mode.unsignedShortValue]); OFString *extensions = [_extensions.description stringByReplacingOccurrencesOfString: @"\n" withString: @"\n\t"]; OFString *ret = [OFString stringWithFormat: @"<%@:\n" Index: src/OFMutableTarArchiveEntry.h ================================================================== --- src/OFMutableTarArchiveEntry.h +++ src/OFMutableTarArchiveEntry.h @@ -36,26 +36,26 @@ @property (readwrite, copy, nonatomic) OFString *fileName; /*! * @brief The mode of the entry. */ -@property (readwrite, nonatomic) uint32_t mode; +@property (readwrite, nonatomic) unsigned long mode; /*! * @brief The UID of the owner. */ -@property (readwrite, nonatomic) uint32_t UID; +@property (readwrite, nonatomic) unsigned long UID; /*! * @brief The GID of the group. */ -@property (readwrite, nonatomic) uint32_t GID; +@property (readwrite, nonatomic) unsigned long GID; /*! * @brief The size of the file. */ -@property (readwrite, nonatomic) uint64_t size; +@property (readwrite, nonatomic) unsigned long long size; /*! * @brief The date of the last modification of the file. */ @property (readwrite, retain, nonatomic) OFDate *modificationDate; @@ -84,20 +84,20 @@ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *group; /*! * @brief The device major (if the file is a device). */ -@property (readwrite, nonatomic) uint32_t deviceMajor; +@property (readwrite, nonatomic) unsigned long deviceMajor; /*! * @brief The device major (if the file is a device). */ -@property (readwrite, nonatomic) uint32_t deviceMinor; +@property (readwrite, nonatomic) unsigned long deviceMinor; /*! * @brief Converts the OFMutableTarArchiveEntry to an immutable * OFTarArchiveEntry. */ - (void)makeImmutable; @end OF_ASSUME_NONNULL_END Index: src/OFMutableTarArchiveEntry.m ================================================================== --- src/OFMutableTarArchiveEntry.m +++ src/OFMutableTarArchiveEntry.m @@ -39,26 +39,26 @@ OFString *old = _fileName; _fileName = [fileName copy]; [old release]; } -- (void)setMode: (uint32_t)mode +- (void)setMode: (unsigned long)mode { _mode = mode; } -- (void)setUID: (uint32_t)UID +- (void)setUID: (unsigned long)UID { _UID = UID; } -- (void)setGID: (uint32_t)GID +- (void)setGID: (unsigned long)GID { _GID = GID; } -- (void)setSize: (uint64_t)size +- (void)setSize: (unsigned long long)size { _size = size; } - (void)setModificationDate: (OFDate *)modificationDate @@ -92,20 +92,20 @@ OFString *old = _group; _group = [group copy]; [old release]; } -- (void)setDeviceMajor: (uint32_t)deviceMajor +- (void)setDeviceMajor: (unsigned long)deviceMajor { _deviceMajor = deviceMajor; } -- (void)setDeviceMinor: (uint32_t)deviceMinor +- (void)setDeviceMinor: (unsigned long)deviceMinor { _deviceMinor = deviceMinor; } - (void)makeImmutable { object_setClass(self, [OFTarArchiveEntry class]); } @end Index: src/OFNumber.h ================================================================== --- src/OFNumber.h +++ src/OFNumber.h @@ -114,70 +114,10 @@ /*! * @brief The OFNumber as an `unsigned long long`. */ @property (readonly, nonatomic) unsigned long long unsignedLongLongValue; -/*! - * @brief The OFNumber as an `int8_t`. - */ -@property (readonly, nonatomic) int8_t int8Value; - -/*! - * @brief The OFNumber as an `int16_t`. - */ -@property (readonly, nonatomic) int16_t int16Value; - -/*! - * @brief The OFNumber as an `int32_t`. - */ -@property (readonly, nonatomic) int32_t int32Value; - -/*! - * @brief The OFNumber as an `int64_t`. - */ -@property (readonly, nonatomic) int64_t int64Value; - -/*! - * @brief The OFNumber as a `uint8_t`. - */ -@property (readonly, nonatomic) uint8_t uInt8Value; - -/*! - * @brief The OFNumber as a `uint16_t`. - */ -@property (readonly, nonatomic) uint16_t uInt16Value; - -/*! - * @brief The OFNumber as a `uint32_t`. - */ -@property (readonly, nonatomic) uint32_t uInt32Value; - -/*! - * @brief The OFNumber as a `uint64_t`. - */ -@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`. - */ -@property (readonly, nonatomic) intptr_t intPtrValue; - -/*! - * @brief The OFNumber as a `uintptr_t`. - */ -@property (readonly, nonatomic) uintptr_t uIntPtrValue; - /*! * @brief The OFNumber as a `float`. */ @property (readonly, nonatomic) float floatValue; @@ -288,106 +228,10 @@ * @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 `int8_t`. - * - * @param value The `int8_t` value which the OFNumber should contain - * @return A new autoreleased OFNumber - */ -+ (instancetype)numberWithInt8: (int8_t)value; - -/*! - * @brief Creates a new OFNumber with the specified `int16_t`. - * - * @param value The `int16_t` value which the OFNumber should contain - * @return A new autoreleased OFNumber - */ -+ (instancetype)numberWithInt16: (int16_t)value; - -/*! - * @brief Creates a new OFNumber with the specified `int32_t`. - * - * @param value The `int32_t` value which the OFNumber should contain - * @return A new autoreleased OFNumber - */ -+ (instancetype)numberWithInt32: (int32_t)value; - -/*! - * @brief Creates a new OFNumber with the specified `int64_t`. - * - * @param value The `int64_t` value which the OFNumber should contain - * @return A new autoreleased OFNumber - */ -+ (instancetype)numberWithInt64: (int64_t)value; - -/*! - * @brief Creates a new OFNumber with the specified `uint8_t`. - * - * @param value The `uint8_t` value which the OFNumber should contain - * @return A new autoreleased OFNumber - */ -+ (instancetype)numberWithUInt8: (uint8_t)value; - -/*! - * @brief Creates a new OFNumber with the specified `uint16_t`. - * - * @param value The `uint16_t` value which the OFNumber should contain - * @return A new autoreleased OFNumber - */ -+ (instancetype)numberWithUInt16: (uint16_t)value; - -/*! - * @brief Creates a new OFNumber with the specified `uint32_t`. - * - * @param value The `uint32_t` value which the OFNumber should contain - * @return A new autoreleased OFNumber - */ -+ (instancetype)numberWithUInt32: (uint32_t)value; - -/*! - * @brief Creates a new OFNumber with the specified `uint64_t`. - * - * @param value The `uint64_t` value which the OFNumber should contain - * @return A new autoreleased OFNumber - */ -+ (instancetype)numberWithUInt64: (uint64_t)value; - -/*! - * @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; - -/*! - * @brief Creates a new OFNumber with the specified `intptr_t`. - * - * @param value The `intptr_t` value which the OFNumber should contain - * @return A new autoreleased OFNumber - */ -+ (instancetype)numberWithIntPtr: (intptr_t)value; - -/*! - * @brief Creates a new OFNumber with the specified `uintptr_t`. - * - * @param value The `uintptr_t` value which the OFNumber should contain - * @return A new autoreleased OFNumber - */ -+ (instancetype)numberWithUIntPtr: (uintptr_t)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 @@ -507,116 +351,10 @@ * @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 `int8_t`. - * - * @param value The `int8_t` value which the OFNumber should contain - * @return An initialized OFNumber - */ -- (instancetype)initWithInt8: (int8_t)value; - -/*! - * @brief Initializes an already allocated OFNumber with the specified - * `int16_t`. - * - * @param value The `int16_t` value which the OFNumber should contain - * @return An initialized OFNumber - */ -- (instancetype)initWithInt16: (int16_t)value; - -/*! - * @brief Initializes an already allocated OFNumber with the specified - * `int32_t`. - * - * @param value The `int32_t` value which the OFNumber should contain - * @return An initialized OFNumber - */ -- (instancetype)initWithInt32: (int32_t)value; - -/*! - * @brief Initializes an already allocated OFNumber with the specified - * `int64_t`. - * - * @param value The `int64_t` value which the OFNumber should contain - * @return An initialized OFNumber - */ -- (instancetype)initWithInt64: (int64_t)value; - -/*! - * @brief Initializes an already allocated OFNumber with the specified - * `uint8_t`. - * - * @param value The `uint8_t` value which the OFNumber should contain - * @return An initialized OFNumber - */ -- (instancetype)initWithUInt8: (uint8_t)value; - -/*! - * @brief Initializes an already allocated OFNumber with the specified - * `uint16_t`. - * - * @param value The `uint16_t` value which the OFNumber should contain - * @return An initialized OFNumber - */ -- (instancetype)initWithUInt16: (uint16_t)value; - -/*! - * @brief Initializes an already allocated OFNumber with the specified - * `uint32_t`. - * - * @param value The `uint32_t` value which the OFNumber should contain - * @return An initialized OFNumber - */ -- (instancetype)initWithUInt32: (uint32_t)value; - -/*! - * @brief Initializes an already allocated OFNumber with the specified - * `uint64_t`. - * - * @param value The `uint64_t` value which the OFNumber should contain - * @return An initialized OFNumber - */ -- (instancetype)initWithUInt64: (uint64_t)value; - -/*! - * @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 - */ -- (instancetype)initWithPtrDiff: (ptrdiff_t)value; - -/*! - * @brief Initializes an already allocated OFNumber with the specified - * `intptr_t`. - * - * @param value The `intptr_t` value which the OFNumber should contain - * @return An initialized OFNumber - */ -- (instancetype)initWithIntPtr: (intptr_t)value; - -/*! - * @brief Initializes an already allocated OFNumber with the specified - * `uintptr_t`. - * - * @param value The `uintptr_t` value which the OFNumber should contain - * @return An initialized OFNumber - */ -- (instancetype)initWithUIntPtr: (uintptr_t)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 Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -65,18 +65,10 @@ SINGLETON(unsignedCharZeroNumber, initWithUnsignedChar:, 0) SINGLETON(unsignedShortZeroNumber, initWithUnsignedShort:, 0) SINGLETON(unsignedIntZeroNumber, initWithUnsignedInt:, 0) SINGLETON(unsignedLongZeroNumber, initWithUnsignedLong:, 0) SINGLETON(unsignedLongLongZeroNumber, initWithUnsignedLongLong:, 0) -SINGLETON(int8ZeroNumber, initWithInt8:, 0) -SINGLETON(int16ZeroNumber, initWithInt16:, 0) -SINGLETON(int32ZeroNumber, initWithInt32:, 0) -SINGLETON(int64ZeroNumber, initWithInt64:, 0) -SINGLETON(uInt8ZeroNumber, initWithUInt8:, 0) -SINGLETON(uInt16ZeroNumber, initWithUInt16:, 0) -SINGLETON(uInt32ZeroNumber, initWithUInt32:, 0) -SINGLETON(uInt64ZeroNumber, initWithUInt64:, 0) SINGLETON(floatZeroNumber, initWithFloat:, 0) SINGLETON(doubleZeroNumber, initWithDouble:, 0) #undef SINGLETON @implementation OFNumberPlaceholder @@ -201,118 +193,10 @@ } return (id)[[OFNumber of_alloc] initWithUnsignedLongLong: value]; } -- (instancetype)initWithInt8: (int8_t)value -{ - if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, int8ZeroNumberInit); - return (id)int8ZeroNumber; - } - - return (id)[[OFNumber of_alloc] initWithInt8: value]; -} - -- (instancetype)initWithInt16: (int16_t)value -{ - if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, int16ZeroNumberInit); - return (id)int16ZeroNumber; - } - - return (id)[[OFNumber of_alloc] initWithInt16: value]; -} - -- (instancetype)initWithInt32: (int32_t)value -{ - if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, int32ZeroNumberInit); - return (id)int32ZeroNumber; - } - - return (id)[[OFNumber of_alloc] initWithInt32: value]; -} - -- (instancetype)initWithInt64: (int64_t)value -{ - if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, int64ZeroNumberInit); - return (id)int64ZeroNumber; - } - - return (id)[[OFNumber of_alloc] initWithInt64: value]; -} - -- (instancetype)initWithUInt8: (uint8_t)value -{ - if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, uInt8ZeroNumberInit); - return (id)uInt8ZeroNumber; - } - - return (id)[[OFNumber of_alloc] initWithUInt8: value]; -} - -- (instancetype)initWithUInt16: (uint16_t)value -{ - if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, uInt16ZeroNumberInit); - return (id)uInt16ZeroNumber; - } - - return (id)[[OFNumber of_alloc] initWithUInt16: value]; -} - -- (instancetype)initWithUInt32: (uint32_t)value -{ - if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, uInt32ZeroNumberInit); - return (id)uInt32ZeroNumber; - } - - return (id)[[OFNumber of_alloc] initWithUInt32: value]; -} - -- (instancetype)initWithUInt64: (uint64_t)value -{ - if (value == 0) { - static of_once_t once = OF_ONCE_INIT; - of_once(&once, uInt64ZeroNumberInit); - return (id)uInt64ZeroNumber; - } - - return (id)[[OFNumber of_alloc] initWithUInt64: value]; -} - -- (instancetype)initWithSize: (size_t)value -{ - return (id)[[OFNumber of_alloc] initWithSize: value]; -} - -- (instancetype)initWithPtrDiff: (ptrdiff_t)value -{ - return (id)[[OFNumber of_alloc] initWithPtrDiff: value]; -} - -- (instancetype)initWithIntPtr: (intptr_t)value -{ - return (id)[[OFNumber of_alloc] initWithIntPtr: value]; -} - -- (instancetype)initWithUIntPtr: (uintptr_t)value -{ - return (id)[[OFNumber of_alloc] initWithUIntPtr: value]; -} - - (instancetype)initWithFloat: (float)value { if (value == 0) { static of_once_t once = OF_ONCE_INIT; of_once(&once, floatZeroNumberInit); @@ -433,70 +317,10 @@ + (instancetype)numberWithUnsignedLongLong: (unsigned long long)value { return [[[self alloc] initWithUnsignedLongLong: value] autorelease]; } -+ (instancetype)numberWithInt8: (int8_t)value -{ - return [[[self alloc] initWithInt8: value] autorelease]; -} - -+ (instancetype)numberWithInt16: (int16_t)value -{ - return [[[self alloc] initWithInt16: value] autorelease]; -} - -+ (instancetype)numberWithInt32: (int32_t)value -{ - return [[[self alloc] initWithInt32: value] autorelease]; -} - -+ (instancetype)numberWithInt64: (int64_t)value -{ - return [[[self alloc] initWithInt64: value] autorelease]; -} - -+ (instancetype)numberWithUInt8: (uint8_t)value -{ - return [[[self alloc] initWithUInt8: value] autorelease]; -} - -+ (instancetype)numberWithUInt16: (uint16_t)value -{ - return [[[self alloc] initWithUInt16: value] autorelease]; -} - -+ (instancetype)numberWithUInt32: (uint32_t)value -{ - return [[[self alloc] initWithUInt32: value] autorelease]; -} - -+ (instancetype)numberWithUInt64: (uint64_t)value -{ - return [[[self alloc] initWithUInt64: value] autorelease]; -} - -+ (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 -{ - return [[[self alloc] initWithIntPtr: value] autorelease]; -} - -+ (instancetype)numberWithUIntPtr: (uintptr_t)value -{ - return [[[self alloc] initWithUIntPtr: value] autorelease]; -} - + (instancetype)numberWithFloat: (float)value { return [[[self alloc] initWithFloat: value] autorelease]; } @@ -626,109 +450,10 @@ _value.unsigned_ = value; _type = OF_NUMBER_TYPE_UNSIGNED; _typeEncoding = @encode(unsigned long long); - return self; -} - -- (instancetype)initWithInt8: (int8_t)value -{ - self = [super init]; - - _value.signed_ = value; - _type = OF_NUMBER_TYPE_SIGNED; - _typeEncoding = @encode(int8_t); - - return self; -} - -- (instancetype)initWithInt16: (int16_t)value -{ - self = [super init]; - - _value.signed_ = value; - _type = OF_NUMBER_TYPE_SIGNED; - _typeEncoding = @encode(int16_t); - - return self; -} - -- (instancetype)initWithInt32: (int32_t)value -{ - self = [super init]; - - _value.signed_ = value; - _type = OF_NUMBER_TYPE_SIGNED; - _typeEncoding = @encode(int32_t); - - return self; -} - -- (instancetype)initWithInt64: (int64_t)value -{ - self = [super init]; - - _value.signed_ = value; - _type = OF_NUMBER_TYPE_SIGNED; - _typeEncoding = @encode(int64_t); - - return self; -} - -- (instancetype)initWithUInt8: (uint8_t)value -{ - self = [super init]; - - _value.unsigned_ = value; - _type = OF_NUMBER_TYPE_UNSIGNED; - _typeEncoding = @encode(uint8_t); - - return self; -} - -- (instancetype)initWithUInt16: (uint16_t)value -{ - self = [super init]; - - _value.unsigned_ = value; - _type = OF_NUMBER_TYPE_UNSIGNED; - _typeEncoding = @encode(uint16_t); - - return self; -} - -- (instancetype)initWithUInt32: (uint32_t)value -{ - self = [super init]; - - _value.unsigned_ = value; - _type = OF_NUMBER_TYPE_UNSIGNED; - _typeEncoding = @encode(uint32_t); - - return self; -} - -- (instancetype)initWithUInt64: (uint64_t)value -{ - self = [super init]; - - _value.unsigned_ = value; - _type = OF_NUMBER_TYPE_UNSIGNED; - _typeEncoding = @encode(uint64_t); - - return self; -} - -- (instancetype)initWithSize: (size_t)value -{ - self = [super init]; - - _value.unsigned_ = value; - _type = OF_NUMBER_TYPE_UNSIGNED; - _typeEncoding = @encode(size_t); - return self; } - (instancetype)initWithPtrDiff: (ptrdiff_t)value { @@ -935,70 +660,10 @@ - (unsigned long long)unsignedLongLongValue { RETURN_AS(unsigned long long) } -- (int8_t)int8Value -{ - RETURN_AS(int8_t) -} - -- (int16_t)int16Value -{ - RETURN_AS(int16_t) -} - -- (int32_t)int32Value -{ - RETURN_AS(int32_t) -} - -- (int64_t)int64Value -{ - RETURN_AS(int64_t) -} - -- (uint8_t)uInt8Value -{ - RETURN_AS(uint8_t) -} - -- (uint16_t)uInt16Value -{ - RETURN_AS(uint16_t) -} - -- (uint32_t)uInt32Value -{ - RETURN_AS(uint32_t) -} - -- (uint64_t)uInt64Value -{ - RETURN_AS(uint64_t) -} - -- (size_t)sizeValue -{ - RETURN_AS(size_t) -} - -- (ptrdiff_t)ptrDiffValue -{ - RETURN_AS(ptrdiff_t) -} - -- (intptr_t)intPtrValue -{ - RETURN_AS(intptr_t) -} - -- (uintptr_t)uIntPtrValue -{ - RETURN_AS(uintptr_t) -} - - (float)floatValue { RETURN_AS(float) } Index: src/OFTarArchiveEntry.h ================================================================== --- src/OFTarArchiveEntry.h +++ src/OFTarArchiveEntry.h @@ -51,18 +51,18 @@ * @brief A class which represents an entry of a tar archive. */ @interface OFTarArchiveEntry: OFObject { OFString *_fileName; - uint32_t _mode; - uint64_t _size; - uint32_t _UID, _GID; + 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; - uint32_t _deviceMajor, _deviceMinor; + unsigned long _deviceMajor, _deviceMinor; OF_RESERVE_IVARS(4) } /*! * @brief The file name of the entry. @@ -70,26 +70,26 @@ @property (readonly, copy, nonatomic) OFString *fileName; /*! * @brief The mode of the entry. */ -@property (readonly, nonatomic) uint32_t mode; +@property (readonly, nonatomic) unsigned long mode; /*! * @brief The UID of the owner. */ -@property (readonly, nonatomic) uint32_t UID; +@property (readonly, nonatomic) unsigned long UID; /*! * @brief The GID of the group. */ -@property (readonly, nonatomic) uint32_t GID; +@property (readonly, nonatomic) unsigned long GID; /*! * @brief The size of the file. */ -@property (readonly, nonatomic) uint64_t size; +@property (readonly, nonatomic) unsigned long long size; /*! * @brief The date of the last modification of the file. */ @property (readonly, retain, nonatomic) OFDate *modificationDate; @@ -118,16 +118,16 @@ @property OF_NULLABLE_PROPERTY (readonly, copy, nonatomic) OFString *group; /*! * @brief The device major (if the file is a device). */ -@property (readonly, nonatomic) uint32_t deviceMajor; +@property (readonly, nonatomic) unsigned long deviceMajor; /*! * @brief The device major (if the file is a device). */ -@property (readonly, nonatomic) uint32_t deviceMinor; +@property (readonly, nonatomic) unsigned long deviceMinor; /*! * @brief Creates a new OFTarArchiveEntry with the specified file name. * * @param fileName The file name for the OFTarArchiveEntry Index: src/OFTarArchiveEntry.m ================================================================== --- src/OFTarArchiveEntry.m +++ src/OFTarArchiveEntry.m @@ -94,18 +94,18 @@ @try { void *pool = objc_autoreleasePoolPush(); OFString *targetFileName; _fileName = [stringFromBuffer(header, 100, encoding) copy]; - _mode = (uint32_t)octalValueFromBuffer( - header + 100, 8, UINT32_MAX); - _UID = (uint32_t)octalValueFromBuffer( - header + 108, 8, UINT32_MAX); - _GID = (uint32_t)octalValueFromBuffer( - header + 116, 8, UINT32_MAX); - _size = (uint64_t)octalValueFromBuffer( - header + 124, 12, UINT64_MAX); + _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]; @@ -123,14 +123,14 @@ _owner = [stringFromBuffer(header + 265, 32, encoding) copy]; _group = [stringFromBuffer(header + 297, 32, encoding) copy]; - _deviceMajor = (uint32_t)octalValueFromBuffer( - header + 329, 8, UINT32_MAX); - _deviceMinor = (uint32_t)octalValueFromBuffer( - header + 337, 8, UINT32_MAX); + _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: @"%@/%@", @@ -207,26 +207,26 @@ - (OFString *)fileName { return _fileName; } -- (uint32_t)mode +- (unsigned long)mode { return _mode; } -- (uint32_t)UID +- (unsigned long)UID { return _UID; } -- (uint32_t)GID +- (unsigned long)GID { return _GID; } -- (uint64_t)size +- (unsigned long long)size { return _size; } - (OFDate *)modificationDate @@ -252,16 +252,16 @@ - (OFString *)group { return _group; } -- (uint32_t)deviceMajor +- (unsigned long)deviceMajor { return _deviceMajor; } -- (uint32_t)deviceMinor +- (unsigned long)deviceMinor { return _deviceMinor; } - (OFString *)description @@ -293,11 +293,11 @@ - (void)of_writeToStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding { unsigned char buffer[512]; - uint64_t modificationDate; + unsigned long long modificationDate; uint16_t checksum = 0; stringToBuffer(buffer, _fileName, 100, encoding); stringToBuffer(buffer + 100, [OFString stringWithFormat: @"%06" PRIo16 " ", _mode], 8, @@ -311,11 +311,11 @@ stringToBuffer(buffer + 124, [OFString stringWithFormat: @"%011" PRIo64 " ", _size], 12, OF_STRING_ENCODING_ASCII); modificationDate = _modificationDate.timeIntervalSince1970; stringToBuffer(buffer + 136, - [OFString stringWithFormat: @"%011" PRIo64 " ", modificationDate], + [OFString stringWithFormat: @"%011llo", modificationDate], 12, OF_STRING_ENCODING_ASCII); /* * During checksumming, the checksum field is expected to be set to 8 * spaces. Index: src/OFURL.m ================================================================== --- src/OFURL.m +++ src/OFURL.m @@ -490,12 +490,12 @@ if (portString.length == 0 || portString.unsignedLongLongValue > 65535) @throw [OFInvalidFormatException exception]; - _port = [[OFNumber alloc] initWithUInt16: - (uint16_t)portString.unsignedLongLongValue]; + _port = [[OFNumber alloc] initWithUnsignedShort: + portString.unsignedLongLongValue]; } else if (*UTF8String != '\0') @throw [OFInvalidFormatException exception]; isIPv6Host = true; } else if ((tmp2 = strchr(UTF8String, ':')) != NULL) { @@ -510,12 +510,12 @@ portString = [OFString stringWithUTF8String: tmp2]; if (portString.unsignedLongLongValue > 65535) @throw [OFInvalidFormatException exception]; - _port = [[OFNumber alloc] initWithUInt16: - (uint16_t)portString.unsignedLongLongValue]; + _port = [[OFNumber alloc] initWithUnsignedShort: + portString.unsignedLongLongValue]; } else _URLEncodedHost = [[OFString alloc] initWithUTF8String: UTF8String]; if (!isIPv6Host) Index: tests/OFArrayTests.m ================================================================== --- tests/OFArrayTests.m +++ tests/OFArrayTests.m @@ -420,14 +420,14 @@ #endif TEST(@"-[valueForKey:]", [[[arrayClass arrayWithObjects: @"foo", @"bar", @"quxqux", nil] valueForKey: @"length"] isEqual: - [arrayClass arrayWithObjects: [OFNumber numberWithSize: 3], - [OFNumber numberWithSize: 3], [OFNumber numberWithSize: 6], nil]] && + [arrayClass arrayWithObjects: [OFNumber numberWithInt: 3], + [OFNumber numberWithInt: 3], [OFNumber numberWithInt: 6], nil]] && [[[arrayClass arrayWithObjects: @"1", @"2", nil] - valueForKey: @"@count"] isEqual: [OFNumber numberWithSize: 2]]) + 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]; Index: tests/OFDictionaryTests.m ================================================================== --- tests/OFDictionaryTests.m +++ tests/OFDictionaryTests.m @@ -180,11 +180,11 @@ [mutDict objectForKey: @"key3"] == nil) TEST(@"-[valueForKey:]", [[mutDict valueForKey: keys[0]] isEqual: values[0]] && [[mutDict valueForKey: @"@count"] isEqual: - [OFNumber numberWithSize: 2]]) + [OFNumber numberWithInt: 2]]) EXPECT_EXCEPTION(@"Catching -[setValue:forKey:] on immutable " @"dictionary", OFUndefinedKeyException, [[dictionaryClass dictionary] setValue: @"x" forKey: @"x"]) Index: tests/OFNumberTests.m ================================================================== --- tests/OFNumberTests.m +++ tests/OFNumberTests.m @@ -29,11 +29,11 @@ TEST(@"+[numberWithLongLong:]", (num = [OFNumber numberWithLongLong: 123456789])) TEST(@"-[isEqual:]", - [num isEqual: [OFNumber numberWithUInt32: 123456789]]) + [num isEqual: [OFNumber numberWithLong: 123456789]]) TEST(@"-[hash]", num.hash == 0x82D8BC42) TEST(@"-[charValue]", num.charValue == 21) Index: tests/OFSetTests.m ================================================================== --- tests/OFSetTests.m +++ tests/OFSetTests.m @@ -276,14 +276,14 @@ TEST(@"Detection of mutation during Fast Enumeration", ok); TEST(@"-[valueForKey:]", [(set1 = [[setClass setWithObjects: @"a", @"ab", @"abc", @"b", nil] valueForKey: @"length"]) isEqual: [setClass setWithObjects: - [OFNumber numberWithSize: 1], [OFNumber numberWithSize: 2], - [OFNumber numberWithSize: 3], nil]] && + [OFNumber numberWithInt: 1], [OFNumber numberWithInt: 2], + [OFNumber numberWithInt: 3], nil]] && [[set1 valueForKey: @"@count"] isEqual: - [OFNumber numberWithSize: 3]]) + [OFNumber numberWithInt: 3]]) objc_autoreleasePoolPop(pool); } - (void)setTests Index: tests/OFURLTests.m ================================================================== --- tests/OFURLTests.m +++ tests/OFURLTests.m @@ -154,13 +154,12 @@ 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 isEqual: [OFNumber numberWithUInt16: 1234]] && - [u4 port] == nil && - [u7.port isEqual: [OFNumber numberWithUInt16: 234]]) + 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]] && Index: utils/ofarc/LHAArchive.m ================================================================== --- utils/ofarc/LHAArchive.m +++ utils/ofarc/LHAArchive.m @@ -44,10 +44,13 @@ #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]; @@ -179,11 +182,11 @@ @"date", date)]; if (entry.mode != nil) { OFString *modeString = [OFString stringWithFormat: - @"%" PRIo16, entry.mode.uInt16Value]; + @"%ho", entry.mode.unsignedShortValue]; [of_stdout writeString: @"\t"]; [of_stdout writeLine: OF_LOCALIZED(@"list_mode", @"Mode: %[mode]", @"mode", modeString)]; @@ -467,20 +470,20 @@ attributes = [fileManager attributesOfItemAtPath: fileName]; type = attributes.fileType; entry = [OFMutableLHAArchiveEntry entryWithFileName: fileName]; #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS - entry.mode = [OFNumber numberWithUInt16: + entry.mode = [OFNumber numberWithUnsignedLong: attributes.filePOSIXPermissions]; #endif entry.date = attributes.fileModificationDate; #ifdef OF_FILE_MANAGER_SUPPORTS_OWNER entry.UID = - [OFNumber numberWithUInt16: attributes.filePOSIXUID]; + [OFNumber numberWithUnsignedLong: attributes.filePOSIXUID]; entry.GID = - [OFNumber numberWithUInt16: attributes.filePOSIXGID]; + [OFNumber numberWithUnsignedLong: attributes.filePOSIXGID]; entry.owner = attributes.fileOwner; entry.group = attributes.fileGroup; #endif if ([type isEqual: of_file_type_directory]) Index: utils/ofarc/TarArchive.m ================================================================== --- utils/ofarc/TarArchive.m +++ utils/ofarc/TarArchive.m @@ -33,12 +33,13 @@ 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: [OFNumber numberWithUInt16: entry.mode] + dictionaryWithObject: mode forKey: of_file_attribute_key_posix_permissions]; [[OFFileManager defaultManager] setAttributes: attributes ofItemAtPath: path]; #endif Index: utils/ofarc/ZIPArchive.m ================================================================== --- utils/ofarc/ZIPArchive.m +++ utils/ofarc/ZIPArchive.m @@ -42,15 +42,16 @@ setPermissions(OFString *path, OFZIPArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS if ((entry.versionMadeBy >> 8) == OF_ZIP_ARCHIVE_ENTRY_ATTR_COMPAT_UNIX) { - uint16_t mode = entry.versionSpecificAttributes >> 16; + 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: [OFNumber numberWithUInt16: mode] + dictionaryWithObject: mode forKey: key]; [[OFFileManager defaultManager] setAttributes: attributes ofItemAtPath: path]; } Index: utils/ofsock/OFSock.m ================================================================== --- utils/ofsock/OFSock.m +++ utils/ofsock/OFSock.m @@ -60,11 +60,11 @@ [of_stderr writeLine: @"Need a port!"]; [OFApplication terminateWithStatus: 1]; } [sock connectToHost: URL.host - port: URL.port.uInt16Value]; + port: URL.port.shortValue]; return [OFPair pairWithFirstObject: sock secondObject: sock]; }