From fd67c1692c9385c4edbc314d2edc12c13cf9e429 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Tue, 11 Mar 2014 15:17:12 +0200 Subject: Eolian/Generator: fix generation for return values. - Remove space between type and variable if a star is present. - Initialize return value to NULL before eo_do. It is needed in case the eo_do invocation fails (NULL object...). - Add const to the internal return value if needed. --- src/bin/eolian/eo1_generator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bin/eolian/eo1_generator.c') diff --git a/src/bin/eolian/eo1_generator.c b/src/bin/eolian/eo1_generator.c index 0b02d5b758..7ca7628411 100644 --- a/src/bin/eolian/eo1_generator.c +++ b/src/bin/eolian/eo1_generator.c @@ -431,7 +431,7 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun ret_const?"const ":"", rettype, had_star?"":" "); Eina_Strbuf *ret_param = eina_strbuf_new(); - if (rettype) eina_strbuf_append_printf(ret_param, "%s _%s = ", rettype, retname); + if (rettype) eina_strbuf_append_printf(ret_param, "%s%s%s_%s = ", ret_const?"const ":"", rettype, had_star?"":" ", retname); eina_strbuf_replace_all(fbody, "@#ret_param", eina_strbuf_string_get(ret_param)); sprintf(tmpstr, "%s%s", ret_const?"const ":"", rettype); eina_strbuf_replace_all(fbody, "@#ret_type", tmpstr); -- cgit v1.2.1