[vala/emit-let: 1/2] codegen: Drop useless comma expression when handling struct arguments
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/emit-let: 1/2] codegen: Drop useless comma expression when handling struct arguments
- Date: Sat, 5 Mar 2011 11:18:11 +0000 (UTC)
commit 435b211c5312727668634034f52d89d282ad667e
Author: Luca Bruno <lucabru src gnome org>
Date: Sat Mar 5 10:54:50 2011 +0100
codegen: Drop useless comma expression when handling struct arguments
codegen/valaccodebasemodule.vala | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 48f2730..2df1409 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4527,15 +4527,11 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
return new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, cexpr);
} else {
// if cexpr is e.g. a function call, we can't take the address of the expression
- // (tmp = expr, &tmp)
- var ccomma = new CCodeCommaExpression ();
-
var temp_var = get_temp_variable (type, true, null, false);
emit_temp_var (temp_var);
- ccomma.append_expression (new CCodeAssignment (get_variable_cexpression (temp_var.name), cexpr));
- ccomma.append_expression (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_variable_cexpression (temp_var.name)));
- return ccomma;
+ ccode.add_assignment (get_variable_cexpression (temp_var.name), cexpr);
+ return new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_variable_cexpression (temp_var.name));
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]