mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Fix some issues found by cppcheck.
This commit is contained in:
parent
72407a9cfb
commit
f851c4aa33
163 changed files with 776 additions and 767 deletions
|
@ -432,21 +432,21 @@ struct GDScriptUtilityFunctionsDefinitions {
|
|||
}
|
||||
|
||||
static inline void print_debug(Variant *r_ret, const Variant **p_args, int p_arg_count, Callable::CallError &r_error) {
|
||||
String str;
|
||||
String s;
|
||||
for (int i = 0; i < p_arg_count; i++) {
|
||||
str += p_args[i]->operator String();
|
||||
s += p_args[i]->operator String();
|
||||
}
|
||||
|
||||
if (Thread::get_caller_id() == Thread::get_main_id()) {
|
||||
ScriptLanguage *script = GDScriptLanguage::get_singleton();
|
||||
if (script->debug_get_stack_level_count() > 0) {
|
||||
str += "\n At: " + script->debug_get_stack_level_source(0) + ":" + itos(script->debug_get_stack_level_line(0)) + ":" + script->debug_get_stack_level_function(0) + "()";
|
||||
s += "\n At: " + script->debug_get_stack_level_source(0) + ":" + itos(script->debug_get_stack_level_line(0)) + ":" + script->debug_get_stack_level_function(0) + "()";
|
||||
}
|
||||
} else {
|
||||
str += "\n At: Cannot retrieve debug info outside the main thread. Thread ID: " + itos(Thread::get_caller_id());
|
||||
s += "\n At: Cannot retrieve debug info outside the main thread. Thread ID: " + itos(Thread::get_caller_id());
|
||||
}
|
||||
|
||||
print_line(str);
|
||||
print_line(s);
|
||||
*r_ret = Variant();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue