From 31c07ba434eedf45c1c2fbf4bbf04687e73275ac Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Fri, 18 Nov 2011 00:00:54 -0600 Subject: [PATCH] Fix some signed/unsigned issues --- kernel/core/serial.c | 2 +- kernel/core/syscall.c | 2 +- kernel/core/task.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/core/serial.c b/kernel/core/serial.c index bbf960a8..1a3d1947 100644 --- a/kernel/core/serial.c +++ b/kernel/core/serial.c @@ -71,7 +71,7 @@ serial_send(char out) { void serial_string(char * out) { - for (int i = 0; i < strlen(out); ++i) { + for (uint32_t i = 0; i < strlen(out); ++i) { serial_send(out[i]); } } diff --git a/kernel/core/syscall.c b/kernel/core/syscall.c index 8d20c7bd..2e7e01f8 100644 --- a/kernel/core/syscall.c +++ b/kernel/core/syscall.c @@ -44,7 +44,7 @@ static int read(int fd, char * ptr, int len) { IRQ_ON; kgets(ptr, len); IRQ_OFF; - if (strlen(ptr) < len) { + if (strlen(ptr) < (uint32_t)len) { int j = strlen(ptr); ptr[j] = '\n'; ptr[j+1] = '\0'; diff --git a/kernel/core/task.c b/kernel/core/task.c index 18b810d8..3c1c3320 100644 --- a/kernel/core/task.c +++ b/kernel/core/task.c @@ -117,7 +117,7 @@ fork() { new_task->heap = current_task->heap; new_task->heap_a = current_task->heap_a; new_task->image_size = current_task->image_size; - for (uint32_t i = 0; i <= strlen(current_task->wd); ++i) { + for (uint32_t i = 0; i <= strlen((const char *)current_task->wd); ++i) { new_task->wd[i] = current_task->wd[i]; }