summaryrefslogtreecommitdiff
path: root/kernel/libc
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
parent0cb4afef6da5488a128e5aaece435e9aa5f5797e (diff)
Kernel Style: Change uint*_t -> u*
Diffstat (limited to 'kernel/libc')
-rw-r--r--kernel/libc/include/string.h10
-rw-r--r--kernel/libc/stdio/print.c4
-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
6 files changed, 16 insertions, 16 deletions
diff --git a/kernel/libc/include/string.h b/kernel/libc/include/string.h
index 7cee4b2..707d391 100644
--- a/kernel/libc/include/string.h
+++ b/kernel/libc/include/string.h
@@ -1,16 +1,16 @@
#ifndef STRING_H
#define STRING_H
#include <stddef.h>
-#include <stdint.h>
+#include <typedefs.h>
unsigned long strlen(const char *s);
-void *memcpy(void *dest, const void *src, uint32_t n);
-void *memset(void *dst, const unsigned char c, uint32_t n);
-int memcmp(const void *s1, const void *s2, uint32_t n);
+void *memcpy(void *dest, const void *src, u32 n);
+void *memset(void *dst, const unsigned char c, u32 n);
+int memcmp(const void *s1, const void *s2, u32 n);
char *strcpy(char *d, const char *s);
int strcmp(const char *s1, const char *s2);
int isequal(const char *s1, const char *s2);
-int isequal_n(const char *s1, const char *s2, uint32_t n);
+int isequal_n(const char *s1, const char *s2, u32 n);
char *copy_and_allocate_string(const char *s);
char *copy_and_allocate_user_string(const char *s);
char *strncpy(char *dest, const char *src, size_t n);
diff --git a/kernel/libc/stdio/print.c b/kernel/libc/stdio/print.c
index 8174983..f1a4918 100644
--- a/kernel/libc/stdio/print.c
+++ b/kernel/libc/stdio/print.c
@@ -10,7 +10,7 @@ const char HEX_SET[0x10] = {'0', '1', '2', '3', '4', '5', '6', '7',
inline void putc(const char c) { write_serial(c); }
-int kprint_hex(uint64_t num) {
+int kprint_hex(u64 num) {
int c = 2;
if (num == 0) {
@@ -79,7 +79,7 @@ int kprintf(const char *format, ...) {
;
break;
case 'x':
- c += kprint_hex(va_arg(list, const uint32_t));
+ c += kprint_hex(va_arg(list, const u32));
break;
case '%':
putc('%');
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;