summaryrefslogtreecommitdiffstats
path: root/core/print_string.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-03-05 16:44:50 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-03-05 16:44:50 +0100
commit5dbf1809c6e3e905b94b8764e99491e608122261 (patch)
tree5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /core/print_string.cpp
parent45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff)
downloadredot-engine-5dbf1809c6e3e905b94b8764e99491e608122261.tar.gz
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
Diffstat (limited to 'core/print_string.cpp')
-rw-r--r--core/print_string.cpp34
1 files changed, 15 insertions, 19 deletions
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 <stdio.h>
-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();
-
}