Unused parameters and all that jazz....

This commit is contained in:
ThePhD 2016-02-27 02:59:47 -05:00
parent c07bbd248c
commit e57ac87868
2 changed files with 10 additions and 5 deletions

View File

@ -57,15 +57,15 @@ private:
} }
template <std::size_t I> template <std::size_t I>
void invoke(lua_State* Lthread, types<void>, std::index_sequence<I>, std::ptrdiff_t n) { void invoke(types<void>, std::index_sequence<I>, std::ptrdiff_t n) {
luacall(n, 0); luacall(n, 0);
} }
protected_function_result invoke(lua_State* Lthread, types<>, std::index_sequence<>, std::ptrdiff_t n) { protected_function_result invoke(types<>, std::index_sequence<>, std::ptrdiff_t n) {
int stacksize = lua_gettop( Lthread ); int stacksize = lua_gettop( lua_state() );
int firstreturn = std::max( 1, stacksize - static_cast<int>( n ) ); int firstreturn = std::max( 1, stacksize - static_cast<int>( n ) );
luacall(n, LUA_MULTRET); luacall(n, LUA_MULTRET);
int poststacksize = lua_gettop( Lthread ); int poststacksize = lua_gettop(lua_state());
int returncount = poststacksize - (firstreturn - 1); int returncount = poststacksize - (firstreturn - 1);
return protected_function_result( lua_state( ), firstreturn, returncount, returncount, status() ); return protected_function_result( lua_state( ), firstreturn, returncount, returncount, status() );
} }
@ -108,7 +108,7 @@ public:
decltype(auto) call( Args&&... args ) { decltype(auto) call( Args&&... args ) {
push(); push();
int pushcount = stack::push_args( lua_state(), std::forward<Args>( args )... ); int pushcount = stack::push_args( lua_state(), std::forward<Args>( args )... );
return invoke( lua_state(), types<Ret...>( ), std::index_sequence_for<Ret...>(), pushcount ); return invoke( types<Ret...>( ), std::index_sequence_for<Ret...>(), pushcount );
} }
}; };
} }

View File

@ -900,12 +900,17 @@ inline void luajit_exception_handler(lua_State* L, int(*handler)(lua_State*, lua
lua_pushlightuserdata(L, (void*)handler); lua_pushlightuserdata(L, (void*)handler);
luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC | LUAJIT_MODE_ON); luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC | LUAJIT_MODE_ON);
lua_pop(L, 1); lua_pop(L, 1);
#else
(void)L;
(void)handler;
#endif #endif
} }
inline void luajit_exception_off(lua_State* L) { inline void luajit_exception_off(lua_State* L) {
#ifdef SOL_LUAJIT #ifdef SOL_LUAJIT
luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC | LUAJIT_MODE_OFF); luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC | LUAJIT_MODE_OFF);
#else
(void)L;
#endif #endif
} }
} // stack } // stack