From 5dbf1809c6e3e905b94b8764e99491e608122261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 5 Mar 2017 16:44:50 +0100 Subject: A Whole New World (clang-format edition) I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code --- core/print_string.cpp | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'core/print_string.cpp') diff --git a/core/print_string.cpp b/core/print_string.cpp index 36316af619..1cb07802c5 100644 --- a/core/print_string.cpp +++ b/core/print_string.cpp @@ -32,15 +32,15 @@ #include -static PrintHandlerList *print_handler_list=NULL; -bool _print_line_enabled=true; +static PrintHandlerList *print_handler_list = NULL; +bool _print_line_enabled = true; bool _print_error_enabled = true; void add_print_handler(PrintHandlerList *p_handler) { _global_lock(); - p_handler->next=print_handler_list; - print_handler_list=p_handler; + p_handler->next = print_handler_list; + print_handler_list = p_handler; _global_unlock(); } @@ -51,43 +51,39 @@ void remove_print_handler(PrintHandlerList *p_handler) { PrintHandlerList *prev = NULL; PrintHandlerList *l = print_handler_list; - while(l) { + while (l) { - if (l==p_handler) { + if (l == p_handler) { if (prev) - prev->next=l->next; + prev->next = l->next; else - print_handler_list=l->next; + print_handler_list = l->next; break; } - prev=l; - l=l->next; - + prev = l; + l = l->next; } //OS::get_singleton()->print("print handler list is %p\n",print_handler_list); - ERR_FAIL_COND(l==NULL); + ERR_FAIL_COND(l == NULL); _global_unlock(); - } - void print_line(String p_string) { if (!_print_line_enabled) return; - OS::get_singleton()->print("%s\n",p_string.utf8().get_data()); + OS::get_singleton()->print("%s\n", p_string.utf8().get_data()); _global_lock(); PrintHandlerList *l = print_handler_list; - while(l) { + while (l) { - l->printfunc(l->userdata,p_string); - l=l->next; + l->printfunc(l->userdata, p_string); + l = l->next; } _global_unlock(); - } -- cgit v1.2.3