base: use uintptr_t for hash type

Use uintptr_t for hash type; this is consistent with CoreFoundation, which uses
32-bit integers on 32-bit platforms for the hash code, and 64-bit integers on
64-bit platforms. (libheimbase is modelled on CoreFoundation.)

Previously we used unsigned long, which would have the same behavior on
LP32/LP64 systems, but not on Windows (where unsigned long is 32-bits on 64-bit
platforms).
This commit is contained in:
Luke Howard
2022-01-06 17:21:06 +11:00
parent 6b788c2378
commit 97cca6f921
8 changed files with 14 additions and 14 deletions

View File

@@ -210,13 +210,13 @@ heim_get_tid(heim_object_t ptr)
* @return a hash value
*/
unsigned long
uintptr_t
heim_get_hash(heim_object_t ptr)
{
heim_type_t isa = _heim_get_isa(ptr);
if (isa->hash)
return isa->hash(ptr);
return (unsigned long)ptr;
return (uintptr_t)ptr;
}
/**
@@ -609,10 +609,10 @@ autorel_cmp(void *a, void *b)
return (a == b);
}
static unsigned long
static uintptr_t
autorel_hash(void *ptr)
{
return (unsigned long)ptr;
return (uintptr_t)ptr;
}