summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal <amlal@nekernel.org>2025-05-08 08:54:48 +0200
committerAmlal <amlal@nekernel.org>2025-05-08 08:54:48 +0200
commit8c0d7efb90585bf53b9f7496c2883af5ffa6ee68 (patch)
treeb4d5dbea3d8f273b0bbd6ef2d4b53d487890e95b
parenta8782019a20f5487494e436f79b876b57f7229e1 (diff)
feat(kernel): Fix warnings and bugs regarding the DebugOutput device.
-rw-r--r--dev/kernel/HALKit/AMD64/HalDebugOutput.cc24
-rw-r--r--tooling/mkfs.hefs.cc15
2 files changed, 10 insertions, 29 deletions
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<const Utf8Char*>* 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<const Char*>* 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<const Char*>* 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;
diff --git a/tooling/mkfs.hefs.cc b/tooling/mkfs.hefs.cc
index 2ddc7484..c8243b5c 100644
--- a/tooling/mkfs.hefs.cc
+++ b/tooling/mkfs.hefs.cc
@@ -16,10 +16,11 @@ static size_t kSectorSize = 512;
int main(int argc, char** argv) {
if (argc < 2) {
- mkfs::console_out() << "hefs: usage: mkfs.hefs -L <label> -s <sector_size> -b <ind_start> -e "
- << "<ind_end> -bs <block_start> -be <block_end> -is <in_start> -ie <in_end> "
- "-S <disk_size> -o <output_device>"
- << "\n";
+ mkfs::console_out()
+ << "hefs: usage: mkfs.hefs -L <label> -s <sector_size> -b <ind_start> -e "
+ << "<ind_end> -bs <block_start> -be <block_end> -is <in_start> -ie <in_end> "
+ "-S <disk_size> -o <output_device>"
+ << "\n";
return EXIT_FAILURE;
}
@@ -63,8 +64,7 @@ int main(int argc, char** argv) {
std::ofstream output_device(output_path, std::ios::binary);
if (!output_device.good()) {
- mkfs::console_out() << "hefs: error: Unable to open output_device: " << output_path
- << "\n";
+ mkfs::console_out() << "hefs: error: Unable to open output_device: " << output_path << "\n";
return EXIT_FAILURE;
}
@@ -114,8 +114,7 @@ int main(int argc, char** argv) {
output_device.flush();
output_device.close();
- mkfs::console_out() << "hefs: info: Wrote filesystem to output_device: " << output_path
- << "\n";
+ mkfs::console_out() << "hefs: info: Wrote filesystem to output_device: " << output_path << "\n";
return EXIT_SUCCESS;
} \ No newline at end of file