[vala] codegen: Use separate C statements for array resize expressions
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Use separate C statements for array resize expressions
- Date: Tue, 21 Dec 2010 18:02:32 +0000 (UTC)
commit 40fd0aad0342332e41176e77e48b0497c5853d79
Author: Jürg Billeter <j bitron ch>
Date: Tue Dec 21 17:34:33 2010 +0100
codegen: Use separate C statements for array resize expressions
codegen/valaccodemethodcallmodule.vala | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index f37d57f..0ba0e4e 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -721,21 +721,18 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
czero.add_argument (new CCodeConstant ("0"));
czero.add_argument (new CCodeBinaryExpression (CCodeBinaryOperator.MUL, csizeof, cdelta));
- var ccomma = new CCodeCommaExpression ();
- ccomma.append_expression (new CCodeAssignment (temp_ref, new_size));
- ccomma.append_expression (ccall_expr);
- ccomma.append_expression (new CCodeConditionalExpression (ccheck, czero, new CCodeConstant ("NULL")));
- ccomma.append_expression (new CCodeAssignment (get_array_length_cexpression (ma.inner, 1), temp_ref));
+ ccode.add_expression (new CCodeAssignment (temp_ref, new_size));
+ ccode.add_expression (ccall_expr);
+ ccode.add_expression (new CCodeConditionalExpression (ccheck, czero, new CCodeConstant ("NULL")));
+ ccode.add_expression (new CCodeAssignment (get_array_length_cexpression (ma.inner, 1), temp_ref));
var array_var = ma.inner.symbol_reference;
var array_local = array_var as LocalVariable;
if (array_var != null && array_var.is_internal_symbol ()
&& ((array_var is LocalVariable && !array_local.captured) || array_var is Field)) {
- ccomma.append_expression (new CCodeAssignment (get_array_size_cvalue (ma.inner.target_value), temp_ref));
+ ccode.add_expression (new CCodeAssignment (get_array_size_cvalue (ma.inner.target_value), temp_ref));
}
- set_cvalue (expr, ccomma);
-
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]