From 6f71fc17c2c60c39e961dd281adc385a4932df23 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 1 Aug 2025 20:41:50 +0200 Subject: [PATCH] mark this as unlikely those will never run ever after displaying once --- src/lua_script.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lua_script.h b/src/lua_script.h index 932ec510f..ccbef2b45 100644 --- a/src/lua_script.h +++ b/src/lua_script.h @@ -10,6 +10,9 @@ /// \file lua_script.h /// \brief Lua scripting basics +#ifndef LUA_SCRIPT_H +#define LUA_SCRIPT_H + #include "m_fixed.h" #include "doomtype.h" #include "d_player.h" @@ -75,7 +78,7 @@ void COM_Lua_f(void); #define LUA_Deprecated(L,this_func,use_instead)\ {\ static UINT8 seen = 0;\ - if (!seen) {\ + if (UNLIKELY(!seen)) {\ seen = 1;\ CONS_Alert(CONS_WARNING,"\"%s\" is deprecated and will be removed.\nUse \"%s\" instead.\n", this_func, use_instead);\ }\ @@ -84,7 +87,7 @@ void COM_Lua_f(void); #define LUA_LogDeprecated(L,this_func,use_instead)\ {\ static UINT8 seen = 0;\ - if (!seen) {\ + if (UNLIKELY(!seen)) {\ seen = 1;\ CON_LogMessage(va("\"%s\" is deprecated and will be removed.\nUse \"%s\" instead.\n", this_func, use_instead));\ }\ @@ -95,8 +98,10 @@ void COM_Lua_f(void); #define LUA_UsageWarning(L, warningmsg)\ {\ static UINT8 seen = 0;\ - if (!seen) {\ + if (UNLIKELY(!seen)) {\ seen = 1;\ CONS_Alert(CONS_WARNING,"%s\n", warningmsg);\ }\ } + +#endif/*LUA_SCRIPT_H*/