From: Yossi Kantor Date: Thu, 3 Apr 2014 10:58:34 +0000 (+0300) Subject: Eolian: Legacy generator generates const return value for legacy header if needed X-Git-Tag: v1.10.0-alpha1~214 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bff7e65d24980c0e7697a059fb34df1925fed22a;p=platform%2Fupstream%2Fefl.git Eolian: Legacy generator generates const return value for legacy header if needed --- diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c index bae7fab..99575d4 100644 --- a/src/bin/eolian/legacy_generator.c +++ b/src/bin/eolian/legacy_generator.c @@ -40,6 +40,7 @@ _eapi_decl_func_generate(const char *classname, Eolian_Function funcid, Eolian_F const char *func_lpref = NULL; Eina_Bool var_as_ret = EINA_FALSE; Eina_Bool add_star = EINA_FALSE; + Eina_Bool ret_const = EINA_FALSE; char tmpstr[0xFF]; const Eina_List *l; void *data; @@ -64,6 +65,7 @@ _eapi_decl_func_generate(const char *classname, Eolian_Function funcid, Eolian_F data = eina_list_data_get(l); eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &rettype, NULL, NULL); var_as_ret = EINA_TRUE; + ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE); } } } @@ -169,7 +171,8 @@ _eapi_decl_func_generate(const char *classname, Eolian_Function funcid, Eolian_F eina_strbuf_replace_all(fbody, "@#params", eina_strbuf_string_get(fparam)); eina_strbuf_replace_all(fbody, "@#list_desc_param", eina_strbuf_string_get(descparam)); eina_strbuf_reset(fparam); - eina_strbuf_append_printf(fparam, "%s%s", + eina_strbuf_append_printf(fparam, "%s%s%s", + ret_const ? "const " : "", rettype ? rettype : "void", rettype && strchr(rettype, '*')?"":" "); eina_strbuf_replace_all(fbody, "@#type_return", eina_strbuf_string_get(fparam));