From 4ccbaece88e6764d775587ad202d479dc0738f10 Mon Sep 17 00:00:00 2001 From: Lynix Date: Mon, 7 Dec 2015 19:54:45 +0100 Subject: [PATCH] Lua: Fix compilation error with some arguments type Former-commit-id: 954f5ddff3c7fba4fa5975321f2c6a1c89c3d4ad --- include/Nazara/Lua/LuaInstance.hpp | 4 ++-- include/Nazara/Lua/LuaInstance.inl | 11 +++++++++-- src/Nazara/Lua/LuaInstance.cpp | 8 ++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/include/Nazara/Lua/LuaInstance.hpp b/include/Nazara/Lua/LuaInstance.hpp index 1124ce72a..3a725472a 100644 --- a/include/Nazara/Lua/LuaInstance.hpp +++ b/include/Nazara/Lua/LuaInstance.hpp @@ -133,8 +133,8 @@ namespace Nz void Remove(int index); void Replace(int index); - void SetField(const char* name, int index = -2); - void SetField(const String& name, int index = -2); + void SetField(const char* name, int tableIndex = -2); + void SetField(const String& name, int tableIndex = -2); void SetGlobal(const char* name); void SetGlobal(const String& name); void SetMetatable(const char* tname); diff --git a/include/Nazara/Lua/LuaInstance.inl b/include/Nazara/Lua/LuaInstance.inl index 0274bb0be..57da097bc 100644 --- a/include/Nazara/Lua/LuaInstance.inl +++ b/include/Nazara/Lua/LuaInstance.inl @@ -137,6 +137,12 @@ namespace Nz { } + template + void ProcessArgs() + { + // No argument to process + } + template void ProcessArgs() { @@ -168,7 +174,7 @@ namespace Nz } private: - std::tuple m_args; + std::tuple>...> m_args; LuaInstance& m_instance; }; @@ -185,6 +191,7 @@ namespace Nz template void ProcessArgs() { + // No argument to process } template @@ -232,7 +239,7 @@ namespace Nz } private: - std::tuple m_args; + std::tuple>...> m_args; LuaInstance& m_instance; T& m_object; }; diff --git a/src/Nazara/Lua/LuaInstance.cpp b/src/Nazara/Lua/LuaInstance.cpp index e1ed81644..dcaad2e26 100644 --- a/src/Nazara/Lua/LuaInstance.cpp +++ b/src/Nazara/Lua/LuaInstance.cpp @@ -714,14 +714,14 @@ namespace Nz lua_replace(m_state, index); } - void LuaInstance::SetField(const char* name, int index) + void LuaInstance::SetField(const char* name, int tableIndex) { - lua_setfield(m_state, index, name); + lua_setfield(m_state, tableIndex, name); } - void LuaInstance::SetField(const String& name, int index) + void LuaInstance::SetField(const String& name, int tableIndex) { - lua_setfield(m_state, index, name.GetConstBuffer()); + lua_setfield(m_state, tableIndex, name.GetConstBuffer()); } void LuaInstance::SetGlobal(const char* name)