[vala] codegen: Use separate C statements for implicit GValue conversions
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Use separate C statements for implicit GValue conversions
- Date: Thu, 23 Dec 2010 15:35:27 +0000 (UTC)
commit 73a9b53db3e202f8da17caca7cb7bbadb78aede6
Author: Jürg Billeter <j bitron ch>
Date: Thu Dec 23 13:18:50 2010 +0100
codegen: Use separate C statements for implicit GValue conversions
codegen/valaccodebasemodule.vala | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index d6592e9..86fe786 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5249,14 +5249,12 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
temp_ref_vars.insert (0, decl);
}
- var ccomma = new CCodeCommaExpression ();
-
if (target_type.nullable) {
var newcall = new CCodeFunctionCall (new CCodeIdentifier ("g_new0"));
newcall.add_argument (new CCodeConstant ("GValue"));
newcall.add_argument (new CCodeConstant ("1"));
var newassignment = new CCodeAssignment (get_variable_cexpression (decl.name), newcall);
- ccomma.append_expression (newassignment);
+ ccode.add_expression (newassignment);
}
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_value_init"));
@@ -5266,7 +5264,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_variable_cexpression (decl.name)));
}
ccall.add_argument (new CCodeIdentifier (expression_type.get_type_id ()));
- ccomma.append_expression (ccall);
+ ccode.add_expression (ccall);
if (requires_destroy (expression_type)) {
ccall = new CCodeFunctionCall (get_value_taker_function (expression_type));
@@ -5284,10 +5282,9 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
ccall.add_argument (cexpr);
}
- ccomma.append_expression (ccall);
+ ccode.add_expression (ccall);
- ccomma.append_expression (get_variable_cexpression (decl.name));
- cexpr = ccomma;
+ cexpr = get_variable_cexpression (decl.name);
return cexpr;
} else if (gvariant_boxing) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]