Skip to content

Commit

Permalink
Fix incorrect argument order in calls to xrDebug::error/backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Jan 14, 2016
1 parent bdd8343 commit c12aae9
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/xrCore/xrDebugNew.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<no expression>";
LPSTR buffer_base = assertion_info;
LPSTR buffer = assertion_info;
int assertion_size = (int)assertion_info_size;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -317,7 +319,7 @@ void __cdecl xrDebug::fatal(const char* file, int line, const char* function, co

bool ignore_always = true;

backend("fatal error", "<no expression>", 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) ();
Expand Down Expand Up @@ -728,9 +730,8 @@ void _terminate ()

string4096 assertion_info;

Debug.gather_info (
//gather_info (
"<no expression>",
Debug.gather_info(
nullptr,
"Unexpected application termination",
0,
0,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -830,8 +831,8 @@ static void invalid_parameter_handler(
}

Debug.backend(
"error handler is invoked!",
expression_,
"invalid parameter",
0,
0,
file_,
Expand Down

0 comments on commit c12aae9

Please sign in to comment.