diff --git a/AK/Format.h b/AK/Format.h index c3334ca110..0cf7f61dd8 100644 --- a/AK/Format.h +++ b/AK/Format.h @@ -309,27 +309,24 @@ void vformat(const LogStream& stream, StringView fmtstr, TypeErasedFormatParams) #ifndef KERNEL void vout(FILE*, StringView fmtstr, TypeErasedFormatParams, bool newline = false); -// FIXME: Rename 'new_out' to 'out' when the name becomes avaliable. template -void new_out(FILE* file, StringView fmtstr, const Parameters&... parameters) { vout(file, fmtstr, VariadicFormatParams { parameters... }); } +void out(FILE* file, StringView fmtstr, const Parameters&... parameters) { vout(file, fmtstr, VariadicFormatParams { parameters... }); } template void outln(FILE* file, StringView fmtstr, const Parameters&... parameters) { vout(file, fmtstr, VariadicFormatParams { parameters... }, true); } template void outln(FILE* file, const char* fmtstr, const Parameters&... parameters) { vout(file, fmtstr, VariadicFormatParams { parameters... }, true); } inline void outln(FILE* file) { fputc('\n', file); } -// FIXME: Rename 'new_out' to 'out' when the name becomes avaliable. template -void new_out(StringView fmtstr, const Parameters&... parameters) { new_out(stdout, fmtstr, parameters...); } +void out(StringView fmtstr, const Parameters&... parameters) { out(stdout, fmtstr, parameters...); } template void outln(StringView fmtstr, const Parameters&... parameters) { outln(stdout, fmtstr, parameters...); } template void outln(const char* fmtstr, const Parameters&... parameters) { outln(stdout, fmtstr, parameters...); } inline void outln() { outln(stdout); } -// FIXME: Rename 'new_warn' to 'warn' when the name becomes avaliable. template -void new_warn(StringView fmtstr, const Parameters&... parameters) { new_out(stderr, fmtstr, parameters...); } +void warn(StringView fmtstr, const Parameters&... parameters) { out(stderr, fmtstr, parameters...); } template void warnln(StringView fmtstr, const Parameters&... parameters) { outln(stderr, fmtstr, parameters...); } template @@ -385,10 +382,10 @@ struct Formatter> : __FormatIfSupported: } // namespace AK #ifndef KERNEL -using AK::new_out; +using AK::out; using AK::outln; -using AK::new_warn; +using AK::warn; using AK::warnln; #endif diff --git a/AK/Tests/TestFormat.cpp b/AK/Tests/TestFormat.cpp index 4f3f9924f3..d31858e9ec 100644 --- a/AK/Tests/TestFormat.cpp +++ b/AK/Tests/TestFormat.cpp @@ -222,7 +222,7 @@ TEST_CASE(file_descriptor) FILE* file = fdopen(fd, "w+"); outln(file, "{}", "Hello, World!"); - new_out(file, "foo"); + out(file, "foo"); outln(file, "bar"); rewind(file); diff --git a/Applications/Debugger/main.cpp b/Applications/Debugger/main.cpp index e2ed5204d3..1a3d332a71 100644 --- a/Applications/Debugger/main.cpp +++ b/Applications/Debugger/main.cpp @@ -150,14 +150,14 @@ static bool handle_breakpoint_command(const String& command) static void print_help() { - new_out("Options:\n" - "cont - Continue execution\n" - "si - step to the next instruction\n" - "sl - step to the next source line\n" - "line - show the position of the current instruction in the source code\n" - "regs - Print registers\n" - "dis [number of instructions] - Print disassembly\n" - "bp
- Insert a breakpoint\n"); + out("Options:\n" + "cont - Continue execution\n" + "si - step to the next instruction\n" + "sl - step to the next source line\n" + "line - show the position of the current instruction in the source code\n" + "regs - Print registers\n" + "dis [number of instructions] - Print disassembly\n" + "bp
- Insert a breakpoint\n"); } int main(int argc, char** argv) diff --git a/Demos/DynamicLink/LinkDemo/main.cpp b/Demos/DynamicLink/LinkDemo/main.cpp index d927d45336..ae4c7bacd7 100644 --- a/Demos/DynamicLink/LinkDemo/main.cpp +++ b/Demos/DynamicLink/LinkDemo/main.cpp @@ -49,7 +49,7 @@ int main(int argc, char** argv, char** envp) auto byte_ptr = (uint8_t*)auxvp->a_un.a_ptr; outln(" My Random bytes are: "); for (size_t i = 0; i < 16; ++i) - new_out("{:#02x} ", byte_ptr[i]); + out("{:#02x} ", byte_ptr[i]); outln(); } } diff --git a/DevTools/HackStudio/Project.cpp b/DevTools/HackStudio/Project.cpp index d994cc80ee..109aba8a22 100644 --- a/DevTools/HackStudio/Project.cpp +++ b/DevTools/HackStudio/Project.cpp @@ -373,7 +373,7 @@ void Project::rebuild_tree() #if 0 Function dump_tree = [&](ProjectTreeNode& node, int indent) { for (int i = 0; i < indent; ++i) - new_out(" "); + out(" "); if (node.name.is_null()) outln("(null)"); else diff --git a/Libraries/LibCore/ArgsParser.cpp b/Libraries/LibCore/ArgsParser.cpp index 396c093890..bef5515420 100644 --- a/Libraries/LibCore/ArgsParser.cpp +++ b/Libraries/LibCore/ArgsParser.cpp @@ -181,28 +181,28 @@ bool ArgsParser::parse(int argc, char** argv, bool exit_on_failure) void ArgsParser::print_usage(FILE* file, const char* argv0) { - new_out(file, "Usage:\n\t\033[1m{}\033[0m", argv0); + out(file, "Usage:\n\t\033[1m{}\033[0m", argv0); for (auto& opt : m_options) { if (opt.long_name && !strcmp(opt.long_name, "help")) continue; if (opt.requires_argument) - new_out(file, " [{} {}]", opt.name_for_display(), opt.value_name); + out(file, " [{} {}]", opt.name_for_display(), opt.value_name); else - new_out(file, " [{}]", opt.name_for_display()); + out(file, " [{}]", opt.name_for_display()); } for (auto& arg : m_positional_args) { bool required = arg.min_values > 0; bool repeated = arg.max_values > 1; if (required && repeated) - new_out(file, " <{}...>", arg.name); + out(file, " <{}...>", arg.name); else if (required && !repeated) - new_out(file, " <{}>", arg.name); + out(file, " <{}>", arg.name); else if (!required && repeated) - new_out(file, " [{}...]", arg.name); + out(file, " [{}...]", arg.name); else if (!required && !repeated) - new_out(file, " [{}]", arg.name); + out(file, " [{}]", arg.name); } outln(file); @@ -212,25 +212,25 @@ void ArgsParser::print_usage(FILE* file, const char* argv0) auto print_argument = [&]() { if (opt.value_name) { if (opt.requires_argument) - new_out(file, " {}", opt.value_name); + out(file, " {}", opt.value_name); else - new_out(file, " [{}]", opt.value_name); + out(file, " [{}]", opt.value_name); } }; - new_out(file, "\t"); + out(file, "\t"); if (opt.short_name) { - new_out(file, "\033[1m-{}\033[0m", opt.short_name); + out(file, "\033[1m-{}\033[0m", opt.short_name); print_argument(); } if (opt.short_name && opt.long_name) - new_out(file, ", "); + out(file, ", "); if (opt.long_name) { - new_out(file, "\033[1m--{}\033[0m", opt.long_name); + out(file, "\033[1m--{}\033[0m", opt.long_name); print_argument(); } if (opt.help_string) - new_out(file, "\t{}", opt.help_string); + out(file, "\t{}", opt.help_string); outln(file); } @@ -238,9 +238,9 @@ void ArgsParser::print_usage(FILE* file, const char* argv0) outln(file, "\nArguments:"); for (auto& arg : m_positional_args) { - new_out(file, "\t\033[1m{}\033[0m", arg.name); + out(file, "\t\033[1m{}\033[0m", arg.name); if (arg.help_string) - new_out(file, "\t{}", arg.help_string); + out(file, "\t{}", arg.help_string); outln(file); } } diff --git a/Userland/expr.cpp b/Userland/expr.cpp index 85ef92ee8f..2d227f020c 100644 --- a/Userland/expr.cpp +++ b/Userland/expr.cpp @@ -47,9 +47,9 @@ Print the value of EXPRESSION to standard output.)"); template [[noreturn]] void fail(Args&&... args) { - new_warn("ERROR: \e[31m"); + warn("ERROR: \e[31m"); warnln(args...); - new_warn("\e[0m"); + warn("\e[0m"); exit(1); } diff --git a/Userland/functrace.cpp b/Userland/functrace.cpp index 99e424ae3a..7f50a74813 100644 --- a/Userland/functrace.cpp +++ b/Userland/functrace.cpp @@ -61,7 +61,7 @@ static void handle_sigint(int) static void print_function_call(String function_name, size_t depth) { for (size_t i = 0; i < depth; ++i) { - new_out(" "); + out(" "); } outln("=> {}", function_name); } diff --git a/Userland/kill.cpp b/Userland/kill.cpp index d1a85376a8..e29a6fd54e 100644 --- a/Userland/kill.cpp +++ b/Userland/kill.cpp @@ -50,7 +50,7 @@ int main(int argc, char** argv) for (size_t i = 0; i < NSIG; ++i) { if (i && !(i % 5)) outln(""); - new_out("{:2}) {:10}", i, getsignalname(i)); + out("{:2}) {:10}", i, getsignalname(i)); } outln(""); return 0; diff --git a/Userland/tree.cpp b/Userland/tree.cpp index 5f3ba4d14f..5f6dd334a5 100644 --- a/Userland/tree.cpp +++ b/Userland/tree.cpp @@ -51,11 +51,11 @@ static void print_directory_tree(const String& root_path, int depth, const Strin } else { root_indent_string = ""; } - new_out("{}|-- ", root_indent_string); + out("{}|-- ", root_indent_string); } String root_dir_name = AK::LexicalPath(root_path).basename(); - new_out("\033[34;1m{}\033[0m\n", root_dir_name); + out("\033[34;1m{}\033[0m\n", root_dir_name); if (depth >= max_depth) { return;