Skip to content

Commit 8e3e3b8

Browse files
committed
Addendum to 25d9ba3: Fix build error
1 parent d5b9a56 commit 8e3e3b8

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

Shared/mods/deathmatch/logic/lua/LuaBasic.h

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,24 @@ namespace lua
2626
// PopTrival should read a simple value of type T from the stack without extra type checks
2727
// If whatever is at that point in the stack is not convertible to T, the behavior is undefined
2828
template <typename T>
29-
T PopPrimitive(lua_State* L, std::size_t& index);
29+
inline T PopPrimitive(lua_State* L, std::size_t& index);
3030

3131
// Push should push a value of type T to the Lua Stack
3232
// This will always increase the stack size by 1
33-
void Push(lua_State* L, int value) { lua_pushnumber(L, value); }
34-
void Push(lua_State* L, unsigned int value) { lua_pushnumber(L, value); }
35-
void Push(lua_State* L, float value) { lua_pushnumber(L, value); }
36-
void Push(lua_State* L, double value) { lua_pushnumber(L, value); }
33+
inline void Push(lua_State* L, int value) { lua_pushnumber(L, value); }
34+
inline void Push(lua_State* L, unsigned int value) { lua_pushnumber(L, value); }
35+
inline void Push(lua_State* L, float value) { lua_pushnumber(L, value); }
36+
inline void Push(lua_State* L, double value) { lua_pushnumber(L, value); }
3737

38-
void Push(lua_State* L, bool value) { lua_pushboolean(L, value); }
38+
inline void Push(lua_State* L, bool value) { lua_pushboolean(L, value); }
3939

40-
void Push(lua_State* L, nullptr_t) { lua_pushnil(L); }
40+
inline void Push(lua_State* L, nullptr_t) { lua_pushnil(L); }
4141

42-
void Push(lua_State* L, const std::string& value) { lua_pushlstring(L, value.data(), value.length()); }
42+
inline void Push(lua_State* L, const std::string& value) { lua_pushlstring(L, value.data(), value.length()); }
4343

44-
void Push(lua_State* L, const std::string_view& value) { lua_pushlstring(L, value.data(), value.length()); }
44+
inline void Push(lua_State* L, const std::string_view& value) { lua_pushlstring(L, value.data(), value.length()); }
4545

46-
void Push(lua_State* L, const CLuaArgument& arg)
46+
inline void Push(lua_State* L, const CLuaArgument& arg)
4747
{
4848
if (arg.GetType() == LUA_TNONE)
4949
{
@@ -54,36 +54,36 @@ namespace lua
5454
arg.Push(L);
5555
}
5656

57-
void Push(lua_State* L, const CLuaArguments& args) { args.PushAsTable(L); }
57+
inline void Push(lua_State* L, const CLuaArguments& args) { args.PushAsTable(L); }
5858

59-
void Push(lua_State* L, const CVector2D& value) { lua_pushvector(L, value); }
59+
inline void Push(lua_State* L, const CVector2D& value) { lua_pushvector(L, value); }
6060

61-
void Push(lua_State* L, const CVector& value) { lua_pushvector(L, value); }
61+
inline void Push(lua_State* L, const CVector& value) { lua_pushvector(L, value); }
6262

63-
void Push(lua_State* L, const CVector4D& value) { lua_pushvector(L, value); }
63+
inline void Push(lua_State* L, const CVector4D& value) { lua_pushvector(L, value); }
6464

65-
void Push(lua_State* L, const CMatrix& value) { lua_pushmatrix(L, value); }
65+
inline void Push(lua_State* L, const CMatrix& value) { lua_pushmatrix(L, value); }
6666

6767
// Script entities
6868
#ifdef MTA_CLIENT
69-
void Push(lua_State* L, const CClientEntity* value) { lua_pushelement(L, const_cast<CClientEntity*>(value)); }
69+
inline void Push(lua_State* L, const CClientEntity* value) { lua_pushelement(L, const_cast<CClientEntity*>(value)); }
7070
#else
71-
void Push(lua_State* L, const CElement* value) { lua_pushelement(L, const_cast<CElement*>(value)); }
72-
void Push(lua_State* L, const CAccount* value) { lua_pushaccount(L, const_cast<CAccount*>(value)); }
73-
void Push(lua_State* L, const CAccessControlList* value) { lua_pushacl(L, const_cast<CAccessControlList*>(value)); }
74-
void Push(lua_State* L, const CAccessControlListGroup* value) { lua_pushaclgroup(L, const_cast<CAccessControlListGroup*>(value)); }
75-
void Push(lua_State* L, const CBan* value) { lua_pushban(L, const_cast<CBan*>(value)); }
76-
void Push(lua_State* L, const CTextDisplay* value) { lua_pushtextdisplay(L, const_cast<CTextDisplay*>(value)); }
77-
void Push(lua_State* L, const CTextItem* value) { lua_pushtextitem(L, const_cast<CTextItem*>(value)); }
78-
void Push(lua_State* L, const CDbJobData* value) { lua_pushquery(L, const_cast<CDbJobData*>(value)); }
71+
inline void Push(lua_State* L, const CElement* value) { lua_pushelement(L, const_cast<CElement*>(value)); }
72+
inline void Push(lua_State* L, const CAccount* value) { lua_pushaccount(L, const_cast<CAccount*>(value)); }
73+
inline void Push(lua_State* L, const CAccessControlList* value) { lua_pushacl(L, const_cast<CAccessControlList*>(value)); }
74+
inline void Push(lua_State* L, const CAccessControlListGroup* value) { lua_pushaclgroup(L, const_cast<CAccessControlListGroup*>(value)); }
75+
inline void Push(lua_State* L, const CBan* value) { lua_pushban(L, const_cast<CBan*>(value)); }
76+
inline void Push(lua_State* L, const CTextDisplay* value) { lua_pushtextdisplay(L, const_cast<CTextDisplay*>(value)); }
77+
inline void Push(lua_State* L, const CTextItem* value) { lua_pushtextitem(L, const_cast<CTextItem*>(value)); }
78+
inline void Push(lua_State* L, const CDbJobData* value) { lua_pushquery(L, const_cast<CDbJobData*>(value)); }
7979
#endif
80-
void Push(lua_State* L, const CResource* value) { lua_pushresource(L, const_cast<CResource*>(value)); }
81-
void Push(lua_State* L, const CXMLNode* value) { lua_pushxmlnode(L, const_cast<CXMLNode*>(value)); }
82-
void Push(lua_State* L, const CLuaTimer* value) { lua_pushtimer(L, const_cast<CLuaTimer*>(value)); }
83-
void Push(lua_State* L, const CLuaVector2D* value) { lua_pushvector(L, *value); }
84-
void Push(lua_State* L, const CLuaVector3D* value) { lua_pushvector(L, *value); }
85-
void Push(lua_State* L, const CLuaVector4D* value) { lua_pushvector(L, *value); }
86-
void Push(lua_State* L, const CLuaMatrix* value) { lua_pushmatrix(L, *value); }
80+
inline void Push(lua_State* L, const CResource* value) { lua_pushresource(L, const_cast<CResource*>(value)); }
81+
inline void Push(lua_State* L, const CXMLNode* value) { lua_pushxmlnode(L, const_cast<CXMLNode*>(value)); }
82+
inline void Push(lua_State* L, const CLuaTimer* value) { lua_pushtimer(L, const_cast<CLuaTimer*>(value)); }
83+
inline void Push(lua_State* L, const CLuaVector2D* value) { lua_pushvector(L, *value); }
84+
inline void Push(lua_State* L, const CLuaVector3D* value) { lua_pushvector(L, *value); }
85+
inline void Push(lua_State* L, const CLuaVector4D* value) { lua_pushvector(L, *value); }
86+
inline void Push(lua_State* L, const CLuaMatrix* value) { lua_pushmatrix(L, *value); }
8787

8888
// Overload for enum types only
8989
template <typename T>

0 commit comments

Comments
 (0)