From 8c0d7efb90585bf53b9f7496c2883af5ffa6ee68 Mon Sep 17 00:00:00 2001 From: Amlal Date: Thu, 8 May 2025 08:54:48 +0200 Subject: feat(kernel): Fix warnings and bugs regarding the DebugOutput device. --- dev/kernel/HALKit/AMD64/HalDebugOutput.cc | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'dev') diff --git a/dev/kernel/HALKit/AMD64/HalDebugOutput.cc b/dev/kernel/HALKit/AMD64/HalDebugOutput.cc index a9759fc0..71dee911 100644 --- a/dev/kernel/HALKit/AMD64/HalDebugOutput.cc +++ b/dev/kernel/HALKit/AMD64/HalDebugOutput.cc @@ -76,28 +76,11 @@ EXTERN_C void ke_utf_io_write(IDeviceObject* obj, const Utf8Cha index = 0; len = urt_string_len(bytes); - static BOOL not_important = YES; - while (index < len) { if (bytes[index] == '\r') HAL::rt_out8(Detail::kPort, '\r'); HAL::rt_out8(Detail::kPort, bytes[index] == '\r' ? '\n' : bytes[index]); - char tmp_str[2]; - tmp_str[0] = bytes[index]; - tmp_str[1] = 0; - - if (bytes[index] == '*') { - if (not_important) - not_important = NO; - else - not_important = YES; - - ++index; - - continue; - } - ++index; } @@ -124,9 +107,8 @@ EXTERN_C void ke_io_write(IDeviceObject* obj, const Char* bytes) { index = 0; len = rt_string_len(bytes); - static SizeT x = kFontSizeX, y = kFontSizeY; - - static BOOL not_important = YES; + STATIC SizeT x = kFontSizeX, y = kFontSizeY; + STATIC BOOL not_important = YES; while (index < len) { if (bytes[index] == '\r') HAL::rt_out8(Detail::kPort, '\r'); @@ -148,7 +130,7 @@ EXTERN_C void ke_io_write(IDeviceObject* obj, const Char* bytes) { continue; } - fb_render_string(tmp_str, y, x, not_important ? RGB(0xff, 0xff, 0xff) : RGB(0x00, 0x00, 0xff)); + fb_render_string(tmp_str, y, x, not_important ? RGB(0xff, 0xff, 0xff) : RGB(0xff, 0x00, 0x00)); if (bytes[index] == '\r') { y += kFontSizeY; -- cgit v1.2.3