From ad66192465360e45548c1344033b9c3a6861cc11 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Fri, 18 Jul 2014 19:20:55 -0300 Subject: [PATCH] eolian-cxx: Fixed generation using abstract return-type instead of C type The _tmp_ret variable should use the native C type and not the abstracted C++ type. --- .../grammar/inheritance_base_generator.hh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh b/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh index c7aaa8db04..54617f1ae7 100644 --- a/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh +++ b/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh @@ -192,7 +192,7 @@ operator<<(std::ostream& out, inheritance_base_operations_function const& x) << tab(2) << "{" << endl; if (!is_void) { - out << tab(3) << reinterpret_type(func.ret) << " _tmp_ret = {};" << endl; + out << tab(3) << func.ret.front().native << " _tmp_ret = {};" << endl; } out << tab(3) << "eo_do_super(static_cast(this)->_eo_ptr()" << endl @@ -202,10 +202,8 @@ operator<<(std::ostream& out, inheritance_base_operations_function const& x) << "("; parameter_names_enumerate(out, func.params) << "));" << endl; - if (!is_void) - { - out << tab(3) << "return _tmp_ret;" << endl; - } + if (!function_is_void(func)) + out << tab(4) << "return " << to_cxx(func.ret, "_tmp_ret") << ";" << endl; out << tab(2) << "}" << endl << endl; return out; } @@ -315,7 +313,7 @@ operator<<(std::ostream& out, inheritance_extension_function const& x) if (!is_void) { - out << tab(3) << reinterpret_type(x._func.ret) << " _tmp_ret = {};" << endl; + out << tab(3) << x._func.ret.front().native << " _tmp_ret = {};" << endl; } parameters_container_type::const_iterator callback_iter = @@ -332,10 +330,8 @@ operator<<(std::ostream& out, inheritance_extension_function const& x) out << tab(3) << "eo_do(static_cast(this)->_eo_ptr(), " << function_call(x._func) << ");" << endl; - if (!is_void) - { - out << tab(3) << "return _tmp_ret;" << endl; - } + if (!function_is_void(x._func)) + out << tab(4) << "return " << to_cxx(x._func.ret, "_tmp_ret") << ";" << endl; out << tab(2) << "}" << endl << endl;