From d28cdc75559311633173fbf2b60703d98d543494 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 25 Jan 2024 12:32:44 +0100 Subject: [PATCH] Fix build if TOOLS_ENABLED is defined. --- sfw/core/file_access.cpp | 2 +- sfw/core/safe_refcount.cpp | 2 +- sfw/core/string_name.cpp | 12 ++++++------ sfw/core/thread.cpp | 2 +- sfw/core/ustring.cpp | 2 +- sfwl/core/file_access.cpp | 2 +- sfwl/core/safe_refcount.cpp | 2 +- sfwl/core/string_name.cpp | 12 ++++++------ sfwl/core/thread.cpp | 2 +- sfwl/core/ustring.cpp | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sfw/core/file_access.cpp b/sfw/core/file_access.cpp index 337794d..6b5ab9c 100644 --- a/sfw/core/file_access.cpp +++ b/sfw/core/file_access.cpp @@ -116,7 +116,7 @@ Error FileAccess::_open(const String &p_path, int p_mode_flags) { if (fname != String()) { String base_file = path.get_file(); 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."); } } diff --git a/sfw/core/safe_refcount.cpp b/sfw/core/safe_refcount.cpp index 720e3e6..cc683e1 100644 --- a/sfw/core/safe_refcount.cpp +++ b/sfw/core/safe_refcount.cpp @@ -15,7 +15,7 @@ void check_lockless_atomics() { // Doing the check for the types we actually care about if (!std::atomic{}.is_lock_free() || !std::atomic{}.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."); } } diff --git a/sfw/core/string_name.cpp b/sfw/core/string_name.cpp index cd2a9c9..e09bacc 100644 --- a/sfw/core/string_name.cpp +++ b/sfw/core/string_name.cpp @@ -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(); int unreferenced_stringnames = 0; int rarely_referenced_stringnames = 0; 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) { unreferenced_stringnames += 1; } 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)); - 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("\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("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 @@ -77,9 +77,9 @@ void StringName::cleanup() { lost_strings++; if (OS::get_singleton()->is_stdout_verbose()) { if (d->cname) { - print_line("Orphan StringName: " + String(d->cname)); + LOG_MSG("Orphan StringName: " + String(d->cname)); } else { - print_line("Orphan StringName: " + String(d->name)); + LOG_MSG("Orphan StringName: " + String(d->name)); } } } diff --git a/sfw/core/thread.cpp b/sfw/core/thread.cpp index 0b5c26a..319bf18 100644 --- a/sfw/core/thread.cpp +++ b/sfw/core/thread.cpp @@ -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) { if (id != _thread_id_hash(std::thread::id())) { #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 thread.detach(); std::thread empty_thread; diff --git a/sfw/core/ustring.cpp b/sfw/core/ustring.cpp index e54da02..822ef3d 100644 --- a/sfw/core/ustring.cpp +++ b/sfw/core/ustring.cpp @@ -5026,7 +5026,7 @@ static double built_in_strtod( if (exp > maxExponent) { exp = maxExponent; - //WARN_PRINT("Exponent too high"); + //LOG_WARN("Exponent too high"); } dblExp = 1.0; for (d = powersOf10; exp != 0; exp >>= 1, ++d) { diff --git a/sfwl/core/file_access.cpp b/sfwl/core/file_access.cpp index 337794d..6b5ab9c 100644 --- a/sfwl/core/file_access.cpp +++ b/sfwl/core/file_access.cpp @@ -116,7 +116,7 @@ Error FileAccess::_open(const String &p_path, int p_mode_flags) { if (fname != String()) { String base_file = path.get_file(); 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."); } } diff --git a/sfwl/core/safe_refcount.cpp b/sfwl/core/safe_refcount.cpp index 720e3e6..cc683e1 100644 --- a/sfwl/core/safe_refcount.cpp +++ b/sfwl/core/safe_refcount.cpp @@ -15,7 +15,7 @@ void check_lockless_atomics() { // Doing the check for the types we actually care about if (!std::atomic{}.is_lock_free() || !std::atomic{}.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."); } } diff --git a/sfwl/core/string_name.cpp b/sfwl/core/string_name.cpp index cd2a9c9..e09bacc 100644 --- a/sfwl/core/string_name.cpp +++ b/sfwl/core/string_name.cpp @@ -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(); int unreferenced_stringnames = 0; int rarely_referenced_stringnames = 0; 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) { unreferenced_stringnames += 1; } 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)); - 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("\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("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 @@ -77,9 +77,9 @@ void StringName::cleanup() { lost_strings++; if (OS::get_singleton()->is_stdout_verbose()) { if (d->cname) { - print_line("Orphan StringName: " + String(d->cname)); + LOG_MSG("Orphan StringName: " + String(d->cname)); } else { - print_line("Orphan StringName: " + String(d->name)); + LOG_MSG("Orphan StringName: " + String(d->name)); } } } diff --git a/sfwl/core/thread.cpp b/sfwl/core/thread.cpp index 0b5c26a..319bf18 100644 --- a/sfwl/core/thread.cpp +++ b/sfwl/core/thread.cpp @@ -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) { if (id != _thread_id_hash(std::thread::id())) { #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 thread.detach(); std::thread empty_thread; diff --git a/sfwl/core/ustring.cpp b/sfwl/core/ustring.cpp index e54da02..822ef3d 100644 --- a/sfwl/core/ustring.cpp +++ b/sfwl/core/ustring.cpp @@ -5026,7 +5026,7 @@ static double built_in_strtod( if (exp > maxExponent) { exp = maxExponent; - //WARN_PRINT("Exponent too high"); + //LOG_WARN("Exponent too high"); } dblExp = 1.0; for (d = powersOf10; exp != 0; exp >>= 1, ++d) {