summaryrefslogtreecommitdiff
path: root/kernel/libc/string
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-11-10 15:47:08 +0100
committerAnton Kling <anton@kling.gg>2023-11-10 15:47:08 +0100
commit9a1f977e39d8e9fcb6a9cb2a612f4743e802221d (patch)
tree1fc53f6e80eb40d24274f2f8967d584b88c6d664 /kernel/libc/string
parent0cb4afef6da5488a128e5aaece435e9aa5f5797e (diff)
Kernel Style: Change uint*_t -> u*
Diffstat (limited to 'kernel/libc/string')
-rw-r--r--kernel/libc/string/isequal.c2
-rw-r--r--kernel/libc/string/memcmp.c4
-rw-r--r--kernel/libc/string/memcpy.c8
-rw-r--r--kernel/libc/string/memset.c4
4 files changed, 9 insertions, 9 deletions
diff --git a/kernel/libc/string/isequal.c b/kernel/libc/string/isequal.c
index cdbd3cc..75f7366 100644
--- a/kernel/libc/string/isequal.c
+++ b/kernel/libc/string/isequal.c
@@ -7,7 +7,7 @@ int isequal(const char *s1, const char *s2) {
return 1;
}
-int isequal_n(const char *s1, const char *s2, uint32_t n) {
+int isequal_n(const char *s1, const char *s2, u32 n) {
for(;*s1 && n;s1++,s2++,n--)
if(*s1 != *s2)
return 0;
diff --git a/kernel/libc/string/memcmp.c b/kernel/libc/string/memcmp.c
index 72c680a..db13ed2 100644
--- a/kernel/libc/string/memcmp.c
+++ b/kernel/libc/string/memcmp.c
@@ -1,10 +1,10 @@
#include "../include/string.h"
-int memcmp(const void *s1, const void *s2, uint32_t n)
+int memcmp(const void *s1, const void *s2, u32 n)
{
int return_value = 0;
- for(uint32_t i = 0;i < n;i++)
+ for(u32 i = 0;i < n;i++)
if(((unsigned char *)(s1))[i] != ((unsigned char *)(s2))[i])
return_value++;
diff --git a/kernel/libc/string/memcpy.c b/kernel/libc/string/memcpy.c
index 5c04407..1313261 100644
--- a/kernel/libc/string/memcpy.c
+++ b/kernel/libc/string/memcpy.c
@@ -1,18 +1,18 @@
#include "../include/string.h"
void *
-memcpy(void *dest, const void *src, uint32_t n) {
+memcpy(void *dest, const void *src, u32 n) {
unsigned char *d = dest;
const unsigned char *s = src;
for (; n >= 8; n -= 8, d += 8, s += 8)
- *(uint64_t *)d = *(uint64_t *)s;
+ *(u64 *)d = *(u64 *)s;
for (; n >= 4; n -= 4, d += 4, s += 4)
- *(uint32_t *)d = *(uint32_t *)s;
+ *(u32 *)d = *(u32 *)s;
for (; n >= 2; n -= 2, d += 2, s += 2)
- *(uint16_t *)d = *(uint16_t *)s;
+ *(u16 *)d = *(u16 *)s;
for (; n; n--)
*d++ = *s++;
diff --git a/kernel/libc/string/memset.c b/kernel/libc/string/memset.c
index a446eb4..5d7de62 100644
--- a/kernel/libc/string/memset.c
+++ b/kernel/libc/string/memset.c
@@ -1,8 +1,8 @@
#include <string.h>
-void *memset(void *dst, const unsigned char c, uint32_t n) {
+void *memset(void *dst, const unsigned char c, u32 n) {
uintptr_t d = (uintptr_t)dst;
- for (uint32_t i = 0; i < n; i++, d++)
+ for (u32 i = 0; i < n; i++, d++)
*(unsigned char *)d = c;
return (void *)d;