From 391ed256d21a6ae2e2456d1809f357e6e96e15d1 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 20 Jan 2020 23:12:54 +0100 Subject: Added pure awesomeness Actually quite some days of work but ok --- src/kernel/fs/marfs/read_whole_file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/kernel/fs/marfs/read_whole_file.c') diff --git a/src/kernel/fs/marfs/read_whole_file.c b/src/kernel/fs/marfs/read_whole_file.c index 85f9bbb..dda5daf 100644 --- a/src/kernel/fs/marfs/read_whole_file.c +++ b/src/kernel/fs/marfs/read_whole_file.c @@ -1,7 +1,7 @@ #include #include -#include #include +#include static uint8_t last_max_level = 0; @@ -19,7 +19,7 @@ uint32_t marfs_get_recursive(uint8_t level, uint32_t i, uint32_t rec_lba) kfree(contents); uint32_t toRet; - if (level > 1) toRet = marfs_get_recursive(level - 1, i, next_rec_lba); + if (level > 1) toRet = marfs_get_recursive((uint8_t) (level - 1), i, next_rec_lba); else toRet = next_rec_lba; last_max_level = 0; return toRet; @@ -48,7 +48,7 @@ void marfs_read_whole_file(uint32_t lba_inode, uint8_t *buffer) for (uint32_t i = 0; i < size_in_blocks; i++) { uint32_t this_block = marfs_get_block(inode, i); uint8_t *this_block_contents = ata_read28(interface, this_block); - uint16_t upper_bound = (i != size_in_blocks - 1) ? 512 : (inode->size % 512); + uint16_t upper_bound = (uint16_t) ((i != size_in_blocks - 1) ? 512 : (inode->size % 512)); for (uint16_t j = 0; j < upper_bound; j++) buffer[(i * 512) + j] = this_block_contents[j]; kfree(this_block_contents); } @@ -63,7 +63,7 @@ uint8_t *marfs_allocate_and_read_whole_file(uint32_t lba_inode) uint64_t size = inode->size; kfree(inode); - uint8_t *buffer = kmalloc(size); + uint8_t *buffer = (uint8_t *) kmalloc((uint32_t) size); marfs_read_whole_file(lba_inode, buffer); return buffer; } -- cgit v1.2.3