mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:04:57 +00:00
AK: Add global FlatPtr typedef. It's u32 or u64, based on sizeof(void*)
Use this instead of uintptr_t throughout the codebase. This makes it possible to pass a FlatPtr to something that has u32 and u64 overloads.
This commit is contained in:
parent
b98d8ad5b0
commit
b1058b33fb
36 changed files with 164 additions and 161 deletions
|
@ -51,7 +51,7 @@ inline unsigned u64_hash(u64 key)
|
|||
return pair_int_hash(first, last);
|
||||
}
|
||||
|
||||
inline unsigned ptr_hash(uintptr_t ptr)
|
||||
inline unsigned ptr_hash(FlatPtr ptr)
|
||||
{
|
||||
if constexpr(sizeof(ptr) == 8)
|
||||
return u64_hash((u64)ptr);
|
||||
|
@ -61,5 +61,5 @@ inline unsigned ptr_hash(uintptr_t ptr)
|
|||
|
||||
inline unsigned ptr_hash(const void* ptr)
|
||||
{
|
||||
return ptr_hash((uintptr_t)(ptr));
|
||||
return ptr_hash((FlatPtr)(ptr));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue