From 459e1ed6533df4674c7c6b611799e6f169725a7c Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 20 Nov 2022 18:29:23 +0100 Subject: [PATCH] luna/String.h: Convert to Types.h --- luna/String.cpp | 14 +++++++------- luna/String.h | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/luna/String.cpp b/luna/String.cpp index 2b2113b4..abada229 100644 --- a/luna/String.cpp +++ b/luna/String.cpp @@ -2,19 +2,19 @@ extern "C" { - void* memcpy(void* dest, const void* src, size_t n) + void* memcpy(void* dest, const void* src, usize n) { - for (size_t i = 0; i < n; ++i) { *((u8*)dest + i) = *((const u8*)src + i); } + for (usize i = 0; i < n; ++i) { *((u8*)dest + i) = *((const u8*)src + i); } return dest; } - void* memset(void* buf, int c, size_t n) + void* memset(void* buf, int c, usize n) { - for (size_t i = 0; i < n; ++i) { *((u8*)buf + i) = (u8)c; } + for (usize i = 0; i < n; ++i) { *((u8*)buf + i) = (u8)c; } return buf; } - int memcmp(const void* a, const void* b, size_t n) + int memcmp(const void* a, const void* b, usize n) { if (!n) return 0; const u8* ap = (const u8*)a; @@ -27,7 +27,7 @@ extern "C" return *ap - *bp; } - void* memmove(void* dest, const void* src, size_t n) + void* memmove(void* dest, const void* src, usize n) { if (dest == src) return dest; if (dest > src) @@ -37,7 +37,7 @@ extern "C" return dest; } - size_t strlen(const char* str) + usize strlen(const char* str) { const char* i = str; for (; *i; ++i) diff --git a/luna/String.h b/luna/String.h index b11961f6..1e2b9a81 100644 --- a/luna/String.h +++ b/luna/String.h @@ -3,9 +3,9 @@ extern "C" { - void* memcpy(void* dest, const void* src, size_t n); - void* memset(void* buf, int c, size_t n); - int memcmp(const void* a, const void* b, size_t n); - void* memmove(void* dest, const void* src, size_t n); - size_t strlen(const char* str); + void* memcpy(void* dest, const void* src, usize n); + void* memset(void* buf, int c, usize n); + int memcmp(const void* a, const void* b, usize n); + void* memmove(void* dest, const void* src, usize n); + usize strlen(const char* str); } \ No newline at end of file