From be023cf57d763ff5b17dbb2a3afec156ca54a65d Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 31 Oct 2019 23:14:05 +0100 Subject: Fixed several warnings --- src/bootloader/make_initrd.c | 4 +++- src/kernel/graphics/vesa.c | 4 ++-- src/kernel/input/ps2/keyboard.c | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/bootloader/make_initrd.c b/src/bootloader/make_initrd.c index d7e0487..2ee4716 100644 --- a/src/bootloader/make_initrd.c +++ b/src/bootloader/make_initrd.c @@ -1,4 +1,6 @@ #include +#include +#include struct initrd_header { unsigned char magic; @@ -10,7 +12,7 @@ struct initrd_header { int main(char argc, char **argv) { int nheaders = (argc - 1) / 2; struct initrd_header headers[64]; - printf("size of header: %d\n", sizeof(struct initrd_header)); + printf("size of header: %d\n", (int) sizeof(struct initrd_header)); unsigned int off = sizeof(struct initrd_header) * 64 + sizeof(int); for (int i = 0; i < nheaders; i++) { diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c index 858ed95..ba8d84b 100644 --- a/src/kernel/graphics/vesa.c +++ b/src/kernel/graphics/vesa.c @@ -24,14 +24,14 @@ struct edid_data get_edid() { regs.ax = 0x4F15; regs.bx = 0x01; // BL regs.es = 0; - regs.di = (unsigned short) edid; + regs.di = (uintptr_t) &edid; paging_disable(); int32(0x10, ®s); paging_enable(); kfree(edid); - return *edid; + return *(struct edid_data *) edid; } void vbe_set_mode(unsigned short mode) { diff --git a/src/kernel/input/ps2/keyboard.c b/src/kernel/input/ps2/keyboard.c index 87006b6..7e01af5 100644 --- a/src/kernel/input/ps2/keyboard.c +++ b/src/kernel/input/ps2/keyboard.c @@ -71,7 +71,7 @@ void keyboard_handler(struct regs *r) { scan_code = receive_b(0x60); - if (!(scan_code & 0x80)) { // PRESS + if ((scan_code & 0x80) == 0) { // PRESS // TODO: Fix caps lock deactivation when pressing shift while shifted if (current_keymap[scan_code] == 14 || (current_keymap[scan_code] == 15 && !shift_pressed)) { shift_pressed = 1; @@ -81,7 +81,7 @@ void keyboard_handler(struct regs *r) { return; } vesa_keyboard_char(current_keymap[scan_code]); - } else if (scan_code & 0x80) { // RELEASE + } else { // RELEASE char key = current_keymap[scan_code]; if (key == 14) shift_pressed = 0; } -- cgit v1.2.3