diff options
author | Daniel Kolesa <d.kolesa@samsung.com> | 2014-11-19 11:40:49 +0000 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@samsung.com> | 2014-11-19 11:40:49 +0000 |
commit | b1009770ef8e71e2787d59b2fad9be4b105f82cf (patch) | |
tree | 5d1b9b6b0353ae2f06f1f8b1032e4bedd7d46212 | |
parent | f902de616e948b7ab5e88b9547b8302d2bb131a1 (diff) | |
download | efl-b1009770ef8e71e2787d59b2fad9be4b105f82cf.tar.gz |
elua: simplify lualian typeconv
-rw-r--r-- | src/bin/elua/modules/lualian.lua | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/src/bin/elua/modules/lualian.lua b/src/bin/elua/modules/lualian.lua index c28f3496cd..ccf30dff34 100644 --- a/src/bin/elua/modules/lualian.lua +++ b/src/bin/elua/modules/lualian.lua @@ -80,50 +80,26 @@ local build_calln = function(tps, expr, isin) return expr end -local typeconv_in = function(tps, expr) - if tps:type_get() == eolian.type_type.POINTER then - local base = tps:base_type_get() - local f = known_ptr_in[base:c_type_get()] - if f then return f(expr) end - return build_calln(tps, expr, true) - end - - local tp = tps:name_get() - - if is_num(tp) then return expr end - - local f = known_in[tp] - if f then - return f(expr) - end - - return build_calln(tps, expr, true) -end - local typeconv = function(tps, expr, isin) - if isin then - return typeconv_in(tps, expr) - end - if tps:type_get() == eolian.type_type.POINTER then local base = tps:base_type_get() - local f = known_ptr_out[base:c_type_get()] + local f = (isin and known_ptr_in or known_ptr_out)[base:c_type_get()] if f then return f(expr) end - return build_calln(tps, expr, false) + return build_calln(tps, expr, isin) end local tp = tps:name_get() if is_num(tp) then - return ("tonumber(%s)"):format(expr) + return isin and expr or ("tonumber(%s)"):format(expr) end - local f = known_out[tp] + local f = (isin and known_in or known_out)[tp] if f then return f(expr) end - return build_calln(tps, expr, false) + return build_calln(tps, expr, isin) end local Node = util.Object:clone { |