aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/eolian/legacy_generator.c
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-01 21:57:43 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-01 21:57:43 -0200
commitfa88a2337f4c1ed74dbe5f8e9b8ab9e80aa94215 (patch)
tree289d1f0e30abe7aeb9100ab9ed3e3a755d1c18b7 /src/bin/eolian/legacy_generator.c
parentEo do: use the __thread directive when available to manage call stack. (diff)
downloadefl-devs/felipealmeida/eo_optimisations.tar.gz
Eo: Partial implementation to remove eo_dodevs/felipealmeida/eo_optimisations
Diffstat (limited to 'src/bin/eolian/legacy_generator.c')
-rw-r--r--src/bin/eolian/legacy_generator.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c
index 18b4506ab2..d05122e546 100644
--- a/src/bin/eolian/legacy_generator.c
+++ b/src/bin/eolian/legacy_generator.c
@@ -24,7 +24,7 @@ EAPI @#ret_type\n\
@#eapi_func(@#full_params)\n\
{\n\
@#ret_type ret;\n\
- eo_do(@#eo_obj, ret = @#eo_func(@#eo_params));\n\
+ eo_do(@#eo_obj, ret = @#eo_func(@#eo_obj%s@#eo_params));\n\
return ret;\n\
}\n\
";
@@ -34,7 +34,7 @@ tmpl_eapi_body_void[] ="\
EAPI void\n\
@#eapi_func(@#full_params)\n\
{\n\
- eo_do(@#eo_obj, @#eo_func(@#eo_params));\n\
+ eo_do(@#eo_obj, @#eo_func(@#eo_obj%s@#eo_params));\n\
}\n\
";
@@ -229,10 +229,23 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
if (!rettype && rettypet) rettype = eolian_type_c_type_get(rettypet);
+ Eina_Bool has_params = EINA_FALSE;
+
+ itr = eolian_property_keys_get(funcid, ftype);
+ has_params |= (eina_iterator_next(itr, &data));
+ eina_iterator_free(itr);
+
+ if (!has_params && !var_as_ret)
+ {
+ itr = is_prop ? eolian_property_values_get(funcid, ftype) : eolian_function_parameters_get(funcid);
+ has_params |= (eina_iterator_next(itr, &data));
+ eina_iterator_free(itr);
+ }
+
if (rettype && (!ret_is_void))
- eina_strbuf_append(fbody, tmpl_eapi_body);
+ eina_strbuf_append_printf(fbody, tmpl_eapi_body, has_params?", ":"");
else
- eina_strbuf_append(fbody, tmpl_eapi_body_void);
+ eina_strbuf_append_printf(fbody, tmpl_eapi_body_void, has_params?", ":"");
if (!eolian_function_is_class(funcid))
{