mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Unused parameters and all that jazz....
This commit is contained in:
parent
c07bbd248c
commit
e57ac87868
@ -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 );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user