From 1809f48ca90879eaeeba47d109abbdd46ed90679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Ro=C3=9F?= Date: Sat, 10 Aug 2024 18:44:29 +0200 Subject: [PATCH] [Misc] Removed some leftover debug stuff that does nothing anymore. --- Descent3/init.cpp | 2 +- ddebug/debug.h | 2 +- ddebug/lnxdebug.cpp | 2 +- ddebug/windebug.cpp | 2 +- misc/error.cpp | 15 ++++----------- misc/pserror.h | 4 +--- 6 files changed, 9 insertions(+), 18 deletions(-) diff --git a/Descent3/init.cpp b/Descent3/init.cpp index 5eed345c..92a18cd4 100644 --- a/Descent3/init.cpp +++ b/Descent3/init.cpp @@ -1059,7 +1059,7 @@ void PreInitD3Systems() { debugging = true; #endif - error_Init(debugging, false, PRODUCT_NAME); + error_Init(debugging, PRODUCT_NAME); if (FindArg("-lowmem")) Mem_low_memory_mode = true; diff --git a/ddebug/debug.h b/ddebug/debug.h index a1aa71ca..2c0e6a95 100644 --- a/ddebug/debug.h +++ b/ddebug/debug.h @@ -152,7 +152,7 @@ constexpr const int OSMBOX_OKCANCEL = 5; extern bool Debug_break; // if we are running under a debugger, then pass true -bool Debug_Init(bool debugger, bool mono_debug); +bool Debug_Init(bool debugger); // Does a messagebox with a stack dump // Messagebox shows topstring, then stack dump, then bottomstring // Return types are the same as the Windows return values diff --git a/ddebug/lnxdebug.cpp b/ddebug/lnxdebug.cpp index 54ee3d15..8508233c 100644 --- a/ddebug/lnxdebug.cpp +++ b/ddebug/lnxdebug.cpp @@ -50,7 +50,7 @@ bool Debug_break = false; static char *Debug_DumpInfo(); // if we are running under a debugger, then pass true -bool Debug_Init(bool debugger, bool mono_debug) { +bool Debug_Init(bool debugger) { #ifndef RELEASE Debug_break = debugger; diff --git a/ddebug/windebug.cpp b/ddebug/windebug.cpp index 4f7ef833..1e27cda1 100644 --- a/ddebug/windebug.cpp +++ b/ddebug/windebug.cpp @@ -203,7 +203,7 @@ bool Debug_break = false; /////////////////////////////////////////////////////////////////////////////// -bool Debug_Init(bool debugger, bool mono_debug) { +bool Debug_Init(bool debugger) { // initialization of debugging consoles. #ifndef RELEASE diff --git a/misc/error.cpp b/misc/error.cpp index 935a98c0..bf58414a 100644 --- a/misc/error.cpp +++ b/misc/error.cpp @@ -77,8 +77,6 @@ #define MAX_MSG_LEN 2000 -void Default_dbgbrk_callback(); - // Debug break chain handlers void (*DebugBreak_callback_stop)() = NULL; void (*DebugBreak_callback_resume)() = NULL; @@ -97,8 +95,8 @@ void error_Spew(); ////////////////////////////////////////////////////////////////////////////// // initializes error handler. -bool error_Init(bool debugger, bool mono_debug, const char *app_title) { - Debug_Init(debugger, mono_debug); +bool error_Init(bool debugger, const char *app_title) { + Debug_Init(debugger); Error_initialized = true; Exit_message[0] = 0; @@ -114,8 +112,6 @@ bool error_Init(bool debugger, bool mono_debug, const char *app_title) { return true; } -int no_debug_dialog = 0; - // exits the application and prints out a standard error message void Error(const char *fmt, ...) { std::va_list arglist; @@ -139,13 +135,10 @@ void Error(const char *fmt, ...) { if (Debug_break) answer = Debug_ErrorBox(OSMBOX_ABORTRETRYIGNORE, Exit_title_str, Exit_message, "Press RETRY to debug."); - else if (!no_debug_dialog) + else answer = Debug_ErrorBox(OSMBOX_OKCANCEL, Exit_title_str, Exit_message, "Press OK to exit, CANCEL to ignore this error and continue."); - if (no_debug_dialog) - answer = IDOK; - switch (answer) { case IDRETRY: debug_break(); // Step Out of this function to see where Error() was called @@ -225,7 +218,7 @@ void AssertionFailed(const char *expstr, const char *file, int line) { // error message output function void error_Spew() { - if (Exit_message[0] && !no_debug_dialog) + if (Exit_message[0]) Debug_MessageBox(OSMBOX_OK, Exit_title_str, Exit_message); } diff --git a/misc/pserror.h b/misc/pserror.h index 5ec401db..ea7ee295 100644 --- a/misc/pserror.h +++ b/misc/pserror.h @@ -152,10 +152,8 @@ #include "debug.h" #include "mono.h" -extern int no_debug_dialog; - // initializes error handler. -bool error_Init(bool debugger, bool mono_debug, const char *app_title); +bool error_Init(bool debugger, const char *app_title); // exits the application and prints out a standard error message void Error(const char *fmt, ...); // prints out an assertion error