q66 pushed a commit to branch master.

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

commit b5042ff669f8e9512f966659ab135db5efcfa576
Author: Daniel Kolesa <d.kol...@osg.samsung.com>
Date:   Wed Nov 11 15:15:08 2015 +0000

    eo generator: better output whitespace handling with pointers
---
 src/bin/eolian/eo_generator.c               | 6 +++++-
 src/tests/eolian/data/class_simple_ref_eo.h | 2 +-
 src/tests/eolian/data/struct_ref.c          | 4 ++--
 src/tests/eolian/data/typedef_ref.c         | 2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 4adba4d..b761284 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -97,7 +97,7 @@ 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 %s(@#full_params);\n", 
func_env.lower_eo_func);
+   eina_strbuf_append_printf(str_func, "EOAPI 
@#rettype@#retspace%s(@#full_params);\n", func_env.lower_eo_func);
 
    if (scope == EOLIAN_SCOPE_PROTECTED)
       eina_strbuf_append_printf(str_func, "#endif\n");
@@ -154,6 +154,10 @@ eo_fundef_generate(const Eolian_Class *class, const 
Eolian_Function *func, Eolia
    if (rettypet) rettype = eolian_type_c_type_get(rettypet);
 
    eina_strbuf_replace_all(str_func, "@#rettype", rettype ? rettype : "void");
+   if (!rettype || rettype[strlen(rettype) - 1] != '*')
+     eina_strbuf_replace_all(str_func, "@#retspace", " ");
+   else
+     eina_strbuf_replace_all(str_func, "@#retspace", "");
 
    eina_strbuf_replace_all(str_func, "@#list_param", 
eina_strbuf_string_get(str_par));
    if (!eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, "void");
diff --git a/src/tests/eolian/data/class_simple_ref_eo.h 
b/src/tests/eolian/data/class_simple_ref_eo.h
index 727c881..83f401e 100644
--- a/src/tests/eolian/data/class_simple_ref_eo.h
+++ b/src/tests/eolian/data/class_simple_ref_eo.h
@@ -60,7 +60,7 @@ EOAPI void evas_obj_simple_b_set(void);
  *
  * @ingroup Class_Simple
  */
-EOAPI char * evas_obj_simple_foo(int a, char *b, double *c);
+EOAPI char *evas_obj_simple_foo(int a, char *b, double *c);
 #endif
 
 EOAPI int evas_obj_simple_bar(int x);
diff --git a/src/tests/eolian/data/struct_ref.c 
b/src/tests/eolian/data/struct_ref.c
index 9fdecb2..a754e92 100644
--- a/src/tests/eolian/data/struct_ref.c
+++ b/src/tests/eolian/data/struct_ref.c
@@ -37,9 +37,9 @@ EAPI const Eo_Class *struct_class_get(void) EINA_CONST;
  *
  * @ingroup Struct
  */
-EOAPI char * struct_foo(int idx);
+EOAPI char *struct_foo(int idx);
 
-EOAPI Named * struct_bar(void);
+EOAPI Named *struct_bar(void);
 
 
 #endif
diff --git a/src/tests/eolian/data/typedef_ref.c 
b/src/tests/eolian/data/typedef_ref.c
index 9ab6954..e4b6993 100644
--- a/src/tests/eolian/data/typedef_ref.c
+++ b/src/tests/eolian/data/typedef_ref.c
@@ -37,7 +37,7 @@ typedef enum
 
 EAPI const Eo_Class *typedef_class_get(void) EINA_CONST;
 
-EOAPI char * typedef_foo(int idx);
+EOAPI char *typedef_foo(int idx);
 
 
 #endif

-- 


Reply via email to