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:
@@ -58,12 +58,12 @@ number_cmp(void *a, void *b)
|
||||
return na - nb;
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
static uintptr_t
|
||||
number_hash(void *ptr)
|
||||
{
|
||||
if (heim_base_is_tagged_object(ptr))
|
||||
return heim_base_tagged_object_value(ptr);
|
||||
return (unsigned long)*(int *)ptr;
|
||||
return (uintptr_t)*(int64_t *)ptr;
|
||||
}
|
||||
|
||||
struct heim_type_data _heim_number_object = {
|
||||
|
Reference in New Issue
Block a user