From: John L. <jr...@us...> - 2009-03-24 04:15:42
|
Update of /cvsroot/wxlua/wxLua/bindings In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10993/wxLua/bindings Modified Files: genwxbind.lua Log Message: Fixed double -> unsigned integer using all 32 bits conversion for wxSTC_MASK_FOLDERS problem, thanks to Andre Arpin. Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.176 retrieving revision 1.177 diff -C2 -d -r1.176 -r1.177 *** genwxbind.lua 31 Oct 2008 05:25:08 -0000 1.176 --- genwxbind.lua 24 Mar 2009 04:15:04 -0000 1.177 *************** *** 18,22 **** -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 24 -- Used to verify that the bindings are updated -- This must match modules/wxlua/include/wxldefs.h -- otherwise a compile time error will be generated. --- 18,22 ---- -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 25 -- Used to verify that the bindings are updated -- This must match modules/wxlua/include/wxldefs.h -- otherwise a compile time error will be generated. *************** *** 33,36 **** --- 33,38 ---- dataTypeTable = {} -- all datatypes; int, double, class names, see AllocDataType dataTypeAttribTable = {} -- attributes for data types; unsigned, const + dataTypeUIntTable = {} -- datatypes that are unsigned numbers + dataTypeBoolTable = {} -- datatypes that are boolean functionAttribTable = {} -- attributes for functions; static, virtual *************** *** 188,191 **** --- 190,194 ---- -- Allocate a data type description table (int, double, class...) to dataTypeTable -- --------------------------------------------------------------------------- + function AllocDataType(name, value_type, is_number, abstract) dataTypeTable[name] = *************** *** 218,228 **** AllocDataType("time_t", "number", true) AllocDataType("unsigned char", "number", true) AllocDataType("unsigned int", "number", true) AllocDataType("unsigned long", "number", true) - AllocDataType("unsigned short", "number", true) AllocDataType("uchar", "number", true) AllocDataType("uint", "number", true) AllocDataType("ulong", "number", true) - AllocDataType("ushort", "number", true) AllocDataType("void", "number", true) AllocDataType("wchar_t", "number", true) --- 221,231 ---- AllocDataType("time_t", "number", true) AllocDataType("unsigned char", "number", true) + AllocDataType("unsigned short", "number", true) AllocDataType("unsigned int", "number", true) AllocDataType("unsigned long", "number", true) AllocDataType("uchar", "number", true) + AllocDataType("ushort", "number", true) AllocDataType("uint", "number", true) AllocDataType("ulong", "number", true) AllocDataType("void", "number", true) AllocDataType("wchar_t", "number", true) *************** *** 282,285 **** --- 285,312 ---- dataTypeAttribTable["%ungc"] = true -- this object won't be gc by Lua + -- datatypes that are unsigned integers to be treated differently + dataTypeUIntTable["size_t"] = true + dataTypeUIntTable["time_t"] = true + dataTypeUIntTable["unsigned char"] = true + dataTypeUIntTable["unsigned short"] = true + dataTypeUIntTable["unsigned int"] = true + dataTypeUIntTable["unsigned long"] = true + dataTypeUIntTable["uchar"] = true + dataTypeUIntTable["ushort"] = true + dataTypeUIntTable["uint"] = true + dataTypeUIntTable["ulong"] = true + dataTypeUIntTable["void"] = true + + dataTypeUIntTable["wxUint8"] = true + dataTypeUIntTable["wxUint16"] = true + dataTypeUIntTable["wxUint32"] = true + dataTypeUIntTable["wxUint64"] = true + dataTypeUIntTable["wxMemorySize"] = true + dataTypeUIntTable["wxFileOffset"] = true + + -- datatypes that are boolean integers to be treated differently + dataTypeBoolTable["bool"] = true + dataTypeBoolTable["BOOL"] = true + -- attributes that can precede a function (must set equal to true) functionAttribTable["static"] = true *************** *** 483,486 **** --- 510,527 ---- -- --------------------------------------------------------------------------- + -- Is this data type an unsigned integer + -- --------------------------------------------------------------------------- + function IsDataTypeUInt(datatype) + local dtype = GetDataTypedefBase(datatype) + if dtype then + return dataTypeUIntTable[dtype.Name] or false + else + print("ERROR: Missing data type '"..tostring(datatype).."' in IsDataTypeUInt.") + end + + return false + end + + -- --------------------------------------------------------------------------- -- Is this data type an enum -- --------------------------------------------------------------------------- *************** *** 497,500 **** --- 538,555 ---- -- --------------------------------------------------------------------------- + -- Is this data type a boolean + -- --------------------------------------------------------------------------- + function IsDataTypeBool(datatype) + local dtype = GetDataTypedefBase(datatype) + if dtype then + return dataTypeBoolTable[dtype.Name] or false + else + print("ERROR: Missing data type '"..tostring(datatype).."' in IsDataTypeBool.") + end + + return false + end + + -- --------------------------------------------------------------------------- -- Is the input in the 'bindingDelimiters' table? -- --------------------------------------------------------------------------- *************** *** 2909,2913 **** table.insert(codeList, " wxluaT_pushuserdatatype(L, "..self_name..member.Name..", wxluatype_"..MakeClassVar(memberType)..");\n") ! elseif (memberType == "BOOL") or (memberType == "bool") then CommentBindingTable(codeList, " // push the result flag\n") table.insert(codeList, " lua_pushboolean(L, "..self_name..member.Name..");\n") --- 2964,2968 ---- table.insert(codeList, " wxluaT_pushuserdatatype(L, "..self_name..member.Name..", wxluatype_"..MakeClassVar(memberType)..");\n") ! elseif IsDataTypeBool(memberType) then CommentBindingTable(codeList, " // push the result flag\n") table.insert(codeList, " lua_pushboolean(L, "..self_name..member.Name..");\n") *************** *** 2994,2998 **** CommentBindingTable(codeList, " // get the data type value\n") table.insert(codeList, " "..memberType.."* val = ("..memberType.."*)wxluaT_getuserdatatype(L, "..stack_idx..", wxluatype_"..MakeClassVar(memberType)..");\n") ! elseif (memberType == "BOOL") or (memberType == "bool") then overload_argList = overload_argList.."&wxluatype_TBOOLEAN, " CommentBindingTable(codeList, " // get the boolean value\n") --- 3049,3053 ---- CommentBindingTable(codeList, " // get the data type value\n") table.insert(codeList, " "..memberType.."* val = ("..memberType.."*)wxluaT_getuserdatatype(L, "..stack_idx..", wxluatype_"..MakeClassVar(memberType)..");\n") ! elseif IsDataTypeBool(memberType) then overload_argList = overload_argList.."&wxluatype_TBOOLEAN, " CommentBindingTable(codeList, " // get the boolean value\n") *************** *** 3000,3005 **** elseif IsDataTypeEnum(memberType) then overload_argList = overload_argList.."&wxluatype_TINTEGER, " ! CommentBindingTable(codeList, " // get the number value\n") ! table.insert(codeList, " "..memberType.." val = ("..memberType..")wxlua_getintegertype(L, "..stack_idx..");\n") else overload_argList = overload_argList.."&wxluatype_TNUMBER, " --- 3055,3064 ---- elseif IsDataTypeEnum(memberType) then overload_argList = overload_argList.."&wxluatype_TINTEGER, " ! CommentBindingTable(codeList, " // get the enum value\n") ! table.insert(codeList, " "..memberType.." val = ("..memberType..")wxlua_getenumtype(L, "..stack_idx..");\n") ! elseif IsDataTypeUInt(memberType) then ! overload_argList = overload_argList.."&wxluatype_TINTEGER, " ! CommentBindingTable(codeList, " // get the unsigned integer value\n") ! table.insert(codeList, " "..memberType.." val = ("..memberType..")wxlua_getuintegertype(L, "..stack_idx..");\n") else overload_argList = overload_argList.."&wxluatype_TNUMBER, " *************** *** 3476,3485 **** end end ! elseif (argType == "bool") or (argType == "BOOL") then overload_argList = overload_argList.."&wxluatype_TBOOLEAN, " argItem = "wxlua_getbooleantype(L, "..argNum..")" elseif IsDataTypeEnum(argType) then overload_argList = overload_argList.."&wxluatype_TINTEGER, " ! argItem = "("..argType..")wxlua_getintegertype(L, "..argNum..")" elseif not numeric then overload_argList = overload_argList.."&wxluatype_"..MakeClassVar(argType)..", " --- 3535,3547 ---- end end ! elseif IsDataTypeBool(argType) then overload_argList = overload_argList.."&wxluatype_TBOOLEAN, " argItem = "wxlua_getbooleantype(L, "..argNum..")" elseif IsDataTypeEnum(argType) then overload_argList = overload_argList.."&wxluatype_TINTEGER, " ! argItem = "("..argType..")wxlua_getenumtype(L, "..argNum..")" ! elseif IsDataTypeUInt(argType) then ! overload_argList = overload_argList.."&wxluatype_TINTEGER, " ! argItem = "("..argType..")wxlua_getuintegertype(L, "..argNum..")" elseif not numeric then overload_argList = overload_argList.."&wxluatype_"..MakeClassVar(argType)..", " *************** *** 3869,3873 **** CommentBindingTable(codeList, " // push the result datatype\n") table.insert(codeList, " wxluaT_pushuserdatatype(L, returns, wxluatype_"..MakeClassVar(memberType)..");\n") ! elseif (member.DataType == "BOOL") or (member.DataType == "bool") then CommentBindingTable(codeList, " // push the result flag\n") table.insert(codeList, " lua_pushboolean(L, returns);\n") --- 3931,3935 ---- CommentBindingTable(codeList, " // push the result datatype\n") table.insert(codeList, " wxluaT_pushuserdatatype(L, returns, wxluatype_"..MakeClassVar(memberType)..");\n") ! elseif IsDataTypeBool(member.DataType) then CommentBindingTable(codeList, " // push the result flag\n") table.insert(codeList, " lua_pushboolean(L, returns);\n") |