]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Use gdestroynotify_type in codegen instead of looking it up everytime.
authorLuca Bruno <lucabru@src.gnome.org>
Sat, 15 Jan 2011 17:59:25 +0000 (18:59 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Sat, 15 Jan 2011 18:03:09 +0000 (19:03 +0100)
codegen/valaccodebasemodule.vala
codegen/valaccodemethodcallmodule.vala

index 0b37387aece13539849aa509fc8758d9938713ce..95a38949e4fb1fd6f61d895949fdf8e8e90b0fe7 100644 (file)
@@ -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)));
index f1ec0d859fe55c078af5bea41396081b8df18cdd..cb408aa6d561c18ec6347e1e51640fc2d97b4f1b 100644 (file)
@@ -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);