From 2aa06e3b27ba3dfa2a6db4859e8afe7c28c74128 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 9af9af341..3e298c734 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" @@ -76,7 +79,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);\ }\ @@ -85,7 +88,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));\ }\ @@ -96,8 +99,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*/