[vala] Use gdestroynotify_type in codegen instead of looking it up everytime.



commit faa908c621f6f09a06503bf099e48474d36a1303
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Jan 15 18:59:25 2011 +0100

    Use gdestroynotify_type in codegen instead of looking it up everytime.

 codegen/valaccodebasemodule.vala       |    4 ++--
 codegen/valaccodemethodcallmodule.vala |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 0b37387..95a3894 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -2052,7 +2052,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 					var target_var = new LocalVariable (new PointerType (new VoidType ()), get_delegate_target_cname (get_variable_cname (local.name)));
 					emit_temp_var (target_var);
 					if (deleg_type.value_owned) {
-						var target_destroy_notify_var = new LocalVariable (new DelegateType ((Delegate) context.root.scope.lookup ("GLib").scope.lookup ("DestroyNotify")), get_delegate_target_destroy_notify_cname (get_variable_cname (local.name)));
+						var target_destroy_notify_var = new LocalVariable (gdestroynotify_type, get_delegate_target_destroy_notify_cname (get_variable_cname (local.name)));
 						emit_temp_var (target_destroy_notify_var);
 					}
 				}
@@ -5212,7 +5212,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 				} else if (expression_type is DelegateType && expr != null) {
 					var target_decl = new LocalVariable (new PointerType (new VoidType ()), get_delegate_target_cname (decl.name));
 					emit_temp_var (target_decl);
-					var target_destroy_notify_decl = new LocalVariable (new DelegateType ((Delegate) context.root.scope.lookup ("GLib").scope.lookup ("DestroyNotify")), get_delegate_target_destroy_notify_cname (decl.name));
+					var target_destroy_notify_decl = new LocalVariable (gdestroynotify_type, get_delegate_target_destroy_notify_cname (decl.name));
 					emit_temp_var (target_destroy_notify_decl);
 					CCodeExpression target_destroy_notify;
 					ccode.add_expression (new CCodeAssignment (get_variable_cexpression (target_decl.name), get_delegate_target_cexpression (expr, out target_destroy_notify)));
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index f1ec0d8..cb408aa 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -424,7 +424,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
 								set_delegate_target (arg, get_variable_cexpression (temp_var.name));
 								carg_map.set (get_param_pos (param.cdelegate_target_parameter_position), new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_delegate_target (arg)));
 								if (deleg_type.value_owned) {
-									temp_var = get_temp_variable (new DelegateType ((Delegate) context.root.scope.lookup ("GLib").scope.lookup ("DestroyNotify")));
+									temp_var = get_temp_variable (gdestroynotify_type);
 									emit_temp_var (temp_var);
 									set_delegate_target_destroy_notify (arg, get_variable_cexpression (temp_var.name));
 									carg_map.set (get_param_pos (param.cdelegate_target_parameter_position + 0.01), new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_delegate_target_destroy_notify (arg)));
@@ -518,7 +518,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
 				set_delegate_target (expr, temp_ref);
 
 				if (deleg_type.value_owned) {
-					temp_var = get_temp_variable (new DelegateType ((Delegate) context.root.scope.lookup ("GLib").scope.lookup ("DestroyNotify")));
+					temp_var = get_temp_variable (gdestroynotify_type);
 					temp_ref = get_variable_cexpression (temp_var.name);
 
 					emit_temp_var (temp_var);



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