From b033314bf1901d436dc71d41d5e1f37dda47e511 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Thu, 12 Dec 2024 16:03:08 +0100 Subject: formatting: Use clang-format on all projects This commit also add braces to all `if` statements. --- kernel/drivers/ac97.c | 2 +- kernel/drivers/ac97.h | 4 ++-- kernel/drivers/mouse.c | 12 ++++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) (limited to 'kernel/drivers') diff --git a/kernel/drivers/ac97.c b/kernel/drivers/ac97.c index b88a32a..27711ff 100644 --- a/kernel/drivers/ac97.c +++ b/kernel/drivers/ac97.c @@ -213,7 +213,7 @@ void ac97_init(void) { PCM Output by writing value 0 to this register. Now sound card is ready to use. */ - ac97_set_volume(100); + ac97_set_volume(5); // Playing sound /* diff --git a/kernel/drivers/ac97.h b/kernel/drivers/ac97.h index f1089e5..20ac43b 100644 --- a/kernel/drivers/ac97.h +++ b/kernel/drivers/ac97.h @@ -1,8 +1,8 @@ -#include #include +#include void ac97_init(void); -int ac97_add_pcm(u8* buffer, size_t len); +int ac97_add_pcm(u8 *buffer, size_t len); int ac97_can_write(void); void ac97_set_volume(int volume); int ac97_get_volume(void); diff --git a/kernel/drivers/mouse.c b/kernel/drivers/mouse.c index 47133b8..dea8c08 100644 --- a/kernel/drivers/mouse.c +++ b/kernel/drivers/mouse.c @@ -102,18 +102,22 @@ void int_mouse(reg_t *r) { int16_t y = mouse_u8[2]; uint8_t xs = mouse_u8[0] & (1 << 4); uint8_t ys = mouse_u8[0] & (1 << 5); - if (xs) + if (xs) { x |= 0xFF00; - if (ys) + } + if (ys) { y |= 0xFF00; + } mouse_x += x; mouse_y -= y; - if (mouse_x < 0) + if (mouse_x < 0) { mouse_x = 0; - if (mouse_y < 0) + } + if (mouse_y < 0) { mouse_y = 0; + } mouse_middle_button = mouse_u8[0] & (1 << 2); mouse_right_button = mouse_u8[0] & (1 << 1); -- cgit v1.2.3