From c12aae99ba1057092a16785f06b15a1d1eb030e0 Mon Sep 17 00:00:00 2001 From: nitrocaster Date: Thu, 14 Jan 2016 19:07:23 +0300 Subject: [PATCH] Fix incorrect argument order in calls to xrDebug::error/backend. --- src/xrCore/xrDebugNew.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/xrCore/xrDebugNew.cpp b/src/xrCore/xrDebugNew.cpp index 012d61dfcfc..2423ede893a 100644 --- a/src/xrCore/xrDebugNew.cpp +++ b/src/xrCore/xrDebugNew.cpp @@ -74,6 +74,8 @@ void LogStackTrace(LPCSTR header) void xrDebug::gather_info(const char* expression, const char* description, const char* argument0, const char* argument1, const char* file, int line, const char* function, LPSTR assertion_info, u32 const assertion_info_size) { + if (!expression) + expression = ""; LPSTR buffer_base = assertion_info; LPSTR buffer = assertion_info; int assertion_size = (int)assertion_info_size; @@ -273,17 +275,17 @@ LPCSTR xrDebug::error2string(long code) void xrDebug::error(long hr, const char* expr, const char* file, int line, const char* function, bool& ignore_always) { - backend(error2string(hr), expr, 0, 0, file, line, function, ignore_always); + backend(expr, error2string(hr), 0, 0, file, line, function, ignore_always); } void xrDebug::error(long hr, const char* expr, const char* e2, const char* file, int line, const char* function, bool& ignore_always) { - backend(error2string(hr), expr, e2, 0, file, line, function, ignore_always); + backend(expr, error2string(hr), e2, 0, file, line, function, ignore_always); } void xrDebug::fail(const char* e1, const char* file, int line, const char* function, bool& ignore_always) { - backend("assertion failed", e1, 0, 0, file, line, function, ignore_always); + backend(e1, "assertion failed", 0, 0, file, line, function, ignore_always); } void xrDebug::fail(const char* e1, const std::string& e2, const char* file, int line, const char* function, bool& ignore_always) @@ -317,7 +319,7 @@ void __cdecl xrDebug::fatal(const char* file, int line, const char* function, co bool ignore_always = true; - backend("fatal error", "", buffer, 0, file, line, function, ignore_always); + backend(nullptr, "fatal error", buffer, 0, file, line, function, ignore_always); } typedef void(*full_memory_stats_callback_type) (); @@ -728,9 +730,8 @@ void _terminate () string4096 assertion_info; - Debug.gather_info ( - //gather_info ( - "", + Debug.gather_info( + nullptr, "Unexpected application termination", 0, 0, @@ -769,7 +770,7 @@ static void handler_base(LPCSTR reason_string) { bool ignore_always = false; Debug.backend( - "error handler is invoked!", + nullptr, reason_string, 0, 0, @@ -830,8 +831,8 @@ static void invalid_parameter_handler( } Debug.backend( - "error handler is invoked!", expression_, + "invalid parameter", 0, 0, file_,