1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:27:45 +00:00

Userland: Replace most printf-style APIs with AK::Format APIs :^)

This commit is contained in:
Linus Groh 2021-05-31 15:43:25 +01:00
parent 4f1889c2cb
commit f5c35fccca
75 changed files with 642 additions and 644 deletions

View file

@ -28,7 +28,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
auto proc_interrupts = Core::File::construct("/proc/interrupts");
if (!proc_interrupts->open(Core::OpenMode::ReadOnly)) {
fprintf(stderr, "Error: %s\n", proc_interrupts->error_string());
warnln("Error: {}", proc_interrupts->error_string());
return 1;
}
@ -37,7 +37,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
return 1;
}
printf("%4s %-10s\n", " ", "CPU0");
outln(" CPU0");
auto file_contents = proc_interrupts->read_all();
auto json = JsonValue::from_string(file_contents);
VERIFY(json.has_value());
@ -48,8 +48,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
auto controller = handler.get("controller").to_string();
auto call_count = handler.get("call_count").to_string();
printf("%4s: %-10s %-10s %-30s\n",
interrupt.characters(), call_count.characters(), controller.characters(), purpose.characters());
outln("{:>4}: {:10} {:10} {:30}", interrupt, call_count, controller, purpose);
});
return 0;