From 91439462f5ad77eb128658229724c9a3660a2068 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 30 Oct 2019 23:28:47 +0100 Subject: Fixed some warnings --- src/kernel/fs/initrd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/kernel/fs/initrd.c b/src/kernel/fs/initrd.c index b291801..906498e 100644 --- a/src/kernel/fs/initrd.c +++ b/src/kernel/fs/initrd.c @@ -3,6 +3,7 @@ #include #include #include +#include initrd_header_t *initrd_header; initrd_file_header_t *file_headers; @@ -31,7 +32,7 @@ static struct dirent *initrd_readdir(fs_node_t *node, uint32_t index) { return &dirent; } - if (index - 1 >= nroot_nodes) + if (index - 1 >= (uint32_t) nroot_nodes) return 0; strcpy(dirent.name, root_nodes[index - 1].name); dirent.name[strlen(root_nodes[index - 1].name)] = 0; @@ -84,10 +85,10 @@ fs_node_t *initialise_initrd(uint32_t location) { root_nodes = (fs_node_t *) kmalloc(sizeof(fs_node_t) * initrd_header->nfiles); nroot_nodes = initrd_header->nfiles; - for (int i = 0; i < initrd_header->nfiles; i++) { + for (uint32_t i = 0; i < initrd_header->nfiles; i++) { file_headers[i].offset += location; - strcpy(root_nodes[i].name, &file_headers[i].name); + strcpy(root_nodes[i].name, (const char *) &file_headers[i].name); root_nodes[i].mask = root_nodes[i].uid = root_nodes[i].gid = 0; root_nodes[i].length = file_headers[i].length; root_nodes[i].inode = i; -- cgit v1.2.3