jackdanielz pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=bff7e65d24980c0e7697a059fb34df1925fed22a

commit bff7e65d24980c0e7697a059fb34df1925fed22a
Author: Yossi Kantor <[email protected]>
Date:   Thu Apr 3 13:58:34 2014 +0300

    Eolian: Legacy generator generates const return value for legacy header if 
needed
---
 src/bin/eolian/legacy_generator.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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

-- 


Reply via email to