diff options
author | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2016-04-14 13:22:35 +0100 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2016-05-12 11:59:08 +0100 |
commit | 2d48278c49594a97c6c06cb5b7eeff4ed326bbe4 (patch) | |
tree | e837ec8578a9901823c5bec1bbe0655018f2b33e | |
parent | c338ff0fcaf3984e130913c36d4be3d98a532490 (diff) | |
download | efl-2d48278c49594a97c6c06cb5b7eeff4ed326bbe4.tar.gz |
docgen: properly const the first argument in C sig where needed
-rw-r--r-- | gendoc.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gendoc.lua b/gendoc.lua index 513e39d7fc..7ead430e7e 100644 --- a/gendoc.lua +++ b/gendoc.lua @@ -550,13 +550,18 @@ local gen_func_csig = function(f, ftype) local cn = f:full_c_name_get(ftype) local rtype = f:return_type_get(ftype) + local fparam = "Eo *obj" + if f:is_const() or f:is_class() or ftype == eolian.function_type.PROP_GET then + fparam = "const Eo *obj" + end + if f:type_get() == eolian.function_type.METHOD then local pars = f:parameters_get():to_array() local cnrt = rtype and rtype:c_type_named_get(cn) or ("void " .. cn) for i = 1, #pars do pars[i] = gen_cparam(pars[i]) end - table.insert(pars, 1, "Eo *obj"); + table.insert(pars, 1, fparam); return cnrt .. "(" .. table.concat(pars, ", ") .. ");" end @@ -572,7 +577,7 @@ local gen_func_csig = function(f, ftype) for i, par in ipairs(vals) do pars[#pars + 1] = gen_cparam(par) end - table.insert(pars, 1, "Eo *obj"); + table.insert(pars, 1, fparam); return cnrt .. "(" .. table.concat(pars, ", ") .. ");" end @@ -595,7 +600,7 @@ local gen_func_csig = function(f, ftype) for i, par in ipairs(vals) do pars[#pars + 1] = gen_cparam(par, true) end - table.insert(pars, 1, "Eo *obj"); + table.insert(pars, 1, fparam); return cnrt .. "(" .. table.concat(pars, ", ") .. ");" end |