summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/init/main.c2
-rw-r--r--src/kernel/mem.c4
-rw-r--r--src/kernel/proc.c2
-rw-r--r--src/kernel/syscalls.c8
-rw-r--r--src/kernel/vfs/path.c4
5 files changed, 10 insertions, 10 deletions
diff --git a/src/init/main.c b/src/init/main.c
index 3403a3b..fb379d2 100644
--- a/src/init/main.c
+++ b/src/init/main.c
@@ -5,7 +5,7 @@
const char *multipageify(const char *str) {
static char buf[0x2000] __attribute__((section("text")));
- char *out = ((uintptr_t)buf & ~0xFFF) + 0xFFF;
+ char *out = (void*)((uintptr_t)buf & ~0xFFF) + 0xFFF;
char *cur = out;
do {
*cur++ = *str;
diff --git a/src/kernel/mem.c b/src/kernel/mem.c
index 63f5379..7c1c640 100644
--- a/src/kernel/mem.c
+++ b/src/kernel/mem.c
@@ -87,8 +87,8 @@ bool virt_user_cpy(
struct virt_iter dest_iter, src_iter;
size_t min;
- virt_iter_new(&dest_iter, dest, length, dest_pages, true, true);
- virt_iter_new( &src_iter, src, length, src_pages, true, false);
+ virt_iter_new(&dest_iter, dest, length, dest_pages, true, true);
+ virt_iter_new( &src_iter, (void*)src, length, src_pages, true, false);
dest_iter.frag_len = 0;
src_iter.frag_len = 0;
diff --git a/src/kernel/proc.c b/src/kernel/proc.c
index eb36caf..bdd92ba 100644
--- a/src/kernel/proc.c
+++ b/src/kernel/proc.c
@@ -21,7 +21,7 @@ struct process *process_seed() {
// map the stack to the last page in memory
pagedir_map(proc->pages, (void*)~PAGE_MASK, page_alloc(1), true, true);
- proc->stack_top = proc->regs.esp = ~0xF;
+ proc->stack_top = (void*) (proc->regs.esp = ~0xF);
// map the kernel
// yup, .text is writeable too. the plan is to not map the kernel
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 13d32a2..b6eede6 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -26,7 +26,7 @@ _Noreturn static void await_finish(struct process *dead, struct process *listene
_Noreturn void _syscall_exit(const char *msg, size_t len) {
process_current->state = PS_DEAD;
- process_current->saved_addr = msg;
+ process_current->saved_addr = (void*)msg; // discard const
process_current->saved_len = len;
if (process_current->parent->state == PS_WAITS4CHILDDEATH)
@@ -72,9 +72,9 @@ int _syscall_fork() {
int _syscall_debuglog(const char *msg, size_t len) {
struct virt_iter iter;
- size_t written;
+ size_t written = 0;
- virt_iter_new(&iter, msg, len, process_current->pages, true, false);
+ virt_iter_new(&iter, (void*)msg, len, process_current->pages, true, false);
while (virt_iter_next(&iter)) {
tty_write(iter.frag, iter.frag_len);
written += iter.frag_len;
@@ -87,7 +87,7 @@ int syscall_handler(int num, int a, int b, int c) {
case _SYSCALL_EXIT:
_syscall_exit((void*)a, b);
case _SYSCALL_AWAIT:
- return _syscall_await((void*)a, (void*)b);
+ return _syscall_await((void*)a, b);
case _SYSCALL_FORK:
return _syscall_fork();
case _SYSCALL_DEBUGLOG:
diff --git a/src/kernel/vfs/path.c b/src/kernel/vfs/path.c
index dad4373..00af95c 100644
--- a/src/kernel/vfs/path.c
+++ b/src/kernel/vfs/path.c
@@ -10,12 +10,12 @@ int path_simplify(const char *in, char *out, size_t len) {
int out_pos = 0;
bool directory = 0;
- for (int i = 0; i < len; i += seg_len + 1) {
+ for (size_t i = 0; i < len; i += seg_len + 1) {
assert(in[i] == '/');
seg_len = 0;
directory = false;
- for (int j = i + 1; j < len; j++) {
+ for (size_t j = i + 1; j < len; j++) {
if (in[j] == '/') {
directory = true;
break;