From 8299be03f42d2c81499e3a4097984639fe29e7bd Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Wed, 2 Mar 2016 13:11:14 +0000 Subject: [PATCH] eolian: generate correct const first param on methods where applicable --- src/bin/eolian/eo_generator.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c index 1128e41..ea54b9a 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; -- 2.7.4