From a69a1ef0325c5e472f1dd736f3a14a260d747ad9 Mon Sep 17 00:00:00 2001 From: Tycho Date: Thu, 20 Mar 2014 13:23:15 -0700 Subject: Fixed enum checking functions not being called in generated code --- lib/tolua++/src/bin/lua/enumerate.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/tolua++/src/bin/lua/enumerate.lua') diff --git a/lib/tolua++/src/bin/lua/enumerate.lua b/lib/tolua++/src/bin/lua/enumerate.lua index ef3a9574c..09b22a094 100644 --- a/lib/tolua++/src/bin/lua/enumerate.lua +++ b/lib/tolua++/src/bin/lua/enumerate.lua @@ -49,7 +49,7 @@ function classEnumerate:print (ident,close) end function emitenumprototype(type) - output("int tolua_is" .. string.gsub(type,"::","_") .. " (lua_State* L, int lo, const char * type, int def, tolua_Error* err);") + output("int tolua_is" .. string.gsub(type,"::","_") .. " (lua_State* L, int lo, int def, tolua_Error* err);") end _global_output_enums = {} @@ -58,7 +58,7 @@ _global_output_enums = {} function classEnumerate:supcode () if _global_output_enums[self.name] == nil then _global_output_enums[self.name] = 1 - output("int tolua_is" .. string.gsub(self.name,"::","_") .. " (lua_State* L, int lo, const char * type, int def, tolua_Error* err)") + output("int tolua_is" .. string.gsub(self.name,"::","_") .. " (lua_State* L, int lo, int def, tolua_Error* err)") output("{") output("if (!tolua_isnumber(L,lo,def,err)) return 0;") output("lua_Number val = tolua_tonumber(L,lo,def);") @@ -134,7 +134,7 @@ function Enumerate (n,b,varname) e.min = min e.max = max if n ~= "" then - _enums[n] = 1 + _enums[n] = true Typedef("int "..n) end return _Enumerate(e, varname) -- cgit v1.2.3