q66 pushed a commit to branch master.

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

commit 8dc8d6873d6a5807239e5d9434635b0d216508de
Author: Daniel Kolesa <d.kol...@osg.samsung.com>
Date:   Fri May 29 16:44:10 2015 +0100

    eolian/generator: clean up comment gen
---
 src/bin/eolian/eo_generator.c                   | 14 ++++----------
 src/bin/eolian/legacy_generator.c               |  6 ++++--
 src/tests/eolian/data/class_simple_ref_eo.h     | 12 ------------
 src/tests/eolian/data/class_simple_ref_legacy.h |  7 -------
 src/tests/eolian/data/struct_ref.c              |  2 --
 src/tests/eolian/data/typedef_ref.c             |  2 --
 6 files changed, 8 insertions(+), 35 deletions(-)

diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 6f86a3c..cb8a612 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -61,12 +61,8 @@ EAPI const Eo_Class *@#klasstype_get(void) EINA_CONST;\n\
 static const char
 tmpl_eo_funcdef_doxygen[] = "\
 /**\n\
- *\n\
 @#desc\n\
- *\n\
 @#list_desc_param\
-@#ret_desc\
- *\n\
  */\n";
 
 static const char
@@ -142,8 +138,6 @@ eo_fundef_generate(const Eolian_Class *class, const 
Eolian_Function *func, Eolia
 
    Eina_Strbuf *str_par = eina_strbuf_new();
    Eina_Strbuf *str_pardesc = eina_strbuf_new();
-   Eina_Strbuf *str_retdesc = eina_strbuf_new();
-   Eina_Strbuf *str_typecheck = eina_strbuf_new();
 
    itr = eolian_property_keys_get(func, ftype);
    EINA_ITERATOR_FOREACH(itr, data)
@@ -154,6 +148,8 @@ eo_fundef_generate(const Eolian_Class *class, const 
Eolian_Function *func, Eolia
         const char *ptype = eolian_type_c_type_get(ptypet);
         const char *pdesc = eolian_parameter_description_get(param);
 
+        if (!eina_strbuf_length_get(str_pardesc))
+          eina_strbuf_append(str_pardesc, " *\n");
         eina_strbuf_append_printf(str_pardesc, tmpl_eo_pardesc, "in", pname, 
pdesc?pdesc:"No description supplied.");
 
         if (eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, ", ");
@@ -185,6 +181,8 @@ eo_fundef_generate(const Eolian_Class *class, const 
Eolian_Function *func, Eolia
 
              const char *dir_str = str_dir[(int)pdir];
 
+             if (!eina_strbuf_length_get(str_pardesc))
+               eina_strbuf_append(str_pardesc, " *\n");
              eina_strbuf_append_printf(str_pardesc, tmpl_eo_pardesc, dir_str, 
pname, pdesc?pdesc:"No description supplied.");
 
              if (eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, 
", ");
@@ -208,16 +206,12 @@ eo_fundef_generate(const Eolian_Class *class, const 
Eolian_Function *func, Eolia
    if (!eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, "void");
    eina_strbuf_replace_all(str_func, "@#full_params", 
eina_strbuf_string_get(str_par));
    eina_strbuf_replace_all(str_func, "@#list_desc_param", 
eina_strbuf_string_get(str_pardesc));
-   eina_strbuf_replace_all(str_func, "@#ret_desc", 
eina_strbuf_string_get(str_retdesc));
-   eina_strbuf_replace_all(str_func, "@#list_typecheck", 
eina_strbuf_string_get(str_typecheck));
 
    if (rettype) eina_stringshare_del(rettype);
 
    free(tmpstr);
    eina_strbuf_free(str_par);
-   eina_strbuf_free(str_retdesc);
    eina_strbuf_free(str_pardesc);
-   eina_strbuf_free(str_typecheck);
 
    eina_strbuf_append(functext, eina_strbuf_string_get(str_func));
    eina_strbuf_free(str_func);
diff --git a/src/bin/eolian/legacy_generator.c 
b/src/bin/eolian/legacy_generator.c
index c65103d..ea6cfb4 100644
--- a/src/bin/eolian/legacy_generator.c
+++ b/src/bin/eolian/legacy_generator.c
@@ -15,9 +15,7 @@ static _eolian_class_vars class_env;
 static const char
 tmpl_eapi_funcdef[] = "\n\
 /**\n\
- *\n\
 @#desc\n\
- *\n\
 @#list_desc_param\
  */\n\
 EAPI @#type_return%s(@#params)@#flags;\n\
@@ -124,6 +122,8 @@ _eapi_decl_func_generate(const Eolian_Class *class, const 
Eolian_Function *funci
         if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", ");
         eina_strbuf_append_printf(fparam, "%s %s", ptype, pname);
         eina_stringshare_del(ptype);
+        if (!eina_strbuf_length_get(descparam))
+          eina_strbuf_append(descparam, " *\n");
         eina_strbuf_append_printf(descparam, " * @param[in] %s %s\n", pname, 
pdesc?pdesc:"No description supplied.");
         if (eolian_parameter_is_nonull((Eolian_Function_Parameter*)data))
           {
@@ -159,6 +159,8 @@ _eapi_decl_func_generate(const Eolian_Class *class, const 
Eolian_Function *funci
                   ptype, had_star?"":" ", add_star?"*":"", pname);
             eina_stringshare_del(ptype);
             const char *dir_str = str_dir[(int)pdir];
+            if (!eina_strbuf_length_get(descparam))
+              eina_strbuf_append(descparam, " *\n");
             eina_strbuf_append_printf(descparam, " * @param[%s] %s %s\n", 
dir_str, pname, pdesc?pdesc:"No description supplied.");
             if (eolian_parameter_is_nonull((Eolian_Function_Parameter*)data))
               {
diff --git a/src/tests/eolian/data/class_simple_ref_eo.h 
b/src/tests/eolian/data/class_simple_ref_eo.h
index 56d9d76..7956266 100644
--- a/src/tests/eolian/data/class_simple_ref_eo.h
+++ b/src/tests/eolian/data/class_simple_ref_eo.h
@@ -22,55 +22,43 @@ EAPI const Eo_Class *class_simple_class_get(void) 
EINA_CONST;
 
 #ifdef CLASS_SIMPLE_BETA
 /**
- *
  * Common desc for a
  * comment a.set
  *
  * @param[in] value Value description
- *
  */
 EOAPI Eina_Bool  evas_obj_simple_a_set(int value);
 #endif
 
 #ifdef CLASS_SIMPLE_BETA
 /**
- *
  * Common desc for a
  * 
- *
- *
  */
 EOAPI int  evas_obj_simple_a_get(void);
 #endif
 
 /**
- *
  * No description supplied.
- *
- *
  */
 EOAPI void  evas_obj_simple_b_set(void);
 
 #ifdef CLASS_SIMPLE_BETA
 /**
- *
  * comment foo
  * 
  *
  * @param[in] a a
  * @param[inout] b No description supplied.
  * @param[out] c No description supplied.
- *
  */
 EOAPI char * evas_obj_simple_foo(int a, char *b, double *c);
 #endif
 
 /**
- *
  * No description supplied.
  *
  * @param[in] x No description supplied.
- *
  */
 EOAPI int  evas_obj_simple_bar(int x);
 
diff --git a/src/tests/eolian/data/class_simple_ref_legacy.h 
b/src/tests/eolian/data/class_simple_ref_legacy.h
index 176b3ed..9109699 100644
--- a/src/tests/eolian/data/class_simple_ref_legacy.h
+++ b/src/tests/eolian/data/class_simple_ref_legacy.h
@@ -18,7 +18,6 @@ typedef Eo Class_Simple;
  */
 
 /**
- *
  * Common desc for a
  * comment a.set
  *
@@ -27,22 +26,17 @@ typedef Eo Class_Simple;
 EAPI Eina_Bool evas_object_simple_a_set(Class_Simple *obj, int value);
 
 /**
- *
  * Common desc for a
  * 
- *
  */
 EAPI int evas_object_simple_a_get(const Class_Simple *obj);
 
 /**
- *
  * No description supplied.
- *
  */
 EAPI void evas_object_simple_b_set(Class_Simple *obj);
 
 /**
- *
  * comment foo
  * 
  *
@@ -53,7 +47,6 @@ EAPI void evas_object_simple_b_set(Class_Simple *obj);
 EAPI char *evas_object_simple_foo(Class_Simple *obj, int a, char *b, double 
*c);
 
 /**
- *
  * No description supplied.
  *
  * @param[in] x No description supplied.
diff --git a/src/tests/eolian/data/struct_ref.c 
b/src/tests/eolian/data/struct_ref.c
index 8598ec2..455d60a 100644
--- a/src/tests/eolian/data/struct_ref.c
+++ b/src/tests/eolian/data/struct_ref.c
@@ -31,11 +31,9 @@ typedef struct _Opaque Opaque;
 EAPI const Eo_Class *struct_class_get(void) EINA_CONST;
 
 /**
- *
  * No description supplied.
  *
  * @param[in] idx No description supplied.
- *
  */
 EOAPI char * struct_foo(int idx);
 
diff --git a/src/tests/eolian/data/typedef_ref.c 
b/src/tests/eolian/data/typedef_ref.c
index 791d221..6749991 100644
--- a/src/tests/eolian/data/typedef_ref.c
+++ b/src/tests/eolian/data/typedef_ref.c
@@ -38,11 +38,9 @@ typedef enum
 EAPI const Eo_Class *typedef_class_get(void) EINA_CONST;
 
 /**
- *
  * No description supplied.
  *
  * @param[in] idx No description supplied.
- *
  */
 EOAPI char * typedef_foo(int idx);
 

-- 


Reply via email to