diff --git a/sol/call.hpp b/sol/call.hpp index 34bcd153..94201548 100644 --- a/sol/call.hpp +++ b/sol/call.hpp @@ -134,7 +134,7 @@ namespace call_detail { userdataref.push(); luaL_getmetatable(L, &meta[0]); - if (stack::get(L) == type::nil) { + if (type_of(L, -1) == type::nil) { lua_pop(L, 1); return luaL_error(L, "sol: unable to get usertype metatable"); } @@ -314,7 +314,7 @@ namespace call_detail { userdataref.push(); luaL_getmetatable(L, &metakey[0]); - if (stack::get(L) == type::nil) { + if (type_of(L, -1) == type::nil) { lua_pop(L, 1); return luaL_error(L, "sol: unable to get usertype metatable"); } @@ -342,7 +342,7 @@ namespace call_detail { userdataref.push(); luaL_getmetatable(L, &usertype_traits::metatable[0]); - if (stack::get(L) == type::nil) { + if (type_of(L, -1) == type::nil) { lua_pop(L, 1); std::string err = "sol: unable to get usertype metatable for "; err += usertype_traits::name; diff --git a/sol/stack_check.hpp b/sol/stack_check.hpp index 7c1a7669..84404e1a 100644 --- a/sol/stack_check.hpp +++ b/sol/stack_check.hpp @@ -274,14 +274,14 @@ struct checker { bool success = true; #ifndef SOL_NO_EXCEPTIONS lua_getfield(L, -1, &detail::base_class_check_key()[0]); - if (stack::get(L) != type::nil) { + if (type_of(L, -1) != type::nil) { void* basecastdata = lua_touserdata(L, -1); detail::throw_cast basecast = (detail::throw_cast)basecastdata; success = detail::catch_check(basecast); } #elif !defined(SOL_NO_RTTI) lua_getfield(L, -1, &detail::base_class_check_key()[0]); - if (stack::get(L) != type::nil) { + if (type_of(L, -1) != type::nil) { void* basecastdata = lua_touserdata(L, -1); detail::inheritance_check_function ic = (detail::inheritance_check_function)basecastdata; success = ic(typeid(T)); @@ -289,7 +289,7 @@ struct checker { #else // Topkek lua_getfield(L, -1, &detail::base_class_check_key()[0]); - if (stack::get(L) != type::nil) { + if (type_of(L, -1) != type::nil) { void* basecastdata = lua_touserdata(L, -1); detail::inheritance_check_function ic = (detail::inheritance_check_function)basecastdata; success = ic(detail::id_for::value); diff --git a/sol/usertype_metatable.hpp b/sol/usertype_metatable.hpp index 33ca10b8..f0b1f1ec 100644 --- a/sol/usertype_metatable.hpp +++ b/sol/usertype_metatable.hpp @@ -115,7 +115,7 @@ namespace sol { template bool contains_index(std::index_sequence) const { bool idx = false; - detail::swallow{ 0, ((idx &= usertype_detail::is_indexer(std::get(functions))), 0) ... }; + (void)detail::swallow{ 0, ((idx &= usertype_detail::is_indexer(std::get(functions))), 0) ... }; return idx; }