1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +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:
Andreas Kling 2020-03-08 10:36:51 +01:00
parent b98d8ad5b0
commit b1058b33fb
36 changed files with 164 additions and 161 deletions

View file

@ -46,10 +46,10 @@ Syscall::Function syscall_table[] = {
ENUMERATE_SYSCALLS
};
uintptr_t arg[SC_NARG];
FlatPtr arg[SC_NARG];
char buf[BUFSIZ];
uintptr_t parse(char* s);
FlatPtr parse(char* s);
int main(int argc, char** argv)
{
@ -104,13 +104,13 @@ int main(int argc, char** argv)
return -1;
}
uintptr_t parse(char* s)
FlatPtr parse(char* s)
{
char* t;
uintptr_t l;
FlatPtr l;
if (strcmp(s, "buf") == 0) {
return (uintptr_t)buf;
return (FlatPtr)buf;
}
l = strtoul(s, &t, 0);
@ -118,5 +118,5 @@ uintptr_t parse(char* s)
return l;
}
return (uintptr_t)s;
return (FlatPtr)s;
}