Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -209,15 +209,15 @@ (val) >> (sizeof(val) * 8 - ((bits) % (sizeof(val) * 8)))) #define OF_HASH_INIT(hash) hash = 0 #define OF_HASH_ADD(hash, byte) \ { \ - hash += byte; \ + hash += (uint8_t)byte; \ hash += (hash << 10); \ hash ^= (hash >> 6); \ } #define OF_HASH_FINALIZE(hash) \ { \ hash += (hash << 3); \ hash ^= (hash >> 11); \ hash += (hash << 15); \ } Index: tests/OFDataArrayTests.m ================================================================== --- tests/OFDataArrayTests.m +++ tests/OFDataArrayTests.m @@ -70,11 +70,11 @@ R([array[1] removeNItems: 1]) && [array[0] compare: array[1]] == OF_ORDERED_DESCENDING && [array[1] compare: array[0]] == OF_ORDERED_ASCENDING && [array[2] compare: array[3]] == OF_ORDERED_ASCENDING) - TEST(@"-[hash]", [array[0] hash] == 0xC54621B6) + TEST(@"-[hash]", [array[0] hash] == 0x634A529F) array[0] = [class dataArrayWithItemSize: 1]; [array[0] addNItems: 6 fromCArray: "abcdef"]; Index: tests/OFStringTests.m ================================================================== --- tests/OFStringTests.m +++ tests/OFStringTests.m @@ -85,11 +85,11 @@ R([s[1] appendCString: "1๐„ž"]) && R([s[1] appendString: @"3"]) && R([s[0] appendString: s[1]]) && [s[0] isEqual: @"tรคsโ‚ฌ1๐„ž3"]) TEST(@"-[length]", [s[0] length] == 7) TEST(@"-[cStringLength]", [s[0] cStringLength] == 13) - TEST(@"-[hash]", [s[0] hash] == 0x8AC1EEF6) + TEST(@"-[hash]", [s[0] hash] == 0xD576830E) TEST(@"-[characterAtIndex:]", [s[0] characterAtIndex: 0] == 't' && [s[0] characterAtIndex: 1] == 0xE4 && [s[0] characterAtIndex: 3] == 0x20AC && [s[0] characterAtIndex: 5] == 0x1D11E)