diff options
author | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2016-10-14 15:31:23 +0200 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2016-10-14 15:31:49 +0200 |
commit | 2515556673d9ce4bb811b60ce19eee03e8499d6b (patch) | |
tree | 14f0a75691209f1fc1d23c3088c711a78665ff1c | |
parent | 7af39bc4479650fbc705d57bba32826bfa2bb2ec (diff) | |
download | efl-2515556673d9ce4bb811b60ce19eee03e8499d6b.tar.gz |
eolian gen: better checks for whether to add space after type
-rw-r--r-- | src/bin/eolian/headers.c | 2 | ||||
-rw-r--r-- | src/bin/eolian/sources.c | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/bin/eolian/headers.c b/src/bin/eolian/headers.c index febc11a970..3a04572f53 100644 --- a/src/bin/eolian/headers.c +++ b/src/bin/eolian/headers.c @@ -131,7 +131,7 @@ _gen_func(const Eolian_Function *fid, Eolian_Function_Type ftype, if (!first) eina_strbuf_append(buf, ", "); eina_strbuf_append(buf, prtn); - if (!strchr(prtn, '*')) + if (prtn[strlen(prtn) - 1] != '*') eina_strbuf_append_char(buf, ' '); eina_strbuf_append(buf, _get_add_star(ftype, eolian_parameter_direction_get(pr))); diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c index 0b15d79ec1..698923825b 100644 --- a/src/bin/eolian/sources.c +++ b/src/bin/eolian/sources.c @@ -135,7 +135,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append_printf(params_full, ", %s", ptn); eina_strbuf_append_printf(params_full_imp, ", %s", ptn); - if (!strchr(ptn, '*')) + if (ptn[strlen(ptn) - 1] != '*') { eina_strbuf_append_char(params_full, ' '); eina_strbuf_append_char(params_full_imp, ' '); @@ -167,7 +167,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, const Eolian_Type *pt = eolian_parameter_type_get(pr); Eina_Stringshare *ptn = eolian_type_c_type_get(pt); - Eina_Bool had_star = !!strchr(ptn, '*'); + Eina_Bool had_star = ptn[strlen(ptn) - 1] == '*'; const char *add_star = _get_add_star(ftype, pd); if (eina_strbuf_length_get(params)) @@ -267,7 +267,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, { /* T _class_name[_orig_class]_func_name_suffix */ eina_strbuf_append(buf, rtpn); - if (!strchr(rtpn, '*')) + if (rtpn[strlen(rtpn) - 1] != '*') eina_strbuf_append_char(buf, ' '); eina_strbuf_append_char(buf, '_'); eina_strbuf_append(buf, cnamel); @@ -296,7 +296,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, /* generation of intermediate __eolian_... */ eina_strbuf_append(buf, "static "); eina_strbuf_append(buf, rtpn); - if (!strchr(rtpn, '*')) + if (rtpn[strlen(rtpn) - 1] != '*') eina_strbuf_append_char(buf, ' '); eina_strbuf_append(buf, "__eolian_"); eina_strbuf_append(buf, cnamel); @@ -794,7 +794,7 @@ _gen_params(const Eolian_Function *fid, Eolian_Function_Type ftype, eina_strbuf_append(params, prn); eina_strbuf_append_printf(params_full, ", %s", ptn); - if (!strchr(ptn, '*')) + if (ptn[strlen(ptn) - 1] != '*') eina_strbuf_append_char(params_full, ' '); eina_strbuf_append(params_full, prn); @@ -819,7 +819,7 @@ _gen_params(const Eolian_Function *fid, Eolian_Function_Type ftype, const Eolian_Type *pt = eolian_parameter_type_get(pr); Eina_Stringshare *ptn = eolian_type_c_type_get(pt); - Eina_Bool had_star = !!strchr(ptn, '*'); + Eina_Bool had_star = ptn[strlen(ptn) - 1] == '*'; const char *add_star = _get_add_star(ftype, pd); eina_strbuf_append(params, ", "); |