Lua/LuaInstance: Improve code
Former-commit-id: a998449fae2d50541ab4c5d1c68d9dff4e7238a6 [formerly a5734fdf64bc9d8acbe1d0923d70ddc553b3a14b] [formerly 4da841f9961603fffdf6c1112610d082db361ce7 [formerly d9cea98d520bef475ea472b4b0eceb5881ee6c90]] Former-commit-id: be40337660be3bc317c4f2def0e301ac2e0a0834 [formerly b08c4c9ca758ccdd92ad0f6fbbbd5a5f7ea70b58] Former-commit-id: 32908cf086667a25ea718f62a240d0d44628b016
This commit is contained in:
@@ -464,26 +464,6 @@ namespace Nz
|
||||
return FromLuaType(lua_getglobal(m_state, name.GetConstBuffer()));
|
||||
}
|
||||
|
||||
lua_State* LuaInstance::GetInternalState() const
|
||||
{
|
||||
return m_state;
|
||||
}
|
||||
|
||||
String LuaInstance::GetLastError() const
|
||||
{
|
||||
return m_lastError;
|
||||
}
|
||||
|
||||
UInt32 LuaInstance::GetMemoryLimit() const
|
||||
{
|
||||
return m_memoryLimit;
|
||||
}
|
||||
|
||||
UInt32 LuaInstance::GetMemoryUsage() const
|
||||
{
|
||||
return m_memoryUsage;
|
||||
}
|
||||
|
||||
LuaType LuaInstance::GetMetatable(const char* tname) const
|
||||
{
|
||||
return FromLuaType(luaL_getmetatable(m_state, tname));
|
||||
@@ -501,7 +481,7 @@ namespace Nz
|
||||
|
||||
unsigned int LuaInstance::GetStackTop() const
|
||||
{
|
||||
return lua_gettop(m_state);
|
||||
return static_cast<int>(lua_gettop(m_state));
|
||||
}
|
||||
|
||||
LuaType LuaInstance::GetTable(int index) const
|
||||
@@ -509,11 +489,6 @@ namespace Nz
|
||||
return FromLuaType(lua_gettable(m_state, index));
|
||||
}
|
||||
|
||||
UInt32 LuaInstance::GetTimeLimit() const
|
||||
{
|
||||
return m_timeLimit;
|
||||
}
|
||||
|
||||
LuaType LuaInstance::GetType(int index) const
|
||||
{
|
||||
return FromLuaType(lua_type(m_state, index));
|
||||
@@ -690,9 +665,10 @@ namespace Nz
|
||||
lua_pushlstring(m_state, str.GetConstBuffer(), str.GetSize());
|
||||
}
|
||||
|
||||
void LuaInstance::PushTable(unsigned int sequenceElementCount, unsigned int arrayElementCount) const
|
||||
void LuaInstance::PushTable(std::size_t sequenceElementCount, std::size_t arrayElementCount) const
|
||||
{
|
||||
lua_createtable(m_state, sequenceElementCount, arrayElementCount);
|
||||
constexpr std::size_t maxInt = std::numeric_limits<int>::max();
|
||||
lua_createtable(m_state, static_cast<int>(std::min(sequenceElementCount, maxInt)), static_cast<int>(std::min(arrayElementCount, maxInt)));
|
||||
}
|
||||
|
||||
void* LuaInstance::PushUserdata(std::size_t size) const
|
||||
|
||||
Reference in New Issue
Block a user