elua: generate property wrapper bodies with correct arguments in lualian
authorDaniel Kolesa <d.kolesa@samsung.com>
Fri, 17 Oct 2014 15:52:41 +0000 (16:52 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Fri, 17 Oct 2014 15:52:41 +0000 (16:52 +0100)
src/bin/elua/modules/lualian.lua

index af6808b..c28f349 100644 (file)
@@ -300,16 +300,14 @@ local Property = Method:clone {
 
         local fulln = proto.full_name
         if #keys > 0 then
-            local argn = (#keys > 1) and "keys" or "key"
             for i, v in ipairs(keys) do
                 local nm  = kw_t(v:name_get())
                 local tps = v:type_get()
                 local tp  = tps:c_type_get()
-                cargs [#cargs  + 1] = tp .. " " .. nm
-                vargs [#vargs  + 1] = typeconv(tps, argn .. "[" .. i
-                    .. "]", true)
+                args [#args  + 1] = nm
+                cargs[#cargs + 1] = tp .. " " .. nm
+                vargs[#vargs + 1] = typeconv(tps, nm, true)
             end
-            args[#args + 1] = argn
         end
         proto.kprop = #keys > 0
 
@@ -331,15 +329,13 @@ local Property = Method:clone {
                     end
                 end
             else
-                local argn = (#keys > 1) and "vals" or "val"
-                args[#args + 1] = argn
                 for i, v in ipairs(vals) do
                     local dir, tps, nm = v:direction_get(), v:type_get(),
                         kw_t(v:name_get())
                     local tp = tps:c_type_get()
+                    args [#args  + 1] = nm
                     cargs[#cargs + 1] = tp .. " " .. nm
-                    vargs[#vargs + 1] = typeconv(tps, argn .. "[" .. i .. "]",
-                        true)
+                    vargs[#vargs + 1] = typeconv(tps, nm, true)
                 end
             end
         end