aboutsummaryrefslogtreecommitdiffstats
path: root/core/logging.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-12-05 14:51:03 -0800
committerChris Robinson <[email protected]>2022-12-05 14:51:03 -0800
commitdf6d61dd40b602af55f903564358b083bb8b37e4 (patch)
tree84113a098867e2ba82aa1f156911e94755fde727 /core/logging.cpp
parent73df39b8f8cefa0c0fca0e287b548063e9e62636 (diff)
Use standard likely/unlikely attributes when available
Diffstat (limited to 'core/logging.cpp')
-rw-r--r--core/logging.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/logging.cpp b/core/logging.cpp
index 7ee7ff23..ec81764c 100644
--- a/core/logging.cpp
+++ b/core/logging.cpp
@@ -26,7 +26,7 @@ void al_print(LogLevel level, FILE *logfile, const char *fmt, ...)
va_start(args, fmt);
va_copy(args2, args);
const int msglen{std::vsnprintf(str, sizeof(stcmsg), fmt, args)};
- if(unlikely(msglen >= 0 && static_cast<size_t>(msglen) >= sizeof(stcmsg)))
+ if(msglen >= 0 && static_cast<size_t>(msglen) >= sizeof(stcmsg)) [[alunlikely]]
{
dynmsg.resize(static_cast<size_t>(msglen) + 1u);
str = dynmsg.data();
@@ -66,7 +66,7 @@ void al_print(LogLevel level, FILE *logfile, const char *fmt, ...)
va_start(args, fmt);
va_copy(args2, args);
const int msglen{std::vsnprintf(str, sizeof(stcmsg), fmt, args)};
- if(unlikely(msglen >= 0 && static_cast<size_t>(msglen) >= sizeof(stcmsg)))
+ if(msglen >= 0 && static_cast<size_t>(msglen) >= sizeof(stcmsg)) [[alunlikely]]
{
dynmsg.resize(static_cast<size_t>(msglen) + 1u);
str = dynmsg.data();