mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +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:
parent
e07b34b9b8
commit
a246e9cd7e
14 changed files with 110 additions and 110 deletions
|
@ -101,11 +101,11 @@ void PhysicalRegion::return_page_at(PhysicalAddress addr)
|
|||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
int local_offset = addr.get() - m_lower.get();
|
||||
ptrdiff_t local_offset = addr.get() - m_lower.get();
|
||||
ASSERT(local_offset >= 0);
|
||||
ASSERT((u32)local_offset < (u32)(m_pages * PAGE_SIZE));
|
||||
ASSERT((uintptr_t)local_offset < (uintptr_t)(m_pages * PAGE_SIZE));
|
||||
|
||||
auto page = (unsigned)local_offset / PAGE_SIZE;
|
||||
auto page = (uintptr_t)local_offset / PAGE_SIZE;
|
||||
if (page < m_last)
|
||||
m_last = page;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue