@@ -26,24 +26,24 @@ namespace lua
26
26
// PopTrival should read a simple value of type T from the stack without extra type checks
27
27
// If whatever is at that point in the stack is not convertible to T, the behavior is undefined
28
28
template <typename T>
29
- T PopPrimitive (lua_State* L, std::size_t & index);
29
+ inline T PopPrimitive (lua_State* L, std::size_t & index);
30
30
31
31
// Push should push a value of type T to the Lua Stack
32
32
// 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); }
37
37
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); }
39
39
40
- void Push (lua_State* L, nullptr_t ) { lua_pushnil (L); }
40
+ inline void Push (lua_State* L, nullptr_t ) { lua_pushnil (L); }
41
41
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 ()); }
43
43
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 ()); }
45
45
46
- void Push (lua_State* L, const CLuaArgument& arg)
46
+ inline void Push (lua_State* L, const CLuaArgument& arg)
47
47
{
48
48
if (arg.GetType () == LUA_TNONE)
49
49
{
@@ -54,36 +54,36 @@ namespace lua
54
54
arg.Push (L);
55
55
}
56
56
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); }
58
58
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); }
60
60
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); }
62
62
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); }
64
64
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); }
66
66
67
67
// Script entities
68
68
#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)); }
70
70
#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)); }
79
79
#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); }
87
87
88
88
// Overload for enum types only
89
89
template <typename T>
0 commit comments