[vala] Fix calling methods that have out parameters and return structs



commit cfa683c26066e67888eef0a8895bf64028e346a3
Author: Jürg Billeter <j bitron ch>
Date:   Sat Dec 19 14:58:28 2009 +0100

    Fix calling methods that have out parameters and return structs

 codegen/valaccodemethodcallmodule.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index 4589cbf..87ddcc0 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -365,7 +365,7 @@ internal class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
 
 						// call function
 						LocalVariable ret_temp_var = null;
-						if (itype.get_return_type () is VoidType) {
+						if (itype.get_return_type () is VoidType || itype.get_return_type ().is_real_struct_type ()) {
 							ccomma.append_expression (ccall_expr);
 						} else {
 							ret_temp_var = get_temp_variable (itype.get_return_type (), true, null, false);
@@ -389,7 +389,7 @@ internal class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
 						ccomma.append_expression (new CCodeAssignment ((CCodeExpression) unary.inner.ccodenode, cassign_comma));
 
 						// return value
-						if (!(itype.get_return_type () is VoidType)) {
+						if (!(itype.get_return_type () is VoidType || itype.get_return_type ().is_real_struct_type ())) {
 							ccomma.append_expression (get_variable_cexpression (ret_temp_var.name));
 						}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]