Index: src/OFASN1BitString.m ================================================================== --- src/OFASN1BitString.m +++ src/OFASN1BitString.m @@ -170,16 +170,16 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { - return _bitStringValue.hash + (uint32_t)_bitStringLength; + return _bitStringValue.hash + (unsigned long)_bitStringLength; } - (OFString *)description { return [OFString stringWithFormat: @"", _bitStringValue, _bitStringLength]; } @end Index: src/OFASN1Boolean.m ================================================================== --- src/OFASN1Boolean.m +++ src/OFASN1Boolean.m @@ -102,17 +102,17 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { - return (uint32_t)_booleanValue; + return _booleanValue; } - (OFString *)description { return (_booleanValue ? @"" : @""); } @end Index: src/OFASN1Enumerated.m ================================================================== --- src/OFASN1Enumerated.m +++ src/OFASN1Enumerated.m @@ -89,16 +89,16 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { - return (uint32_t)_longLongValue; + return (unsigned long)_longLongValue; } - (OFString *)description { return [OFString stringWithFormat: @"", _longLongValue]; } @end Index: src/OFASN1IA5String.m ================================================================== --- src/OFASN1IA5String.m +++ src/OFASN1IA5String.m @@ -110,11 +110,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { return _IA5StringValue.hash; } - (OFString *)description Index: src/OFASN1Integer.m ================================================================== --- src/OFASN1Integer.m +++ src/OFASN1Integer.m @@ -111,16 +111,16 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { - return (uint32_t)_longLongValue; + return (unsigned long)_longLongValue; } - (OFString *)description { return [OFString stringWithFormat: @"", _longLongValue]; } @end Index: src/OFASN1NumericString.m ================================================================== --- src/OFASN1NumericString.m +++ src/OFASN1NumericString.m @@ -122,11 +122,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { return _numericStringValue.hash; } - (OFString *)description Index: src/OFASN1ObjectIdentifier.m ================================================================== --- src/OFASN1ObjectIdentifier.m +++ src/OFASN1ObjectIdentifier.m @@ -167,11 +167,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { return _subidentifiers.hash; } - (OFString *)description Index: src/OFASN1OctetString.m ================================================================== --- src/OFASN1OctetString.m +++ src/OFASN1OctetString.m @@ -95,11 +95,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { return _octetStringValue.hash; } - (OFString *)description Index: src/OFASN1PrintableString.m ================================================================== --- src/OFASN1PrintableString.m +++ src/OFASN1PrintableString.m @@ -142,11 +142,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { return _printableStringValue.hash; } - (OFString *)description Index: src/OFASN1UTF8String.m ================================================================== --- src/OFASN1UTF8String.m +++ src/OFASN1UTF8String.m @@ -109,11 +109,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { return _UTF8StringValue.hash; } - (OFString *)description Index: src/OFASN1Value.m ================================================================== --- src/OFASN1Value.m +++ src/OFASN1Value.m @@ -97,11 +97,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFAdjacentArray.m ================================================================== --- src/OFAdjacentArray.m +++ src/OFAdjacentArray.m @@ -306,11 +306,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { id const *objects = _array.items; size_t count = _array.count; uint32_t hash; Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -513,11 +513,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFColor.m ================================================================== --- src/OFColor.m +++ src/OFColor.m @@ -120,11 +120,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; float tmp; OF_HASH_INIT(hash); Index: src/OFConstantString.m ================================================================== --- src/OFConstantString.m +++ src/OFConstantString.m @@ -258,11 +258,11 @@ [self finishInitialization]; return [self isEqual: object]; } -- (uint32_t)hash +- (unsigned long)hash { [self finishInitialization]; return self.hash; } Index: src/OFDNSQuery.m ================================================================== --- src/OFDNSQuery.m +++ src/OFDNSQuery.m @@ -91,11 +91,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); OF_HASH_ADD_HASH(hash, _domainName.hash); Index: src/OFDNSResourceRecord.m ================================================================== --- src/OFDNSResourceRecord.m +++ src/OFDNSResourceRecord.m @@ -241,11 +241,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); @@ -327,11 +327,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); @@ -423,11 +423,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); @@ -526,11 +526,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); @@ -631,11 +631,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); @@ -732,11 +732,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); @@ -830,11 +830,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); @@ -935,11 +935,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); @@ -1071,11 +1071,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); @@ -1212,11 +1212,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); @@ -1317,11 +1317,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFDNSResponse.m ================================================================== --- src/OFDNSResponse.m +++ src/OFDNSResponse.m @@ -100,11 +100,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); OF_HASH_ADD_HASH(hash, _domainName.hash); Index: src/OFData.m ================================================================== --- src/OFData.m +++ src/OFData.m @@ -487,11 +487,11 @@ return OF_ORDERED_DESCENDING; else return OF_ORDERED_ASCENDING; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -536,11 +536,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; double tmp; OF_HASH_INIT(hash); Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -595,22 +595,22 @@ return new; } #endif -- (uint32_t)hash +- (unsigned long)hash { void *pool = objc_autoreleasePoolPush(); OFEnumerator *keyEnumerator = [self keyEnumerator]; OFEnumerator *objectEnumerator = [self objectEnumerator]; id key, object; - uint32_t hash = 0; + unsigned long hash = 0; while ((key = [keyEnumerator nextObject]) != nil && (object = [objectEnumerator nextObject]) != nil) { - hash += [key hash]; - hash += [object hash]; + hash ^= [key hash]; + hash ^= [object hash]; } objc_autoreleasePoolPop(pool); return hash; Index: src/OFHTTPCookie.m ================================================================== --- src/OFHTTPCookie.m +++ src/OFHTTPCookie.m @@ -361,11 +361,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); OF_HASH_ADD_HASH(hash, _name.hash); Index: src/OFHTTPRequest.m ================================================================== --- src/OFHTTPRequest.m +++ src/OFHTTPRequest.m @@ -183,11 +183,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFList.m ================================================================== --- src/OFList.m +++ src/OFList.m @@ -320,11 +320,11 @@ copy->_lastListObject = listObject; return copy; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFMapTable.h ================================================================== --- src/OFMapTable.h +++ src/OFMapTable.h @@ -31,11 +31,11 @@ /** The function to retain keys / objects */ void *_Nullable (*_Nullable retain)(void *_Nullable object); /** The function to release keys / objects */ void (*_Nullable release)(void *_Nullable object); /** The function to hash keys */ - uint32_t (*_Nullable hash)(void *_Nullable object); + unsigned long (*_Nullable hash)(void *_Nullable object); /** The function to compare keys / objects */ bool (*_Nullable equal)(void *_Nullable object1, void *_Nullable object2); }; typedef struct of_map_table_functions_t of_map_table_functions_t; @@ -74,11 +74,11 @@ OF_SUBCLASSING_RESTRICTED @interface OFMapTable: OFObject { of_map_table_functions_t _keyFunctions, _objectFunctions; struct of_map_table_bucket *_Nonnull *_Nullable _buckets; - uint32_t _count, _capacity; + unsigned long _count, _capacity; uint8_t _rotate; unsigned long _mutations; } /** @@ -240,14 +240,12 @@ */ @interface OFMapTableEnumerator: OFObject { OFMapTable *_mapTable; struct of_map_table_bucket *_Nonnull *_Nullable _buckets; - uint32_t _capacity; - unsigned long _mutations; - unsigned long *_Nullable _mutationsPtr; - uint32_t _position; + unsigned long _capacity, _mutations, *_Nullable _mutationsPtr; + unsigned long _position; } - (instancetype)init OF_UNAVAILABLE; /** Index: src/OFMapTable.m ================================================================== --- src/OFMapTable.m +++ src/OFMapTable.m @@ -32,11 +32,11 @@ #define MIN_CAPACITY 16 struct of_map_table_bucket { void *key, *object; - uint32_t hash; + unsigned long hash; }; static struct of_map_table_bucket deleted = { 0 }; static void * defaultRetain(void *object) @@ -47,14 +47,14 @@ static void defaultRelease(void *object) { } -static uint32_t +static unsigned long defaultHash(void *object) { - return (uint32_t)(uintptr_t)object; + return (unsigned long)(uintptr_t)object; } static bool defaultEqual(void *object1, void *object2) { @@ -63,18 +63,18 @@ OF_DIRECT_MEMBERS @interface OFMapTable () - (void)of_setObject: (void *)object forKey: (void *)key - hash: (uint32_t)hash; + hash: (unsigned long)hash; @end OF_DIRECT_MEMBERS @interface OFMapTableEnumerator () - (instancetype)of_initWithMapTable: (OFMapTable *)mapTable buckets: (struct of_map_table_bucket **)buckets - capacity: (uint32_t)capacity + capacity: (unsigned long)capacity mutationsPointer: (unsigned long *)mutationsPtr OF_METHOD_FAMILY(init); @end @interface OFMapTableKeyEnumerator: OFMapTableEnumerator @@ -143,23 +143,23 @@ SET_DEFAULT(_objectFunctions.hash, defaultHash); SET_DEFAULT(_objectFunctions.equal, defaultEqual); #undef SET_DEFAULT - if (capacity > UINT32_MAX / sizeof(*_buckets) || - capacity > UINT32_MAX / 8) + if (capacity > ULONG_MAX / sizeof(*_buckets) || + capacity > ULONG_MAX / 8) @throw [OFOutOfRangeException exception]; for (_capacity = 1; _capacity < capacity;) { - if (_capacity > UINT32_MAX / 2) + if (_capacity > ULONG_MAX / 2) @throw [OFOutOfRangeException exception]; _capacity *= 2; } if (capacity * 8 / _capacity >= 6) - if (_capacity <= UINT32_MAX / 2) + if (_capacity <= ULONG_MAX / 2) _capacity *= 2; if (_capacity < MIN_CAPACITY) _capacity = MIN_CAPACITY; @@ -176,11 +176,11 @@ return self; } - (void)dealloc { - for (uint32_t i = 0; i < _capacity; i++) { + for (unsigned long i = 0; i < _capacity; i++) { if (_buckets[i] != NULL && _buckets[i] != &deleted) { _keyFunctions.release(_buckets[i]->key); _objectFunctions.release(_buckets[i]->object); } } @@ -203,11 +203,11 @@ if (mapTable->_count != _count || mapTable->_keyFunctions.equal != _keyFunctions.equal || mapTable->_objectFunctions.equal != _objectFunctions.equal) return false; - for (uint32_t i = 0; i < _capacity; i++) { + for (unsigned long i = 0; i < _capacity; i++) { if (_buckets[i] != NULL && _buckets[i] != &deleted) { void *objectIter = [mapTable objectForKey: _buckets[i]->key]; if (!_objectFunctions.equal(objectIter, @@ -217,18 +217,18 @@ } return true; } -- (uint32_t)hash +- (unsigned long)hash { - uint32_t hash = 0; + unsigned long hash = 0; - for (uint32_t i = 0; i < _capacity; i++) { + for (unsigned long i = 0; i < _capacity; i++) { if (_buckets[i] != NULL && _buckets[i] != &deleted) { - hash += OF_ROR(_buckets[i]->hash, _rotate); - hash += _objectFunctions.hash(_buckets[i]->object); + hash ^= OF_ROR(_buckets[i]->hash, _rotate); + hash ^= _objectFunctions.hash(_buckets[i]->object); } } return hash; } @@ -239,11 +239,11 @@ initWithKeyFunctions: _keyFunctions objectFunctions: _objectFunctions capacity: _capacity]; @try { - for (uint32_t i = 0; i < _capacity; i++) + for (unsigned long i = 0; i < _capacity; i++) if (_buckets[i] != NULL && _buckets[i] != &deleted) [copy of_setObject: _buckets[i]->object forKey: _buckets[i]->key hash: OF_ROR(_buckets[i]->hash, _rotate)]; @@ -260,11 +260,11 @@ return _count; } - (void *)objectForKey: (void *)key { - uint32_t i, hash, last; + unsigned long i, hash, last; if (key == NULL) @throw [OFInvalidArgumentException exception]; hash = OF_ROL(_keyFunctions.hash(key), _rotate); @@ -293,22 +293,22 @@ } return NULL; } -- (void)of_resizeForCount: (uint32_t)count OF_DIRECT +- (void)of_resizeForCount: (unsigned long)count OF_DIRECT { - uint32_t fullness, capacity; + unsigned long fullness, capacity; struct of_map_table_bucket **buckets; - if (count > UINT32_MAX / sizeof(*_buckets) || count > UINT32_MAX / 8) + if (count > ULONG_MAX / sizeof(*_buckets) || count > ULONG_MAX / 8) @throw [OFOutOfRangeException exception]; fullness = count * 8 / _capacity; if (fullness >= 6) { - if (_capacity > UINT32_MAX / 2) + if (_capacity > ULONG_MAX / 2) return; capacity = _capacity * 2; } else if (fullness <= 1) capacity = _capacity / 2; @@ -323,13 +323,13 @@ return; buckets = [self allocZeroedMemoryWithSize: sizeof(*buckets) count: capacity]; - for (uint32_t i = 0; i < _capacity; i++) { + for (unsigned long i = 0; i < _capacity; i++) { if (_buckets[i] != NULL && _buckets[i] != &deleted) { - uint32_t j, last; + unsigned long j, last; last = capacity; for (j = _buckets[i]->hash & (capacity - 1); j < last && buckets[j] != NULL; j++); @@ -354,13 +354,13 @@ _capacity = capacity; } - (void)of_setObject: (void *)object forKey: (void *)key - hash: (uint32_t)hash + hash: (unsigned long)hash { - uint32_t i, last; + unsigned long i, last; void *old; if (key == NULL || object == NULL) @throw [OFInvalidArgumentException exception]; @@ -450,11 +450,11 @@ hash: _keyFunctions.hash(key)]; } - (void)removeObjectForKey: (void *)key { - uint32_t i, hash, last; + unsigned long i, hash, last; if (key == NULL) @throw [OFInvalidArgumentException exception]; hash = OF_ROL(_keyFunctions.hash(key), _rotate); @@ -506,11 +506,11 @@ } } - (void)removeAllObjects { - for (uint32_t i = 0; i < _capacity; i++) { + for (unsigned long i = 0; i < _capacity; i++) { if (_buckets[i] != NULL) { if (_buckets[i] == &deleted) { _buckets[i] = NULL; continue; } @@ -540,11 +540,11 @@ - (bool)containsObject: (void *)object { if (object == NULL || _count == 0) return false; - for (uint32_t i = 0; i < _capacity; i++) + for (unsigned long i = 0; i < _capacity; i++) if (_buckets[i] != NULL && _buckets[i] != &deleted) if (_objectFunctions.equal(_buckets[i]->object, object)) return true; return false; @@ -553,11 +553,11 @@ - (bool)containsObjectIdenticalTo: (void *)object { if (object == NULL || _count == 0) return false; - for (uint32_t i = 0; i < _capacity; i++) + for (unsigned long i = 0; i < _capacity; i++) if (_buckets[i] != NULL && _buckets[i] != &deleted) if (_buckets[i]->object == object) return true; return false; @@ -583,11 +583,11 @@ - (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state objects: (id *)objects count: (int)count { - uint32_t j = (uint32_t)state->state; + unsigned long j = state->state; int i; for (i = 0; i < count; i++) { for (; j < _capacity && (_buckets[j] == NULL || _buckets[j] == &deleted); j++); @@ -656,11 +656,11 @@ OF_INVALID_INIT_METHOD } - (instancetype)of_initWithMapTable: (OFMapTable *)mapTable buckets: (struct of_map_table_bucket **)buckets - capacity: (uint32_t)capacity + capacity: (unsigned long)capacity mutationsPointer: (unsigned long *)mutationsPtr { self = [super init]; _mapTable = [mapTable retain]; Index: src/OFMapTableDictionary.m ================================================================== --- src/OFMapTableDictionary.m +++ src/OFMapTableDictionary.m @@ -47,11 +47,11 @@ release(void *object) { [(id)object release]; } -static uint32_t +static unsigned long hash(void *object) { return [(id)object hash]; } @@ -444,10 +444,10 @@ exceptionWithObject: self]; } } #endif -- (uint32_t)hash +- (unsigned long)hash { return _mapTable.hash; } @end Index: src/OFMapTableSet.m ================================================================== --- src/OFMapTableSet.m +++ src/OFMapTableSet.m @@ -39,11 +39,11 @@ release(void *object) { [(id)object release]; } -static uint32_t +static unsigned long hash(void *object) { return [(id)object hash]; } Index: src/OFMessagePackExtension.m ================================================================== --- src/OFMessagePackExtension.m +++ src/OFMessagePackExtension.m @@ -175,11 +175,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -985,11 +985,11 @@ return OF_ORDERED_SAME; } } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -320,11 +320,11 @@ * to behave in a way compatible to your reimplementation of this * method! * * @return A 32 bit hash for the object */ -- (uint32_t)hash; +- (unsigned long)hash; /** * @brief Returns the retain count. * * @return The retain count @@ -543,11 +543,11 @@ @property (readonly, nonatomic) Class class; # else @property (readonly, nonatomic, getter=class) Class class_; #endif @property OF_NULLABLE_PROPERTY (readonly, nonatomic) Class superclass; -@property (readonly, nonatomic) uint32_t hash; +@property (readonly, nonatomic) unsigned long hash; @property (readonly, nonatomic) unsigned int retainCount; @property (readonly, nonatomic) bool isProxy; @property (readonly, nonatomic) bool allowsWeakReference; /** Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -1023,11 +1023,11 @@ - (bool)isEqual: (id)object { return (object == self); } -- (uint32_t)hash +- (unsigned long)hash { uintptr_t ptr = (uintptr_t)self; uint32_t hash; OF_HASH_INIT(hash); Index: src/OFOptionsParser.m ================================================================== --- src/OFOptionsParser.m +++ src/OFOptionsParser.m @@ -22,11 +22,11 @@ #import "OFArray.h" #import "OFMapTable.h" #import "OFInvalidArgumentException.h" -static uint32_t +static unsigned long stringHash(void *object) { return ((OFString *)object).hash; } Index: src/OFPair.m ================================================================== --- src/OFPair.m +++ src/OFPair.m @@ -83,11 +83,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFSandbox.m ================================================================== --- src/OFSandbox.m +++ src/OFSandbox.m @@ -467,11 +467,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFSet.m ================================================================== --- src/OFSet.m +++ src/OFSet.m @@ -296,17 +296,17 @@ return false; return [set isSubsetOfSet: self]; } -- (uint32_t)hash +- (unsigned long)hash { void *pool = objc_autoreleasePoolPush(); - uint32_t hash = 0; + unsigned long hash = 0; for (id object in self) - hash += [object hash]; + hash ^= [object hash]; objc_autoreleasePoolPop(pool); return hash; } Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -1660,11 +1660,11 @@ return OF_ORDERED_ASCENDING; return OF_ORDERED_SAME; } -- (uint32_t)hash +- (unsigned long)hash { const of_unichar_t *characters = self.characters; size_t length = self.length; uint32_t hash; Index: src/OFTriple.m ================================================================== --- src/OFTriple.m +++ src/OFTriple.m @@ -97,11 +97,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFURL.m ================================================================== --- src/OFURL.m +++ src/OFURL.m @@ -848,11 +848,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFUTF8String.h ================================================================== --- src/OFUTF8String.h +++ src/OFUTF8String.h @@ -27,17 +27,17 @@ * Since constant strings don't have `_storage`, they have to allocate * it on the first access. Strings created at runtime just set the * pointer to `&_storage`. */ struct of_string_utf8_ivars { - char *cString; - size_t cStringLength; - bool isUTF8; - size_t length; - bool hashed; - uint32_t hash; - char *_Nullable freeWhenDone; + char *cString; + size_t cStringLength; + bool isUTF8; + size_t length; + bool hashed; + unsigned long hash; + char *_Nullable freeWhenDone; } *restrict _s; struct of_string_utf8_ivars _storage; } @end Index: src/OFUTF8String.m ================================================================== --- src/OFUTF8String.m +++ src/OFUTF8String.m @@ -927,11 +927,11 @@ #endif return OF_ORDERED_SAME; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; if (_s->hashed) return _s->hash; Index: src/OFValue.m ================================================================== --- src/OFValue.m +++ src/OFValue.m @@ -206,11 +206,11 @@ } return ret; } -- (uint32_t)hash +- (unsigned long)hash { size_t size = of_sizeof_type_encoding(self.objCType); unsigned char *value; uint32_t hash; Index: src/OFXMLAttribute.m ================================================================== --- src/OFXMLAttribute.m +++ src/OFXMLAttribute.m @@ -138,11 +138,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFXMLCDATA.m ================================================================== --- src/OFXMLCDATA.m +++ src/OFXMLCDATA.m @@ -86,11 +86,11 @@ CDATA = object; return ([CDATA->_CDATA isEqual: _CDATA]); } -- (uint32_t)hash +- (unsigned long)hash { return _CDATA.hash; } - (OFString *)stringValue Index: src/OFXMLCharacters.m ================================================================== --- src/OFXMLCharacters.m +++ src/OFXMLCharacters.m @@ -86,11 +86,11 @@ characters = object; return ([characters->_characters isEqual: _characters]); } -- (uint32_t)hash +- (unsigned long)hash { return _characters.hash; } - (OFString *)stringValue Index: src/OFXMLComment.m ================================================================== --- src/OFXMLComment.m +++ src/OFXMLComment.m @@ -88,11 +88,11 @@ comment = object; return ([comment->_comment isEqual: _comment]); } -- (uint32_t)hash +- (unsigned long)hash { return _comment.hash; } - (OFString *)stringValue Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -1064,11 +1064,11 @@ return false; return true; } -- (uint32_t)hash +- (unsigned long)hash { uint32_t hash; OF_HASH_INIT(hash); Index: src/OFXMLProcessingInstructions.m ================================================================== --- src/OFXMLProcessingInstructions.m +++ src/OFXMLProcessingInstructions.m @@ -89,11 +89,11 @@ return [processingInstructions->_processingInstructions isEqual: _processingInstructions]; } -- (uint32_t)hash +- (unsigned long)hash { return _processingInstructions.hash; } - (OFString *)stringValue Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -812,11 +812,11 @@ hash ^= (hash >> 11); \ hash += (hash << 15); \ } #define OF_HASH_ADD_HASH(hash, other) \ { \ - uint32_t otherCopy = other; \ + uint32_t otherCopy = (uint32_t)other; \ OF_HASH_ADD(hash, (otherCopy >> 24) & 0xFF); \ OF_HASH_ADD(hash, (otherCopy >> 16) & 0xFF); \ OF_HASH_ADD(hash, (otherCopy >> 8) & 0xFF); \ OF_HASH_ADD(hash, otherCopy & 0xFF); \ } Index: src/runtime/arc.m ================================================================== --- src/runtime/arc.m +++ src/runtime/arc.m @@ -32,11 +32,11 @@ static struct objc_hashtable *hashtable; #ifdef OF_HAVE_THREADS static of_spinlock_t spinlock; #endif -static uint32_t +static unsigned long hash(const void *object) { return (uint32_t)(uintptr_t)object; } Index: src/socket.h ================================================================== --- src/socket.h +++ src/socket.h @@ -217,11 +217,11 @@ * @brief Returns the hash for the specified of_socket_address_t. * * @param address The address to hash * @return The hash for the specified of_socket_address_t */ -extern uint32_t of_socket_address_hash( +extern unsigned long of_socket_address_hash( const of_socket_address_t *_Nonnull address); /** * @brief Converts the specified of_socket_address_t to an IP string and port. * Index: src/socket.m ================================================================== --- src/socket.m +++ src/socket.m @@ -606,11 +606,11 @@ } return true; } -uint32_t +unsigned long of_socket_address_hash(const of_socket_address_t *address) { uint32_t hash; OF_HASH_INIT(hash);