[vala/wip/effectfree: 36/38] codegen: Use create_temp_value in try_cast_variant_to_type



commit c0a3c0fcdd9d58e97b17a37d9b37fd0032d4b27c
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Jun 19 08:36:42 2011 +0200

    codegen: Use create_temp_value in try_cast_variant_to_type

 codegen/valaccodebasemodule.vala |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 3317edb..056bb08 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4462,12 +4462,11 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 			var array_type = (ArrayType) to;
 
 			for (int dim = 1; dim <= array_type.rank; dim++) {
-				var temp_decl = get_temp_variable (int_type, false, expr);
-				emit_temp_var (temp_decl);
+				var temp_value = create_temp_value (int_type, true, expr);
 
-				ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_variable_cexpression (temp_decl.name)));
+				ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_cvalue_ (temp_value)));
 				cfunc.add_parameter (new CCodeParameter (get_array_length_cname ("result", dim), "int*"));
-				append_array_length (expr, get_variable_cexpression (temp_decl.name));
+				append_array_length (expr, get_cvalue_ (temp_value));
 			}
 		}
 



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