summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-03-02 13:11:14 +0000
committerTom Hacohen <tom@stosb.com>2016-03-03 09:53:23 +0000
commit8299be03f42d2c81499e3a4097984639fe29e7bd (patch)
treef100e2b0f0e765c4a60a8942937d7d4913f20ce5
parent737a297a79a5046fd4ff79679da395fb79dd3a1f (diff)
downloadefl-8299be03f42d2c81499e3a4097984639fe29e7bd.tar.gz
eolian: generate correct const first param on methods where applicable
-rw-r--r--src/bin/eolian/eo_generator.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 1128e414d2..ea54b9a3f8 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -97,7 +97,8 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
eina_strbuf_append_char(str_func, '\n');
eina_strbuf_free(dbuf);
}
- eina_strbuf_append_printf(str_func, "EOAPI @#rettype@#retspace%s(Eo *obj@#full_params);\n", func_env.lower_eo_func);
+ eina_strbuf_append_printf(str_func, "EOAPI @#rettype@#retspace%s(%sEo *obj@#full_params);\n",
+ func_env.lower_eo_func, (ftype == EOLIAN_PROP_GET || eolian_function_object_is_const(func))?"const ":"");
if (scope == EOLIAN_SCOPE_PROTECTED)
eina_strbuf_append_printf(str_func, "#endif\n");
@@ -507,9 +508,9 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
Eina_Bool ret_is_void = (!rettype || !strcmp(rettype, "void"));
_class_func_env_create(class, eolian_function_name_get(funcid), ftype, &func_env);
eina_strbuf_append_printf(eo_func_decl,
- "EOAPI EO_%sFUNC_BODY%s(%s",
+ "EOAPI EO_%sFUNC_BODY%s%s(%s",
ret_is_void?"VOID_":"", has_params?"V":"",
- func_env.lower_eo_func);
+ (ftype == EOLIAN_PROP_GET || eolian_function_object_is_const(funcid))?"_CONST":"", func_env.lower_eo_func);
if (!ret_is_void)
{
const char *val_str = NULL;