1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:17:35 +00:00

Use uintptr_t instead of u32 when storing pointers as integers

uintptr_t is 32-bit or 64-bit depending on the target platform.
This will help us write pointer size agnostic code so that when the day
comes that we want to do a 64-bit port, we'll be in better shape.
This commit is contained in:
Andreas Kling 2020-01-20 13:06:14 +01:00
parent e07b34b9b8
commit a246e9cd7e
14 changed files with 110 additions and 110 deletions

View file

@ -33,7 +33,7 @@
#include <Kernel/kstdio.h>
#define PAGE_SIZE 4096
#define PAGE_MASK 0xfffff000
#define PAGE_MASK ((uintptr_t)0xfffff000u)
class MemoryManager;
class PageDirectory;
@ -452,12 +452,12 @@ struct [[gnu::aligned(16)]] FPUState
u8 buffer[512];
};
inline constexpr u32 page_base_of(u32 address)
inline constexpr uintptr_t page_base_of(uintptr_t address)
{
return address & PAGE_MASK;
}
inline constexpr u32 offset_in_page(u32 address)
inline constexpr uintptr_t offset_in_page(uintptr_t address)
{
return address & (~PAGE_MASK);
}