Skip to content

Commit a63c1b4

Browse files
committed
UNUSED() macro
1 parent 8ad1936 commit a63c1b4

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

21-shell/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ We also added some flags to turn warnings into errors, since an apparantly minor
3838
converting pointers can blow up later on. This also forced us to modify some misc pointer
3939
declarations in our code.
4040

41+
Finally, we'll add a macro to avoid warning-errors on unused parameters on `libc/function.h`
42+
4143
Keyboard characters
4244
-------------------
4345

21-shell/cpu/timer.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#include "timer.h"
22
#include "isr.h"
33
#include "ports.h"
4+
#include "../libc/function.h"
45

56
u32 tick = 0;
67

7-
static void timer_callback() {
8+
static void timer_callback(registers_t regs) {
89
tick++;
10+
UNUSED(regs);
911
}
1012

1113
void init_timer(u32 freq) {

21-shell/drivers/keyboard.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "../cpu/isr.h"
44
#include "screen.h"
55
#include "../libc/string.h"
6+
#include "../libc/function.h"
67
#include "../kernel/kernel.h"
78

89
#define BACKSPACE 0x0E
@@ -23,7 +24,7 @@ const char sc_ascii[] = { '?', '?', '1', '2', '3', '4', '5', '6',
2324
'H', 'J', 'K', 'L', ';', '\'', '`', '?', '\\', 'Z', 'X', 'C', 'V',
2425
'B', 'N', 'M', ',', '.', '/', '?', '?', '?', ' '};
2526

26-
static void keyboard_callback() {
27+
static void keyboard_callback(registers_t regs) {
2728
/* The PIC leaves us the scancode in port 0x60 */
2829
u8 scancode = port_byte_in(0x60);
2930

@@ -42,6 +43,7 @@ static void keyboard_callback() {
4243
append(key_buffer, letter);
4344
kprint(str);
4445
}
46+
UNUSED(regs);
4547
}
4648

4749
void init_keyboard() {

0 commit comments

Comments
 (0)