summaryrefslogtreecommitdiff
path: root/src/bin/eolian/eo1_generator.c
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-03-27 15:16:32 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-03-27 15:19:22 +0200
commitfd25b44cab0e697ec109997be1e24c49e71cf265 (patch)
tree16fa1d514e3b6c65f5909eff299d314317281ec1 /src/bin/eolian/eo1_generator.c
parent23b0d4f14dcf0249115a6ffee1368fdd44377a8a (diff)
Eolian: extend const attributes for parameters to 'set' properties.
When const is used for parameters into 'set' properties, the generator doesn't prepend 'const'. This fixes this bad behavior.
Diffstat (limited to '')
-rw-r--r--src/bin/eolian/eo1_generator.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/bin/eolian/eo1_generator.c b/src/bin/eolian/eo1_generator.c
index 36cb4fb406..fa3804e8ac 100644
--- a/src/bin/eolian/eo1_generator.c
+++ b/src/bin/eolian/eo1_generator.c
@@ -196,7 +196,7 @@ eo1_fundef_generate(const char *classname, Eolian_Function func, Eolian_Function
196 Eina_Bool add_star = EINA_FALSE; 196 Eina_Bool add_star = EINA_FALSE;
197 Eolian_Parameter_Dir pdir; 197 Eolian_Parameter_Dir pdir;
198 eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, &pdesc); 198 eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, &pdesc);
199 Eina_Bool is_const = eolian_parameter_get_const_attribute_get(data); 199 Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == GET);
200 if (ftype == GET) { 200 if (ftype == GET) {
201 add_star = EINA_TRUE; 201 add_star = EINA_TRUE;
202 pdir = EOLIAN_OUT_PARAM; 202 pdir = EOLIAN_OUT_PARAM;
@@ -390,7 +390,7 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun
390 void* data = eina_list_data_get(l); 390 void* data = eina_list_data_get(l);
391 eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &rettype, &retname, NULL); 391 eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &rettype, &retname, NULL);
392 var_as_ret = EINA_TRUE; 392 var_as_ret = EINA_TRUE;
393 ret_const = eolian_parameter_get_const_attribute_get(data); 393 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
394 } 394 }
395 } 395 }
396 } 396 }
@@ -413,13 +413,13 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun
413 const char *pname; 413 const char *pname;
414 const char *ptype; 414 const char *ptype;
415 eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, NULL); 415 eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, NULL);
416 Eina_Bool is_const = eolian_parameter_get_const_attribute_get(data); 416 Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == GET);
417 eina_strbuf_append_printf(va_args, " %s%s %s = va_arg(*list, %s%s);\n", 417 eina_strbuf_append_printf(va_args, " %s%s %s = va_arg(*list, %s%s);\n",
418 ftype == GET && is_const?"const ":"", ptype, pname, 418 ftype == GET && is_const?"const ":"", ptype, pname,
419 ftype == GET && is_const?"const ":"", _varg_upgr(ptype)); 419 ftype == GET && is_const?"const ":"", _varg_upgr(ptype));
420 eina_strbuf_append_printf(params, ", %s", pname); 420 eina_strbuf_append_printf(params, ", %s", pname);
421 eina_strbuf_append_printf(full_params, ", %s%s %s", 421 eina_strbuf_append_printf(full_params, ", %s%s %s",
422 ftype == GET && eolian_parameter_get_const_attribute_get(data)?"const ":"", 422 ftype == GET && eolian_parameter_const_attribute_get(data, ftype == GET)?"const ":"",
423 ptype, pname); 423 ptype, pname);
424 } 424 }
425 if (!var_as_ret) 425 if (!var_as_ret)
@@ -430,15 +430,15 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun
430 const char *ptype; 430 const char *ptype;
431 Eolian_Parameter_Dir pdir; 431 Eolian_Parameter_Dir pdir;
432 eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, NULL); 432 eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, NULL);
433 Eina_Bool is_const = eolian_parameter_get_const_attribute_get(data); 433 Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == GET);
434 Eina_Bool had_star = !!strchr(ptype, '*'); 434 Eina_Bool had_star = !!strchr(ptype, '*');
435 if (ftype == UNRESOLVED || ftype == METHOD_FUNC) add_star = (pdir == EOLIAN_OUT_PARAM); 435 if (ftype == UNRESOLVED || ftype == METHOD_FUNC) add_star = (pdir == EOLIAN_OUT_PARAM);
436 eina_strbuf_append_printf(va_args, " %s%s%s%s%s = va_arg(*list, %s%s%s%s);\n", 436 eina_strbuf_append_printf(va_args, " %s%s%s%s%s = va_arg(*list, %s%s%s%s);\n",
437 ftype == GET && is_const?"const ":"", ptype, had_star?"":" ", add_star?"*":"", pname, 437 is_const?"const ":"", ptype, had_star?"":" ", add_star?"*":"", pname,
438 ftype == GET && is_const?"const ":"", add_star ? ptype : _varg_upgr(ptype), !had_star && add_star?" ":"", add_star?"*":""); 438 is_const?"const ":"", add_star ? ptype : _varg_upgr(ptype), !had_star && add_star?" ":"", add_star?"*":"");
439 eina_strbuf_append_printf(params, ", %s", pname); 439 eina_strbuf_append_printf(params, ", %s", pname);
440 eina_strbuf_append_printf(full_params, ", %s%s%s%s%s", 440 eina_strbuf_append_printf(full_params, ", %s%s%s%s%s",
441 ftype == GET && eolian_parameter_get_const_attribute_get(data)?"const ":"", 441 is_const?"const ":"",
442 ptype, had_star?"":" ", add_star?"*":"", pname); 442 ptype, had_star?"":" ", add_star?"*":"", pname);
443 } 443 }
444 } 444 }