From a66ceb92f7446501b78ad1686b40ed2abdd939c2 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sun, 8 Dec 2013 23:51:18 -0500 Subject: [PATCH] GCC is retarded. Well, mostly retarded, anyhow... --- sol/table.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sol/table.hpp b/sol/table.hpp index 0542a78b..c4e00ccd 100644 --- a/sol/table.hpp +++ b/sol/table.hpp @@ -27,7 +27,7 @@ #include #include #include - +#include namespace sol { namespace detail { @@ -121,10 +121,10 @@ private: return set_fx(std::true_type(), std::forward(key), std::forward(fx), std::forward(obj)); } - template - table& set_lvalue_fx(std::false_type, T&& key, TFx&& fx, TM& mem) { + template + table& set_lvalue_fx(std::false_type, T&& key, TFx&& fx, TObj&& obj) { typedef typename std::remove_pointer::type>::type clean_fx; - std::unique_ptr sptr(new explicit_lua_func(mem, std::forward(fx))); + std::unique_ptr sptr(new explicit_lua_func(std::forward( obj ), std::forward(fx))); return set_fx(std::forward(key), std::move(sptr)); } @@ -170,17 +170,17 @@ private: typedef typename std::decay::type ptr_fx; std::string fkey(key); ptr_fx target(std::forward(fx)); - void* userdata = static_cast(target); + void* userdata = reinterpret_cast(target); lua_CFunction freefunc = &static_lua_func::call; const char* freefuncname = fkey.c_str(); const luaL_Reg funcreg[ 2 ] = { { freefuncname, freefunc }, - { } + { nullptr, nullptr } }; push(); - stack::push(state(), target); + stack::push(state(), userdata); luaL_setfuncs(state(), funcreg, 1); lua_pop(state(), 1); @@ -199,12 +199,12 @@ private: hint->second.reset(luafunc.release()); } lua_func* target = hint->second.get(); - void* userdata = static_cast(target); + void* userdata = reinterpret_cast(target); lua_CFunction freefunc = &lua_func::call; const char* freefuncname = hint->first.c_str(); const luaL_Reg funcreg[ 2 ] = { { freefuncname, freefunc }, - { } + { nullptr, nullptr } }; push();