From 568a0b7017e8e779731325083015907b006866c3 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Thu, 18 Apr 2024 16:47:36 +0200 Subject: LibC: Fix compiler warnings It can now compile with almost all compiler warnings turned on without producing any warnings. --- userland/libc/malloc/malloc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'userland/libc/malloc') diff --git a/userland/libc/malloc/malloc.c b/userland/libc/malloc/malloc.c index bd880b8..19fc91e 100644 --- a/userland/libc/malloc/malloc.c +++ b/userland/libc/malloc/malloc.c @@ -2,8 +2,12 @@ #include #include #include +#include #include +#include +#include #include +#include #define NEW_ALLOC_SIZE 0x5000 #define IS_FREE (1 << 0) @@ -27,7 +31,7 @@ u32 total_heap_size = 0; // printf without using malloc() so that it can be used internally by // malloc() such that it does not have a stack overflow. int debug_vprintf(const char *fmt, va_list ap) { - const char buffer[4096]; + char buffer[4096]; int rc = vsnprintf(buffer, 4096, fmt, ap); if (0 > rc) { return -1; @@ -188,7 +192,7 @@ void *int_malloc(size_t s, int recursion) { free_entry->flags = 0; free_entry->n = new_entry; free_entry->magic = 0xdde51ab9410268b1; - randomfill(rc, s); + randomfill(rc, s); return rc; } -- cgit v1.2.3