eolian: Fix promise generation with multiple parameters

When generating multiple parameters, they inadvertedly got
replaced by __eo_promise. Replacing all arguments to the
promise pointer.
This commit is contained in:
Felipe Magno de Almeida 2016-04-29 17:14:54 -03:00
parent 0c76f82a31
commit 46903d76f5
2 changed files with 15 additions and 5 deletions

View File

@ -383,6 +383,7 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
Eina_Bool had_star = !!strchr(ptype, '*');
if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM);
if (eina_strbuf_length_get(params)) eina_strbuf_append(params, ", ");
if(!has_promise && !strcmp(ptype, "Eina_Promise *") &&
(ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) && pdir == EOLIAN_INOUT_PARAM)
@ -396,18 +397,15 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
promise_value_type = eolian_type_c_type_get(subtype);
eina_strbuf_append_printf(impl_full_params, ", Eina_Promise_Owner *%s%s",
pname, is_empty && !dflt_value ?" EINA_UNUSED":"");
eina_strbuf_append_printf(params, "__eo_promise");
}
else
{
eina_strbuf_append_printf(impl_full_params, ", %s%s%s%s%s",
ptype, had_star?"":" ", add_star?"*":"", pname, is_empty && !dflt_value ?" EINA_UNUSED":"");
eina_strbuf_append_printf(params, "%s", pname);
}
if (eina_strbuf_length_get(params)) eina_strbuf_append(params, ", ");
if(has_promise)
eina_strbuf_append_printf(params, "%s", "__eo_promise");
else
eina_strbuf_append_printf(params, "%s", pname);
eina_strbuf_append_printf(full_params, ", %s%s%s%s%s",
ptype, had_star?"":" ", add_star?"*":"", pname, is_empty && !dflt_value ?" EINA_UNUSED":"");
if (is_auto)

View File

@ -7,6 +7,18 @@ class Generated_Promise (Eo.Base)
@inout promise1: promise<int>*;
}
}
method_multiple_args_1 {
params {
@inout promise1: promise<int>*;
@in data: void*;
}
}
method_multiple_args_2 {
params {
@in data: void*;
@inout promise1: promise<int>*;
}
}
method2 {
params {
@out promise1: promise<int>*;