[vala/wip/effectfree: 29/40] codegen: Use create_temp_value in try_cast_value_to_type
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/effectfree: 29/40] codegen: Use create_temp_value in try_cast_value_to_type
- Date: Fri, 1 Jul 2011 11:58:20 +0000 (UTC)
commit d6224e3224f5abd7704fd32536e1cad325d483de
Author: Luca Bruno <lucabru src gnome org>
Date: Tue Jun 14 11:43:20 2011 +0200
codegen: Use create_temp_value in try_cast_value_to_type
codegen/valaccodebasemodule.vala | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 4935c4e..7e17094 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4452,9 +4452,9 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
len_call.add_argument (rv);
append_array_length (expr, len_call);
} else if (to is StructValueType) {
- var temp_decl = get_temp_variable (to, true, null, true);
- emit_temp_var (temp_decl);
- var ctemp = get_variable_cexpression (temp_decl.name);
+ CodeNode node = expr != null ? (CodeNode) expr : to;
+ var temp_value = create_temp_value (to, true, node, true);
+ var ctemp = get_cvalue_ (temp_value);
rv = new CCodeUnaryExpression (CCodeUnaryOperator.POINTER_INDIRECTION, new CCodeCastExpression (rv, (new PointerType(to)).get_cname ()));
var holds = new CCodeFunctionCall (new CCodeIdentifier ("G_VALUE_HOLDS"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]