bu5hm4n pushed a commit to branch master.

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

commit 5a11fd858768be6243d06b51dea837aa0b9f66e7
Author: Marcel Hollerbach <m...@marcel-hollerbach.de>
Date:   Tue Jan 15 18:13:43 2019 +0100

    eolian_gen: void out keys depending on how they are setted
    
    this avoid warings about keys not beeing used in the fallback function.
    
    Reviewed-by: Daniel Kolesa <dan...@octaforge.org>
    Differential Revision: https://phab.enlightenment.org/D7630
---
 src/bin/eolian/sources.c | 87 +++++++++++++++++++++++++++++-------------------
 1 file changed, 52 insertions(+), 35 deletions(-)

diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index 900b70216b..d80ca74abe 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -267,6 +267,50 @@ _generate_iterative_free(Eina_Strbuf **buf, const 
Eolian_Type *type, const Eolia
    eina_strbuf_free(iter_param);
 }
 
+static int
+_gen_function_param_fallback(Eina_Iterator *itr, Eina_Strbuf 
*fallback_free_ownership, Eina_Strbuf *param_call)
+{
+   Eolian_Function_Parameter *pr;
+   int owners = 0;
+
+   EINA_ITERATOR_FOREACH(itr, pr)
+     {
+        const Eolian_Type *type, *inner_type;
+
+        type = eolian_parameter_type_get(pr);
+        inner_type = eolian_type_base_type_get(type);
+
+        //check if they should be freed or just ignored
+        if (!eolian_type_is_owned(type) || eolian_parameter_direction_get(pr) 
== EOLIAN_OUT_PARAM)
+          {
+             eina_strbuf_append_printf(fallback_free_ownership, "   
(void)%s;\n", eolian_parameter_name_get(pr));
+             continue;
+          }
+
+        owners ++;
+
+        eina_strbuf_reset(param_call);
+
+        if (eolian_parameter_direction_get(pr) == EOLIAN_INOUT_PARAM)
+          eina_strbuf_append_char(param_call, '*');
+        eina_strbuf_append(param_call, eolian_parameter_name_get(pr));
+
+        //check if we might want to free or handle the children
+        if (!inner_type || !eolian_type_is_owned(inner_type))
+          {
+             _generate_normal_free(&fallback_free_ownership, type, param_call, 
"");
+          }
+        else if (inner_type && eolian_type_is_owned(inner_type))
+          {
+             _generate_iterative_free(&fallback_free_ownership, type, 
inner_type, pr, param_call);
+          }
+      }
+   eina_iterator_free(itr);
+
+   return owners;
+}
+
+
 static void
 _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
           Eolian_Function_Type ftype, Eina_Strbuf *buf,
@@ -356,50 +400,23 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function 
*fid,
    else
      {
           Eina_Iterator *itr;
-          Eolian_Function_Parameter *pr;
           int owners = 0;
           Eina_Strbuf *param_call;
 
           param_call = eina_strbuf_new();
 
           if (is_prop)
-            itr = eolian_property_values_get(fid, ftype);
+            {
+               itr = eolian_property_values_get(fid, ftype);
+               owners += _gen_function_param_fallback(itr, 
fallback_free_ownership, param_call);
+               itr = eolian_property_keys_get(fid, ftype);
+               owners += _gen_function_param_fallback(itr, 
fallback_free_ownership, param_call);
+            }
           else
-            itr = eolian_function_parameters_get(fid);
-
-          EINA_ITERATOR_FOREACH(itr, pr)
             {
-               const Eolian_Type *type, *inner_type;
-
-               type = eolian_parameter_type_get(pr);
-               inner_type = eolian_type_base_type_get(type);
-
-               //check if they should be freed or just ignored
-               if (!eolian_type_is_owned(type) || 
eolian_parameter_direction_get(pr) == EOLIAN_OUT_PARAM)
-                 {
-                    eina_strbuf_append_printf(fallback_free_ownership, "   
(void)%s;\n", eolian_parameter_name_get(pr));
-                    continue;
-                 }
-
-               owners ++;
-
-               eina_strbuf_reset(param_call);
-
-               if (eolian_parameter_direction_get(pr) == EOLIAN_INOUT_PARAM)
-                 eina_strbuf_append_char(param_call, '*');
-               eina_strbuf_append(param_call, eolian_parameter_name_get(pr));
-
-               //check if we might want to free or handle the children
-               if (!inner_type || !eolian_type_is_owned(inner_type))
-                 {
-                    _generate_normal_free(&fallback_free_ownership, type, 
param_call, "");
-                 }
-               else if (inner_type && eolian_type_is_owned(inner_type))
-                 {
-                    _generate_iterative_free(&fallback_free_ownership, type, 
inner_type, pr, param_call);
-                 }
+               itr = eolian_function_parameters_get(fid);
+               owners += _gen_function_param_fallback(itr, 
fallback_free_ownership, param_call);
             }
-          eina_iterator_free(itr);
 
           if (owners == 0)
             {

-- 


Reply via email to