Skip to content

Commit c12aae9

Browse files
author
nitrocaster
committed
Fix incorrect argument order in calls to xrDebug::error/backend.
1 parent bdd8343 commit c12aae9

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/xrCore/xrDebugNew.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ void LogStackTrace(LPCSTR header)
7474

7575
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)
7676
{
77+
if (!expression)
78+
expression = "<no expression>";
7779
LPSTR buffer_base = assertion_info;
7880
LPSTR buffer = assertion_info;
7981
int assertion_size = (int)assertion_info_size;
@@ -273,17 +275,17 @@ LPCSTR xrDebug::error2string(long code)
273275

274276
void xrDebug::error(long hr, const char* expr, const char* file, int line, const char* function, bool& ignore_always)
275277
{
276-
backend(error2string(hr), expr, 0, 0, file, line, function, ignore_always);
278+
backend(expr, error2string(hr), 0, 0, file, line, function, ignore_always);
277279
}
278280

279281
void xrDebug::error(long hr, const char* expr, const char* e2, const char* file, int line, const char* function, bool& ignore_always)
280282
{
281-
backend(error2string(hr), expr, e2, 0, file, line, function, ignore_always);
283+
backend(expr, error2string(hr), e2, 0, file, line, function, ignore_always);
282284
}
283285

284286
void xrDebug::fail(const char* e1, const char* file, int line, const char* function, bool& ignore_always)
285287
{
286-
backend("assertion failed", e1, 0, 0, file, line, function, ignore_always);
288+
backend(e1, "assertion failed", 0, 0, file, line, function, ignore_always);
287289
}
288290

289291
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
317319

318320
bool ignore_always = true;
319321

320-
backend("fatal error", "<no expression>", buffer, 0, file, line, function, ignore_always);
322+
backend(nullptr, "fatal error", buffer, 0, file, line, function, ignore_always);
321323
}
322324

323325
typedef void(*full_memory_stats_callback_type) ();
@@ -728,9 +730,8 @@ void _terminate ()
728730

729731
string4096 assertion_info;
730732

731-
Debug.gather_info (
732-
//gather_info (
733-
"<no expression>",
733+
Debug.gather_info(
734+
nullptr,
734735
"Unexpected application termination",
735736
0,
736737
0,
@@ -769,7 +770,7 @@ static void handler_base(LPCSTR reason_string)
769770
{
770771
bool ignore_always = false;
771772
Debug.backend(
772-
"error handler is invoked!",
773+
nullptr,
773774
reason_string,
774775
0,
775776
0,
@@ -830,8 +831,8 @@ static void invalid_parameter_handler(
830831
}
831832

832833
Debug.backend(
833-
"error handler is invoked!",
834834
expression_,
835+
"invalid parameter",
835836
0,
836837
0,
837838
file_,

0 commit comments

Comments
 (0)