eolian/generator: add asterisk on inout too

This commit is contained in:
Daniel Kolesa 2014-07-08 14:15:36 +01:00
parent ae5a5b3b96
commit 53fb9515e9
8 changed files with 12 additions and 12 deletions

View File

@ -187,7 +187,7 @@ eo_fundef_generate(const Eolian_Class class, Eolian_Function func, Eolian_Functi
pdir = EOLIAN_OUT_PARAM;
}
if (ftype == EOLIAN_PROP_SET) pdir = EOLIAN_IN_PARAM;
if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM);
if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM);
Eina_Bool had_star = !!strchr(ptype, '*');
const char *dir_str = str_dir[(int)pdir];
@ -402,7 +402,7 @@ eo_bind_func_generate(const Eolian_Class class, Eolian_Function funcid, Eolian_F
Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET);
Eina_Bool had_star = !!strchr(ptype, '*');
if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM);
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, ", ");
eina_strbuf_append_printf(params, "%s", pname);
eina_strbuf_append_printf(full_params, ", %s%s%s%s%s",

View File

@ -48,7 +48,7 @@ _params_generate(Eolian_Function foo, Eolian_Function_Type ftype, Eina_Bool var_
ptype = eolian_type_c_type_get(ptypet);
Eina_Bool is_const = eolian_parameter_const_attribute_get(param, ftype == EOLIAN_PROP_GET);
Eina_Bool had_star = !!strchr(ptype, '*');
if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM);
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, ", ");

View File

@ -142,7 +142,7 @@ _eapi_decl_func_generate(Eolian_Class class, Eolian_Function funcid, Eolian_Func
eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptypet, &pname, &pdesc);
ptype = eolian_type_c_type_get(ptypet);
Eina_Bool had_star = !!strchr(ptype, '*');
if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM);
if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM);
if (ftype == EOLIAN_PROP_GET) pdir = EOLIAN_OUT_PARAM;
if (ftype == EOLIAN_PROP_SET) pdir = EOLIAN_IN_PARAM;
leg_param_idx++;
@ -277,7 +277,7 @@ _eapi_func_generate(const Eolian_Class class, Eolian_Function funcid, Eolian_Fun
eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptypet, &pname, NULL);
ptype = eolian_type_c_type_get(ptypet);
Eina_Bool had_star = !!strchr(ptype, '*');
if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM);
if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM);
eina_strbuf_append_printf(fparam, ", %s%s%s%s%s",
eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const ":"",
ptype, had_star?"":" ", add_star?"*":"", pname);

View File

@ -71,7 +71,7 @@ Prevents event callbacks from being called for the object. */
wref_del {
/*@ Delete the weak reference passed. */
params {
@inout Eo** wref;
@inout Eo* wref;
}
}
destructor {
@ -128,7 +128,7 @@ callbacks of the same priority are called in reverse order of creation. */
/*@ Add a new weak reference to obj.
This function registers the object handle pointed by wref to obj so when obj is deleted it'll be updated to NULL. This functions should be used when you want to keep track of an object in a safe way, but you don't want to prevent it from being freed. */
params {
@inout Eo** wref;
@inout Eo* wref;
}
}
dbg_info_get {

View File

@ -22,7 +22,7 @@ class Simple {
/*@ comment foo */
params {
@in int a; /*@ a */
@inout char *b;
@inout char b;
@out double c;
}
return char *(NULL); /*@ comment for method return */

View File

@ -18,7 +18,7 @@ class Const {
/*@ comment foo */
params {
@in int a; /*@ a */
@inout char *b;
@inout char b;
@out double c;
}
const;

View File

@ -40,7 +40,7 @@ class Object (Base) {
/*@ comment foo */
params {
@in int a; /*@ a */
@inout char *b;
@inout char b;
@out double c;
}
return char *(NULL); /*@ comment for method return */

View File

@ -463,8 +463,8 @@ START_TEST(eolian_simple_parsing)
fail_if(!(param = eina_list_nth(list, 1)));
eolian_parameter_information_get(param, &dir, &ptypep, &pname, &string);
fail_if(dir != EOLIAN_INOUT_PARAM);
ptype = eolian_type_c_type_get(ptypep);
fail_if(strcmp(ptype, "char *"));
ptype = eolian_type_name_get(ptypep);
fail_if(strcmp(ptype, "char"));
eina_stringshare_del(ptype);
fail_if(strcmp(pname, "b"));
fail_if(string);