Fix build if TOOLS_ENABLED is defined.

This commit is contained in:
Relintai 2024-01-25 12:32:44 +01:00
parent ed5efaf32d
commit d28cdc7555
10 changed files with 20 additions and 20 deletions

View File

@ -116,7 +116,7 @@ Error FileAccess::_open(const String &p_path, int p_mode_flags) {
if (fname != String()) { if (fname != String()) {
String base_file = path.get_file(); String base_file = path.get_file();
if (base_file != fname && base_file.findn(fname) == 0) { if (base_file != fname && base_file.findn(fname) == 0) {
WARN_PRINT("Case mismatch opening requested file '" + base_file + "', stored as '" + fname + "' in the filesystem. This file will not open when exported to other case-sensitive platforms."); LOG_WARN("Case mismatch opening requested file '" + base_file + "', stored as '" + fname + "' in the filesystem. This file will not open when exported to other case-sensitive platforms.");
} }
} }

View File

@ -15,7 +15,7 @@
void check_lockless_atomics() { void check_lockless_atomics() {
// Doing the check for the types we actually care about // Doing the check for the types we actually care about
if (!std::atomic<uint32_t>{}.is_lock_free() || !std::atomic<uint64_t>{}.is_lock_free() || !std::atomic_bool{}.is_lock_free()) { if (!std::atomic<uint32_t>{}.is_lock_free() || !std::atomic<uint64_t>{}.is_lock_free() || !std::atomic_bool{}.is_lock_free()) {
WARN_PRINT("Your compiler doesn't seem to support lockless atomics. Performance will be degraded. Please consider upgrading to a different or newer compiler."); LOG_WARN("Your compiler doesn't seem to support lockless atomics. Performance will be degraded. Please consider upgrading to a different or newer compiler.");
} }
} }

View File

@ -48,13 +48,13 @@ void StringName::cleanup() {
} }
} }
print_line("\nStringName reference ranking (from most to least referenced):\n"); LOG_MSG("\nStringName reference ranking (from most to least referenced):\n");
data.sort_custom<DebugSortReferences>(); data.sort_custom<DebugSortReferences>();
int unreferenced_stringnames = 0; int unreferenced_stringnames = 0;
int rarely_referenced_stringnames = 0; int rarely_referenced_stringnames = 0;
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
print_line(itos(i + 1) + ": " + data[i]->get_name() + " - " + itos(data[i]->debug_references)); LOG_MSG(itos(i + 1) + ": " + data[i]->get_name() + " - " + itos(data[i]->debug_references));
if (data[i]->debug_references == 0) { if (data[i]->debug_references == 0) {
unreferenced_stringnames += 1; unreferenced_stringnames += 1;
} else if (data[i]->debug_references < 5) { } else if (data[i]->debug_references < 5) {
@ -62,8 +62,8 @@ void StringName::cleanup() {
} }
} }
print_line(vformat("\nOut of %d StringNames, %d StringNames were never referenced during this run (0 times) (%.2f%%).", data.size(), unreferenced_stringnames, unreferenced_stringnames / float(data.size()) * 100)); LOG_MSG(vformat("\nOut of %d StringNames, %d StringNames were never referenced during this run (0 times) (%.2f%%).", data.size(), unreferenced_stringnames, unreferenced_stringnames / float(data.size()) * 100));
print_line(vformat("Out of %d StringNames, %d StringNames were rarely referenced during this run (1-4 times) (%.2f%%).", data.size(), rarely_referenced_stringnames, rarely_referenced_stringnames / float(data.size()) * 100)); LOG_MSG(vformat("Out of %d StringNames, %d StringNames were rarely referenced during this run (1-4 times) (%.2f%%).", data.size(), rarely_referenced_stringnames, rarely_referenced_stringnames / float(data.size()) * 100));
} }
#endif #endif
@ -77,9 +77,9 @@ void StringName::cleanup() {
lost_strings++; lost_strings++;
if (OS::get_singleton()->is_stdout_verbose()) { if (OS::get_singleton()->is_stdout_verbose()) {
if (d->cname) { if (d->cname) {
print_line("Orphan StringName: " + String(d->cname)); LOG_MSG("Orphan StringName: " + String(d->cname));
} else { } else {
print_line("Orphan StringName: " + String(d->name)); LOG_MSG("Orphan StringName: " + String(d->name));
} }
} }
} }

View File

@ -60,7 +60,7 @@ void Thread::callback(Thread *p_self, const Settings &p_settings, Callback p_cal
void Thread::start(Thread::Callback p_callback, void *p_user, const Settings &p_settings) { void Thread::start(Thread::Callback p_callback, void *p_user, const Settings &p_settings) {
if (id != _thread_id_hash(std::thread::id())) { if (id != _thread_id_hash(std::thread::id())) {
#ifdef DEBUG_ENABLED #ifdef DEBUG_ENABLED
WARN_PRINT("A Thread object has been re-started without wait_to_finish() having been called on it. Please do so to ensure correct cleanup of the thread."); LOG_WARN("A Thread object has been re-started without wait_to_finish() having been called on it. Please do so to ensure correct cleanup of the thread.");
#endif #endif
thread.detach(); thread.detach();
std::thread empty_thread; std::thread empty_thread;

View File

@ -5026,7 +5026,7 @@ static double built_in_strtod(
if (exp > maxExponent) { if (exp > maxExponent) {
exp = maxExponent; exp = maxExponent;
//WARN_PRINT("Exponent too high"); //LOG_WARN("Exponent too high");
} }
dblExp = 1.0; dblExp = 1.0;
for (d = powersOf10; exp != 0; exp >>= 1, ++d) { for (d = powersOf10; exp != 0; exp >>= 1, ++d) {

View File

@ -116,7 +116,7 @@ Error FileAccess::_open(const String &p_path, int p_mode_flags) {
if (fname != String()) { if (fname != String()) {
String base_file = path.get_file(); String base_file = path.get_file();
if (base_file != fname && base_file.findn(fname) == 0) { if (base_file != fname && base_file.findn(fname) == 0) {
WARN_PRINT("Case mismatch opening requested file '" + base_file + "', stored as '" + fname + "' in the filesystem. This file will not open when exported to other case-sensitive platforms."); LOG_WARN("Case mismatch opening requested file '" + base_file + "', stored as '" + fname + "' in the filesystem. This file will not open when exported to other case-sensitive platforms.");
} }
} }

View File

@ -15,7 +15,7 @@
void check_lockless_atomics() { void check_lockless_atomics() {
// Doing the check for the types we actually care about // Doing the check for the types we actually care about
if (!std::atomic<uint32_t>{}.is_lock_free() || !std::atomic<uint64_t>{}.is_lock_free() || !std::atomic_bool{}.is_lock_free()) { if (!std::atomic<uint32_t>{}.is_lock_free() || !std::atomic<uint64_t>{}.is_lock_free() || !std::atomic_bool{}.is_lock_free()) {
WARN_PRINT("Your compiler doesn't seem to support lockless atomics. Performance will be degraded. Please consider upgrading to a different or newer compiler."); LOG_WARN("Your compiler doesn't seem to support lockless atomics. Performance will be degraded. Please consider upgrading to a different or newer compiler.");
} }
} }

View File

@ -48,13 +48,13 @@ void StringName::cleanup() {
} }
} }
print_line("\nStringName reference ranking (from most to least referenced):\n"); LOG_MSG("\nStringName reference ranking (from most to least referenced):\n");
data.sort_custom<DebugSortReferences>(); data.sort_custom<DebugSortReferences>();
int unreferenced_stringnames = 0; int unreferenced_stringnames = 0;
int rarely_referenced_stringnames = 0; int rarely_referenced_stringnames = 0;
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
print_line(itos(i + 1) + ": " + data[i]->get_name() + " - " + itos(data[i]->debug_references)); LOG_MSG(itos(i + 1) + ": " + data[i]->get_name() + " - " + itos(data[i]->debug_references));
if (data[i]->debug_references == 0) { if (data[i]->debug_references == 0) {
unreferenced_stringnames += 1; unreferenced_stringnames += 1;
} else if (data[i]->debug_references < 5) { } else if (data[i]->debug_references < 5) {
@ -62,8 +62,8 @@ void StringName::cleanup() {
} }
} }
print_line(vformat("\nOut of %d StringNames, %d StringNames were never referenced during this run (0 times) (%.2f%%).", data.size(), unreferenced_stringnames, unreferenced_stringnames / float(data.size()) * 100)); LOG_MSG(vformat("\nOut of %d StringNames, %d StringNames were never referenced during this run (0 times) (%.2f%%).", data.size(), unreferenced_stringnames, unreferenced_stringnames / float(data.size()) * 100));
print_line(vformat("Out of %d StringNames, %d StringNames were rarely referenced during this run (1-4 times) (%.2f%%).", data.size(), rarely_referenced_stringnames, rarely_referenced_stringnames / float(data.size()) * 100)); LOG_MSG(vformat("Out of %d StringNames, %d StringNames were rarely referenced during this run (1-4 times) (%.2f%%).", data.size(), rarely_referenced_stringnames, rarely_referenced_stringnames / float(data.size()) * 100));
} }
#endif #endif
@ -77,9 +77,9 @@ void StringName::cleanup() {
lost_strings++; lost_strings++;
if (OS::get_singleton()->is_stdout_verbose()) { if (OS::get_singleton()->is_stdout_verbose()) {
if (d->cname) { if (d->cname) {
print_line("Orphan StringName: " + String(d->cname)); LOG_MSG("Orphan StringName: " + String(d->cname));
} else { } else {
print_line("Orphan StringName: " + String(d->name)); LOG_MSG("Orphan StringName: " + String(d->name));
} }
} }
} }

View File

@ -60,7 +60,7 @@ void Thread::callback(Thread *p_self, const Settings &p_settings, Callback p_cal
void Thread::start(Thread::Callback p_callback, void *p_user, const Settings &p_settings) { void Thread::start(Thread::Callback p_callback, void *p_user, const Settings &p_settings) {
if (id != _thread_id_hash(std::thread::id())) { if (id != _thread_id_hash(std::thread::id())) {
#ifdef DEBUG_ENABLED #ifdef DEBUG_ENABLED
WARN_PRINT("A Thread object has been re-started without wait_to_finish() having been called on it. Please do so to ensure correct cleanup of the thread."); LOG_WARN("A Thread object has been re-started without wait_to_finish() having been called on it. Please do so to ensure correct cleanup of the thread.");
#endif #endif
thread.detach(); thread.detach();
std::thread empty_thread; std::thread empty_thread;

View File

@ -5026,7 +5026,7 @@ static double built_in_strtod(
if (exp > maxExponent) { if (exp > maxExponent) {
exp = maxExponent; exp = maxExponent;
//WARN_PRINT("Exponent too high"); //LOG_WARN("Exponent too high");
} }
dblExp = 1.0; dblExp = 1.0;
for (d = powersOf10; exp != 0; exp >>= 1, ++d) { for (d = powersOf10; exp != 0; exp >>= 1, ++d) {