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.
This commit is contained in:
Felipe Magno de Almeida 2014-07-18 19:20:55 -03:00
parent b1c9ca5c24
commit ad66192465
1 changed files with 6 additions and 10 deletions

View File

@ -192,7 +192,7 @@ operator<<(std::ostream& out, inheritance_base_operations_function const& x)
<< tab(2) << "{" << endl; << tab(2) << "{" << endl;
if (!is_void) 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) out << tab(3)
<< "eo_do_super(static_cast<T*>(this)->_eo_ptr()" << endl << "eo_do_super(static_cast<T*>(this)->_eo_ptr()" << endl
@ -202,10 +202,8 @@ operator<<(std::ostream& out, inheritance_base_operations_function const& x)
<< "("; << "(";
parameter_names_enumerate(out, func.params) parameter_names_enumerate(out, func.params)
<< "));" << endl; << "));" << endl;
if (!is_void) if (!function_is_void(func))
{ out << tab(4) << "return " << to_cxx(func.ret, "_tmp_ret") << ";" << endl;
out << tab(3) << "return _tmp_ret;" << endl;
}
out << tab(2) << "}" << endl << endl; out << tab(2) << "}" << endl << endl;
return out; return out;
} }
@ -315,7 +313,7 @@ operator<<(std::ostream& out, inheritance_extension_function const& x)
if (!is_void) 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 = 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<U*>(this)->_eo_ptr(), " out << tab(3) << "eo_do(static_cast<U*>(this)->_eo_ptr(), "
<< function_call(x._func) << ");" << endl; << function_call(x._func) << ");" << endl;
if (!is_void) if (!function_is_void(x._func))
{ out << tab(4) << "return " << to_cxx(x._func.ret, "_tmp_ret") << ";" << endl;
out << tab(3) << "return _tmp_ret;" << endl;
}
out << tab(2) << "}" << endl out << tab(2) << "}" << endl
<< endl; << endl;