diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-03 21:17:35 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-03 21:20:13 +0200 |
commit | 27f699ef0c8c2dce0f1dff19eef25f02e3da397e (patch) | |
tree | 52f95be1d05ba2a621d3bb8ac9129341f8d9973b /Kernel/StdLib.cpp | |
parent | c4c4bbc5ba5119e9ccc8ded948b26e7c4851a909 (diff) | |
download | serenity-27f699ef0c8c2dce0f1dff19eef25f02e3da397e.zip |
AK: Rename the common integer typedefs to make it obvious what they are.
These types can be picked up by including <AK/Types.h>:
* u8, u16, u32, u64 (unsigned)
* i8, i16, i32, i64 (signed)
Diffstat (limited to 'Kernel/StdLib.cpp')
-rw-r--r-- | Kernel/StdLib.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Kernel/StdLib.cpp b/Kernel/StdLib.cpp index e146d643ee..8f31691b6a 100644 --- a/Kernel/StdLib.cpp +++ b/Kernel/StdLib.cpp @@ -31,8 +31,8 @@ void* memmove(void* dest, const void* src, size_t n) if (dest < src) return memcpy(dest, src, n); - byte* pd = (byte*)dest; - const byte* ps = (const byte*)src; + u8* pd = (u8*)dest; + const u8* ps = (const u8*)src; for (pd += n, ps += n; n--;) *--pd = *--ps; return dest; @@ -63,7 +63,7 @@ void* memset(void* dest_ptr, int c, size_t n) // FIXME: Support starting at an unaligned address. if (!(dest & 0x3) && n >= 12) { size_t size_ts = n / sizeof(size_t); - size_t expanded_c = (byte)c; + size_t expanded_c = (u8)c; expanded_c |= expanded_c << 8; expanded_c |= expanded_c << 16; asm volatile( @@ -108,7 +108,7 @@ int strcmp(const char* s1, const char* s2) if (*s1 == 0) return 0; } - return *(const byte*)s1 < *(const byte*)s2 ? -1 : 1; + return *(const u8*)s1 < *(const u8*)s2 ? -1 : 1; } char* strdup(const char* str) @@ -121,8 +121,8 @@ char* strdup(const char* str) int memcmp(const void* v1, const void* v2, size_t n) { - auto* s1 = (const byte*)v1; - auto* s2 = (const byte*)v2; + auto* s1 = (const u8*)v1; + auto* s2 = (const u8*)v2; while (n-- > 0) { if (*s1++ != *s2++) return s1[-1] < s2[-1] ? -1 : 1; |