summaryrefslogtreecommitdiffstats
path: root/core/print_string.cpp
diff options
context:
space:
mode:
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();
-
}