mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-27 10:00:20 +01:00
do check of bad overloading
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
:: impl_definitions.lua for implementation function definitions
|
:: impl_definitions.lua for implementation function definitions
|
||||||
|
|
||||||
:: set your PATH if necessary for LuaJIT or Lua5.1 or luajit with: (for example)
|
:: set your PATH if necessary for LuaJIT or Lua5.1 or luajit with: (for example)
|
||||||
set PATH=%PATH%;C:\luaGL;C:\mingw32\bin;
|
:: set PATH=%PATH%;C:\luaGL;C:\mingw32\bin;
|
||||||
:: set PATH=%PATH%;C:\luaGL;C:\i686-7.2.0-release-posix-dwarf-rt_v5-rev1\mingw32\bin;
|
:: set PATH=%PATH%;C:\luaGL;C:\i686-7.2.0-release-posix-dwarf-rt_v5-rev1\mingw32\bin;
|
||||||
:: set PATH=%PATH%;C:\luaGL\sources\luajit-master\luajit-master\bin\mingw32;C:\mingw32\bin;
|
:: set PATH=%PATH%;C:\luaGL\sources\luajit-master\luajit-master\bin\mingw32;C:\mingw32\bin;
|
||||||
::process files
|
::process files
|
||||||
|
@@ -307,18 +307,18 @@ local function serializeTable(name, value, saved)
|
|||||||
for k,v in pairs(value) do
|
for k,v in pairs(value) do
|
||||||
table.insert(ordered_keys,k)
|
table.insert(ordered_keys,k)
|
||||||
end
|
end
|
||||||
local function sorter(a,b)
|
local function sorter(a,b)
|
||||||
if type(a)==type(b) then
|
if type(a)==type(b) then
|
||||||
return a<b
|
return a<b
|
||||||
elseif type(a)=="number" then
|
elseif type(a)=="number" then
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
assert(type(b)=="number")
|
assert(type(b)=="number")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.sort(ordered_keys,sorter)
|
table.sort(ordered_keys,sorter)
|
||||||
for _,k in ipairs(ordered_keys) do
|
for _,k in ipairs(ordered_keys) do
|
||||||
local v = value[k]
|
local v = value[k]
|
||||||
--]]
|
--]]
|
||||||
-- for k,v in pairs(value) do -- save its fields
|
-- for k,v in pairs(value) do -- save its fields
|
||||||
@@ -779,6 +779,16 @@ local function func_parser()
|
|||||||
table.insert(strt,string.format("%d\t%s\t%s %s",i,t.ret,t.ov_cimguiname,t.signature))
|
table.insert(strt,string.format("%d\t%s\t%s %s",i,t.ret,t.ov_cimguiname,t.signature))
|
||||||
--prtable(typesc[i])
|
--prtable(typesc[i])
|
||||||
end
|
end
|
||||||
|
--check not two names are equal (produced by bad cimguiname_overload)
|
||||||
|
for i=1,#v-1 do
|
||||||
|
for j=i+1,#v-1 do
|
||||||
|
if v[i].ov_cimguiname == v[j].ov_cimguiname then
|
||||||
|
local t,tj = v[i],v[j]
|
||||||
|
print("Error caused by Bad overloading "..t.ov_cimguiname.." of function ",t.funcname,t.signature,"conflicts with ",tj.funcname,tj.signature)
|
||||||
|
error("Bad overloading:"..t.ov_cimguiname)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--print(numoverloaded, "overloaded")
|
--print(numoverloaded, "overloaded")
|
||||||
@@ -1449,18 +1459,18 @@ local function DefsByStruct(FP)
|
|||||||
FP.defsBystruct = struct
|
FP.defsBystruct = struct
|
||||||
end
|
end
|
||||||
local function AdjustArguments(FP)
|
local function AdjustArguments(FP)
|
||||||
for fun,defs in pairs(FP.defsT) do
|
for fun,defs in pairs(FP.defsT) do
|
||||||
--struct function but no constructors
|
--struct function but no constructors
|
||||||
if defs[1].stname~="ImGui" and defs[1].stname~="" and defs[1].ret then
|
if defs[1].stname~="ImGui" and defs[1].stname~="" and defs[1].ret then
|
||||||
--print("adjusting",fun)
|
--print("adjusting",fun)
|
||||||
for i,def in ipairs(defs) do
|
for i,def in ipairs(defs) do
|
||||||
local empty = def.args:match("^%(%)") --no args
|
local empty = def.args:match("^%(%)") --no args
|
||||||
--local ptret = def.retref and "&" or ""
|
--local ptret = def.retref and "&" or ""
|
||||||
def.args = def.args:gsub("^%(","("..def.stname.."* self"..(empty and "" or ","))
|
def.args = def.args:gsub("^%(","("..def.stname.."* self"..(empty and "" or ","))
|
||||||
table.insert(def.argsT,1,{type=def.stname.."*",name="self"})
|
table.insert(def.argsT,1,{type=def.stname.."*",name="self"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--generate cimgui.cpp cimgui.h and auto versions depending on postfix
|
--generate cimgui.cpp cimgui.h and auto versions depending on postfix
|
||||||
local function cimgui_generation(postfix,STP,FP)
|
local function cimgui_generation(postfix,STP,FP)
|
||||||
|
Reference in New Issue
Block a user