From a63c1b4fb5bc57350adc85050733ac83d2268446 Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 23 Mar 2015 20:03:41 +0100 Subject: [PATCH] UNUSED() macro --- 21-shell/README.md | 2 ++ 21-shell/cpu/timer.c | 4 +++- 21-shell/drivers/keyboard.c | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/21-shell/README.md b/21-shell/README.md index 987c88e..34aca08 100644 --- a/21-shell/README.md +++ b/21-shell/README.md @@ -38,6 +38,8 @@ We also added some flags to turn warnings into errors, since an apparantly minor converting pointers can blow up later on. This also forced us to modify some misc pointer declarations in our code. +Finally, we'll add a macro to avoid warning-errors on unused parameters on `libc/function.h` + Keyboard characters ------------------- diff --git a/21-shell/cpu/timer.c b/21-shell/cpu/timer.c index 82ce105..0be49db 100644 --- a/21-shell/cpu/timer.c +++ b/21-shell/cpu/timer.c @@ -1,11 +1,13 @@ #include "timer.h" #include "isr.h" #include "ports.h" +#include "../libc/function.h" u32 tick = 0; -static void timer_callback() { +static void timer_callback(registers_t regs) { tick++; + UNUSED(regs); } void init_timer(u32 freq) { diff --git a/21-shell/drivers/keyboard.c b/21-shell/drivers/keyboard.c index b61e5a8..6f40ac6 100644 --- a/21-shell/drivers/keyboard.c +++ b/21-shell/drivers/keyboard.c @@ -3,6 +3,7 @@ #include "../cpu/isr.h" #include "screen.h" #include "../libc/string.h" +#include "../libc/function.h" #include "../kernel/kernel.h" #define BACKSPACE 0x0E @@ -23,7 +24,7 @@ const char sc_ascii[] = { '?', '?', '1', '2', '3', '4', '5', '6', 'H', 'J', 'K', 'L', ';', '\'', '`', '?', '\\', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/', '?', '?', '?', ' '}; -static void keyboard_callback() { +static void keyboard_callback(registers_t regs) { /* The PIC leaves us the scancode in port 0x60 */ u8 scancode = port_byte_in(0x60); @@ -42,6 +43,7 @@ static void keyboard_callback() { append(key_buffer, letter); kprint(str); } + UNUSED(regs); } void init_keyboard() {