aboutsummaryrefslogtreecommitdiff
path: root/libc/inc
diff options
context:
space:
mode:
authorMarvin Borner2021-02-25 20:45:10 +0100
committerMarvin Borner2021-02-25 20:45:10 +0100
commita9710cb73cc9ecadaff241428a39a26935cb5c0a (patch)
tree68f509407bc49a4da43ccadfd9115b9e6f7eb413 /libc/inc
parent26587adae4f5ec61d03fd7075805a24b29107fe3 (diff)
Applied even more warning flags!
Fixing all the warnings wasn't that easy actually..
Diffstat (limited to 'libc/inc')
-rw-r--r--libc/inc/def.h2
-rw-r--r--libc/inc/list.h2
-rw-r--r--libc/inc/mem.h2
-rw-r--r--libc/inc/random.h2
-rw-r--r--libc/inc/serial.h2
-rw-r--r--libc/inc/stack.h2
-rw-r--r--libc/inc/str.h4
-rw-r--r--libc/inc/sys.h8
8 files changed, 12 insertions, 12 deletions
diff --git a/libc/inc/def.h b/libc/inc/def.h
index 02a2990..8ff6d81 100644
--- a/libc/inc/def.h
+++ b/libc/inc/def.h
@@ -23,6 +23,8 @@ typedef unsigned long long u64;
* Macros
*/
+#define UNUSED(a) ((void)(a))
+
#define EOF (-1)
#define NULL ((void *)0)
diff --git a/libc/inc/list.h b/libc/inc/list.h
index 50b21c2..0b82b48 100644
--- a/libc/inc/list.h
+++ b/libc/inc/list.h
@@ -16,7 +16,7 @@ struct node {
struct node *prev;
};
-struct list *list_new();
+struct list *list_new(void);
void list_destroy(struct list *list);
/* struct node *list_new_node(); */ // TODO: Make node-specific things static/private?
/* void list_add_node(struct list *list, struct node *node); */
diff --git a/libc/inc/mem.h b/libc/inc/mem.h
index e4416dd..6c37844 100644
--- a/libc/inc/mem.h
+++ b/libc/inc/mem.h
@@ -5,8 +5,6 @@
#include <def.h>
-int malloc_allocated;
-
void *malloc_debug(u32 size, const char *file, int line, const char *func, const char *inp);
void free_debug(void *ptr, const char *file, int line, const char *func, const char *inp);
#define malloc(size) malloc_debug((u32)(size), __FILE__, __LINE__, __func__, #size)
diff --git a/libc/inc/random.h b/libc/inc/random.h
index 50c849b..59add9b 100644
--- a/libc/inc/random.h
+++ b/libc/inc/random.h
@@ -6,7 +6,7 @@
#include <def.h>
void srand(u32 seed);
-u32 rand();
+u32 rand(void);
char *randstr(u32 size);
#endif
diff --git a/libc/inc/serial.h b/libc/inc/serial.h
index 6511952..4d04d6a 100644
--- a/libc/inc/serial.h
+++ b/libc/inc/serial.h
@@ -3,7 +3,7 @@
#ifndef SERIAL_H
#define SERIAL_H
-void serial_install();
+void serial_install(void);
void serial_print(const char *data);
#endif
diff --git a/libc/inc/stack.h b/libc/inc/stack.h
index 16725f8..f5ad52b 100644
--- a/libc/inc/stack.h
+++ b/libc/inc/stack.h
@@ -16,7 +16,7 @@ struct stack {
struct stack_node *tail;
};
-struct stack *stack_new();
+struct stack *stack_new(void);
void stack_destroy(struct stack *stack);
u32 stack_empty(struct stack *stack);
u32 stack_push_bot(struct stack *stack, void *data);
diff --git a/libc/inc/str.h b/libc/inc/str.h
index 662cbe7..0ef49a6 100644
--- a/libc/inc/str.h
+++ b/libc/inc/str.h
@@ -8,8 +8,8 @@
u32 strlen(const char *s);
char *strcpy(char *dst, const char *src);
char *strncpy(char *dst, const char *src, u32 n);
-char *strchr(const char *s, int c);
-char *strrchr(const char *s, int c);
+char *strchr(char *s, int c);
+char *strrchr(char *s, int c);
char *strcat(char *dst, const char *src);
char *strncat(char *dst, const char *src, u32 n);
int strcmp(const char *s1, const char *s2);
diff --git a/libc/inc/sys.h b/libc/inc/sys.h
index be4352f..5858579 100644
--- a/libc/inc/sys.h
+++ b/libc/inc/sys.h
@@ -65,7 +65,7 @@ int sysv(enum sys num, ...);
* Syscall wrappers
*/
-#define loop() sys0(SYS_LOOP)
+#define loop(void) sys0(SYS_LOOP)
#define read(path, buf, offset, count) \
(s32) sys4(SYS_READ, (int)(path), (int)(buf), (int)(offset), (int)(count))
#define write(path, buf, offset, count) \
@@ -80,10 +80,10 @@ int sysv(enum sys num, ...);
yield(); \
} \
}
-#define yield() (int)sys0(SYS_YIELD)
-#define time() (u32) sys0(SYS_TIME)
+#define yield(void) (int)sys0(SYS_YIELD)
+#define time(void) (u32) sys0(SYS_TIME)
-static inline u32 getpid()
+static inline u32 getpid(void)
{
u32 buf = 0;
read("/proc/self/pid", &buf, 0, sizeof(buf));