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>
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);
}
protected_function_result invoke(lua_State* Lthread, types<>, std::index_sequence<>, std::ptrdiff_t n) {
int stacksize = lua_gettop( Lthread );
protected_function_result invoke(types<>, std::index_sequence<>, std::ptrdiff_t n) {
int stacksize = lua_gettop( lua_state() );
int firstreturn = std::max( 1, stacksize - static_cast<int>( n ) );
luacall(n, LUA_MULTRET);
int poststacksize = lua_gettop( Lthread );
int poststacksize = lua_gettop(lua_state());
int returncount = poststacksize - (firstreturn - 1);
return protected_function_result( lua_state( ), firstreturn, returncount, returncount, status() );
}
@ -108,7 +108,7 @@ public:
decltype(auto) call( Args&&... args ) {
push();
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);
luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC | LUAJIT_MODE_ON);
lua_pop(L, 1);
#else
(void)L;
(void)handler;
#endif
}
inline void luajit_exception_off(lua_State* L) {
#ifdef SOL_LUAJIT
luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC | LUAJIT_MODE_OFF);
#else
(void)L;
#endif
}
} // stack