Skip to content

Commit

Permalink
fix a few typos in the new panic apis
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelflinger committed May 24, 2024
1 parent b4b702b commit a52ae3a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions libs/utils/include/utils/Panic.h
Original file line number Diff line number Diff line change
Expand Up @@ -582,19 +582,19 @@ class TPanicStream : public PanicStream {

#define PANIC_PRECONDITION_IMPL(cond, format, ...) \
::utils::PreconditionPanic::panic(PANIC_FUNCTION, \
PANIC_FILE(__FILE__), __LINE__, #cond, format, format, ##__VA_ARGS__)
PANIC_FILE(__FILE__), __LINE__, #cond, format, ##__VA_ARGS__)

#define PANIC_POSTCONDITION_IMPL(cond, format, ...) \
::utils::PostconditionPanic::panic(PANIC_FUNCTION, \
PANIC_FILE(__FILE__), __LINE__, #cond, format, format, ##__VA_ARGS__)
PANIC_FILE(__FILE__), __LINE__, #cond, format, ##__VA_ARGS__)

#define PANIC_ARITHMETIC_IMPL(cond, format, ...) \
::utils::ArithmeticPanic::panic(PANIC_FUNCTION, \
PANIC_FILE(__FILE__), __LINE__, #cond, format, format, ##__VA_ARGS__)
PANIC_FILE(__FILE__), __LINE__, #cond, format, ##__VA_ARGS__)

#define PANIC_LOG_IMPL(cond, format, ...) \
::utils::details::panicLog(PANIC_FUNCTION, \
PANIC_FILE(__FILE__), __LINE__, #cond, format, format, ##__VA_ARGS__)
PANIC_FILE(__FILE__), __LINE__, format, ##__VA_ARGS__)

/**
* PANIC_PRECONDITION is a macro that reports a PreconditionPanic
Expand Down
4 changes: 2 additions & 2 deletions libs/utils/src/Panic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ static std::string buildPanicString(
std::string_view const& msg, const char* function, int line,
const char* file, const char* reason) {
#ifndef NDEBUG
return sprintfToString("=%.*s\nin %s:%d\nin file %s\nreason: %s",
return sprintfToString("%.*s\nin %s:%d\nin file %s\nreason: %s",
msg.size(), msg.data(), function, line, file, reason);
#else
return sprintfToString("=%.*s\nin %s:%d\nreason: %s",
return sprintfToString("%.*s\nin %s:%d\nreason: %s",
msg.size(), msg.data(), function, line, reason);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion libs/utils/src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void abort() noexcept {
}

void panic(const char *func, const char * file, int line, const char *assertion) noexcept {
PANIC_LOG("%s:%d: failed assertion `%s'\n", file, line, assertion);
PANIC_LOG("%s:%d: failed assertion '%s'\n", file, line, assertion);
abort(); // set a breakpoint here
return; // this line is needed to be able to move the cursor here in the debugger
}
Expand Down

0 comments on commit a52ae3a

Please sign in to comment.