Small cleanup of ret_i and temp_i
@@ -402,13 +402,9 @@ function Coder:pallene_entry_point_declaration(f_id)
table.insert(args, {decl, comment})
end
for i = 2, #ret_types do
- local ret_i = i
- local decl, comment = self:ret_value_as_arg_declaration(ret_i,
- ret_types[i])
- if decl then
+ local decl, comment = self:ret_value_as_arg_declaration(i, ret_types[i])
table.insert(args, {decl, comment})
end
- end
local arg_lines = {}
for i, arg in ipairs(args) do
@@ -487,9 +483,9 @@ function Coder:call_pallene_function(dsts, f_id, base, xs)
if dsts[i] then
table.insert(args, "&"..dsts[i])
else
- local temp_i = i-1
- table.insert(temp_args, c_declaration(ret_types[i], "temp"..temp_i)..";")
- table.insert(args, "&temp"..temp_i)
+ local tmp = "temp"..i
+ table.insert(temp_args, c_declaration(ret_types[i], tmp)..";")
+ table.insert(args, "&"..tmp)
end
end
