eolian: generate correct const first param on methods where applicable

This commit is contained in:
Daniel Kolesa 2016-03-02 13:11:14 +00:00 committed by Tom Hacohen
parent 737a297a79
commit 8299be03f4
1 changed files with 4 additions and 3 deletions

View File

@ -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;