summaryrefslogtreecommitdiff
path: root/src/bin/eolian/eo1_generator.c
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-03-09 12:08:23 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-03-09 13:19:30 +0200
commit4be9526cc212bec3cdf7a708ee8d576c3d09e8a7 (patch)
tree1aedc05abe7c299873d7c82dc3c040bac5a4c0c3 /src/bin/eolian/eo1_generator.c
parentb013815bfd61b1f1fca6fa1abf02c918fb2e2be8 (diff)
Eolian/Generator: more fixes related to stars to add to params.
Diffstat (limited to 'src/bin/eolian/eo1_generator.c')
-rw-r--r--src/bin/eolian/eo1_generator.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bin/eolian/eo1_generator.c b/src/bin/eolian/eo1_generator.c
index af1e4ecb27..6938ee294d 100644
--- a/src/bin/eolian/eo1_generator.c
+++ b/src/bin/eolian/eo1_generator.c
@@ -102,7 +102,7 @@ tmpl_eo_funcdef[] = "\n\
102@#list_desc_param\ 102@#list_desc_param\
103 *\n\ 103 *\n\
104 */\n\ 104 */\n\
105#define @#eoprefix_@#func(@#list_param) @#OBJCLASS_ID(@#OBJCLASS_SUB_ID_@#FUNC) @#list_typecheck\n\ 105#define @#eoprefix_@#func(@#list_param) @#OBJCLASS_ID(@#OBJCLASS_SUB_ID_@#FUNC)@#list_typecheck\n\
106"; 106";
107 107
108static const char 108static const char
@@ -195,6 +195,7 @@ eo1_fundef_generate(const char *classname, Eolian_Function func, Eolian_Function
195 pdir = EOLIAN_OUT_PARAM; 195 pdir = EOLIAN_OUT_PARAM;
196 } 196 }
197 if (ftype == SET) pdir = EOLIAN_IN_PARAM; 197 if (ftype == SET) pdir = EOLIAN_IN_PARAM;
198 if (ftype == UNRESOLVED || ftype == METHOD_FUNC) add_star = (pdir == EOLIAN_OUT_PARAM);
198 Eina_Bool had_star = !!strchr(ptype, '*'); 199 Eina_Bool had_star = !!strchr(ptype, '*');
199 200
200 const char *dir_str = str_dir[(int)pdir]; 201 const char *dir_str = str_dir[(int)pdir];
@@ -212,7 +213,8 @@ eo1_fundef_generate(const char *classname, Eolian_Function func, Eolian_Function
212 { 213 {
213 const char *ret_desc = eolian_function_return_comment_get(func, ftype); 214 const char *ret_desc = eolian_function_return_comment_get(func, ftype);
214 eina_strbuf_append_printf(str_pardesc, tmpl_eo_pardesc, "out", "ret", ret_desc); 215 eina_strbuf_append_printf(str_pardesc, tmpl_eo_pardesc, "out", "ret", ret_desc);
215 eina_strbuf_append(str_par, ", ret"); 216 if (eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, ", ");
217 eina_strbuf_append(str_par, "ret");
216 Eina_Bool had_star = !!strchr(rettype, '*'); 218 Eina_Bool had_star = !!strchr(rettype, '*');
217 eina_strbuf_append_printf(str_typecheck, ", EO_TYPECHECK(%s%s*, ret)", rettype, had_star?"":" "); 219 eina_strbuf_append_printf(str_typecheck, ", EO_TYPECHECK(%s%s*, ret)", rettype, had_star?"":" ");
218 } 220 }
@@ -396,6 +398,7 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun
396 eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, NULL); 398 eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, NULL);
397 Eina_Bool is_const = eolian_parameter_get_const_attribute_get(data); 399 Eina_Bool is_const = eolian_parameter_get_const_attribute_get(data);
398 Eina_Bool had_star = !!strchr(ptype, '*'); 400 Eina_Bool had_star = !!strchr(ptype, '*');
401 if (ftype == UNRESOLVED || ftype == METHOD_FUNC) add_star = (pdir == EOLIAN_OUT_PARAM);
399 eina_strbuf_append_printf(va_args, " %s%s%s%s%s = va_arg(*list, %s%s%s%s);\n", 402 eina_strbuf_append_printf(va_args, " %s%s%s%s%s = va_arg(*list, %s%s%s%s);\n",
400 ftype == GET && is_const?"const ":"", ptype, had_star?"":" ", add_star?"*":"", pname, 403 ftype == GET && is_const?"const ":"", ptype, had_star?"":" ", add_star?"*":"", pname,
401 ftype == GET && is_const?"const ":"", add_star ? ptype : _varg_upgr(ptype), !had_star && add_star?" ":"", add_star?"*":""); 404 ftype == GET && is_const?"const ":"", add_star ? ptype : _varg_upgr(ptype), !had_star && add_star?" ":"", add_star?"*":"");