From 6a3fe7adcc2a3855a574dbfc2bb79c86e7539f26 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 19 Mar 2014 12:38:00 -0700 Subject: Fixed bugs in patched tolua output --- lib/tolua++/src/bin/lua/declaration.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/tolua++/src/bin/lua/declaration.lua') diff --git a/lib/tolua++/src/bin/lua/declaration.lua b/lib/tolua++/src/bin/lua/declaration.lua index 73bbe910e..5a2adfed9 100644 --- a/lib/tolua++/src/bin/lua/declaration.lua +++ b/lib/tolua++/src/bin/lua/declaration.lua @@ -229,6 +229,8 @@ function classDeclaration:outchecktype (narg) --end elseif t then return '!tolua_is'..t..'(tolua_S,'..narg..','..def..',&tolua_err)' + elseif isenum(self.type) then + return '!tolua_is'..self.type..'(tolua_S,'..narg..','..def..',&tolua_err)' else local is_func = get_is_function(self.type) if self.ptr == '&' or self.ptr == '' then -- cgit v1.2.3 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/declaration.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/tolua++/src/bin/lua/declaration.lua') diff --git a/lib/tolua++/src/bin/lua/declaration.lua b/lib/tolua++/src/bin/lua/declaration.lua index 5a2adfed9..26ceeba22 100644 --- a/lib/tolua++/src/bin/lua/declaration.lua +++ b/lib/tolua++/src/bin/lua/declaration.lua @@ -227,10 +227,10 @@ function classDeclaration:outchecktype (narg) --else return '!tolua_istable(tolua_S,'..narg..',0,&tolua_err)' --end + elseif isenumtype(self.type) ~= nil then + return '!tolua_is'..self.type..'(tolua_S,'..narg..','..def..',&tolua_err)' elseif t then return '!tolua_is'..t..'(tolua_S,'..narg..','..def..',&tolua_err)' - elseif isenum(self.type) then - return '!tolua_is'..self.type..'(tolua_S,'..narg..','..def..',&tolua_err)' else local is_func = get_is_function(self.type) if self.ptr == '&' or self.ptr == '' then -- cgit v1.2.3