diff --git a/cpu/i386/kmalloc.c b/cpu/i386/kmalloc.c index 8e657e8..ba5e217 100644 --- a/cpu/i386/kmalloc.c +++ b/cpu/i386/kmalloc.c @@ -75,10 +75,10 @@ void* kmalloc(uint32_t size) { set_bmap_bit(bmap_index+i); } uint32_t data_offset=(bmap_index*8)+8; - uint32_t* info=(void*)(((uint32_t)data)+data_offset-8); + uint32_t* info=(void*)(((char*)data)+data_offset-8); info[0]=num_4b_grps; info[1]=bmap_index; - return (void*)(((uint32_t)data)+data_offset); + return (void*)(((char*)data)+data_offset); } diff --git a/fs/ext2.c b/fs/ext2.c index 966d74c..aa37ccc 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -250,7 +250,7 @@ dir_entry* get_dir_listing(uint32_t inode_num,FILE* f,int num) { entries[num_entries_used].name[(int)current_entry->name_len]='\0'; num_entries_used++; tot_size+=current_entry->rec_len; - current_entry=(ext2_dir_entry*)(((uint32_t)current_entry)+current_entry->rec_len); + current_entry=(ext2_dir_entry*)(((char*)current_entry)+current_entry->rec_len); } if(num_entries_used==max_len) { max_len+=1; @@ -283,7 +283,7 @@ ext2_dir_entry* read_dir_entry(uint32_t inode_num,uint32_t dir_entry_num,FILE* f } ent_num++; tot_size+=current_entry->rec_len; - current_entry=(ext2_dir_entry*)(((uint32_t)current_entry)+current_entry->rec_len); + current_entry=(ext2_dir_entry*)(((char*)current_entry)+current_entry->rec_len); } return NULL; } diff --git a/libc/stdlib.c b/libc/stdlib.c index 1251aa9..fc65750 100644 --- a/libc/stdlib.c +++ b/libc/stdlib.c @@ -116,12 +116,12 @@ void* malloc(uint32_t size) { set_bmap_bit(entry.bitmap,bmap_index+i); } uint32_t data_offset=(bmap_index*8)+12; - uint32_t* info=(void*)(((uint32_t)entry.data_block)+data_offset-12); + uint32_t* info=(void*)(((char*)entry.data_block)+data_offset-12); info[0]=num_4b_grps; info[1]=bmap_index; info[2]=blk_indx; entry.avail_data_size-=size+12; - return (void*)(((uint32_t)entry.data_block)+data_offset); + return (void*)(((char*)entry.data_block)+data_offset); }