savio pushed a commit to branch master.

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

commit b3bd72cd114f8537eed6707810f9cda498c00726
Author: Savio Sena <sa...@expertisesolutions.com.br>
Date:   Mon Jul 21 22:13:54 2014 -0300

    eolian-cxx: Handle exclicitly void-return getters.
    
    Whenever a getter explicitly defines a void return the generated code
    shall not convert single-parameter getters in any ways.
    
    Actually the correct approach would be to delegate all conversions to
    Eolian Database instead of for the generators.
---
 src/bin/eolian_cxx/convert.cc         |  3 ++-
 src/bin/eolian_cxx/eolian_wrappers.hh | 10 ++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/bin/eolian_cxx/convert.cc b/src/bin/eolian_cxx/convert.cc
index 7131188..5597725 100644
--- a/src/bin/eolian_cxx/convert.cc
+++ b/src/bin/eolian_cxx/convert.cc
@@ -101,7 +101,8 @@ convert_eolian_property_to_functions(Eolian_Class const& 
klass)
              // if the getter has a single parameter and a void return
              // it is transformed into a getter with no parameters
              // that actually returns what would be the first argument.
-             if (params.size() == 1 && efl::eolian::type_is_void(ret))
+             if (params.size() == 1 && efl::eolian::type_is_void(ret) &&
+                 !function_return_is_explicit_void(*prop_, eolian_cxx::getter))
                {
                   get_.ret = params[0].type;
                   get_.params.clear();
diff --git a/src/bin/eolian_cxx/eolian_wrappers.hh 
b/src/bin/eolian_cxx/eolian_wrappers.hh
index 0d1fc39..f956650 100644
--- a/src/bin/eolian_cxx/eolian_wrappers.hh
+++ b/src/bin/eolian_cxx/eolian_wrappers.hh
@@ -208,6 +208,16 @@ function_return_type(Eolian_Function const& func, ctor_t 
func_type)
 }
 
 inline bool
+function_return_is_explicit_void(Eolian_Function const& func, getter_t 
func_type)
+{
+   // XXX This function shouldn't be necessary. Eolian database should
+   //     forge functions as desired and the bindings generator shouldn't
+   //     be required to convert and understand this.
+   Eolian_Type const* type = ::eolian_function_return_type_get(&func, 
func_type.value);
+   return !!type && safe_str(type->name) == "void";
+}
+
+inline bool
 property_is_getter(Eolian_Function_Type func_type)
 {
    return func_type == property_t::value || func_type == getter_t::value;

-- 


Reply via email to