]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Replace specific hardcoded "GDestroyNotify" references (POSIX)
authorRico Tzschichholz <ricotz@ubuntu.com>
Fri, 18 Oct 2019 22:12:26 +0000 (00:12 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 19 Oct 2019 08:20:52 +0000 (10:20 +0200)
codegen/valaccodearraymodule.vala
codegen/valaccodebasemodule.vala

index 4e295c7c67a717bcdd1b4c4c00413c7e579489d8..f8228b8cd711fd3d2a8ef502e9518e5315a4a63d 100644 (file)
@@ -286,7 +286,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
                fun.modifiers = CCodeModifiers.STATIC;
                fun.add_parameter (new CCodeParameter ("array", get_ccode_name (pointer_type)));
                fun.add_parameter (new CCodeParameter ("array_length", get_ccode_name (int_type)));
-               fun.add_parameter (new CCodeParameter ("destroy_func", "GDestroyNotify"));
+               fun.add_parameter (new CCodeParameter ("destroy_func", get_ccode_name (delegate_target_destroy_type)));
 
                push_function (fun);
 
@@ -310,7 +310,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
                fun.modifiers = CCodeModifiers.STATIC;
                fun.add_parameter (new CCodeParameter ("array", get_ccode_name (pointer_type)));
                fun.add_parameter (new CCodeParameter ("array_length", get_ccode_name (int_type)));
-               fun.add_parameter (new CCodeParameter ("destroy_func", "GDestroyNotify"));
+               fun.add_parameter (new CCodeParameter ("destroy_func", get_ccode_name (delegate_target_destroy_type)));
 
                push_function (fun);
 
@@ -482,7 +482,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
                        ccall = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_destroy"));
                        ccall.add_argument (get_cvalue_ (value));
                        ccall.add_argument (get_ccodenode (array_type.length));
-                       ccall.add_argument (new CCodeCastExpression (get_destroy_func_expression (array_type.element_type), "GDestroyNotify"));
+                       ccall.add_argument (new CCodeCastExpression (get_destroy_func_expression (array_type.element_type), get_ccode_name (delegate_target_destroy_type)));
 
                        return ccall;
                } else {
index cc737edd8158fc58cb8ac8fd3eb44b95eedf7ef7..2f378539bab5bf81087a53a905bc685c202fc81c 100644 (file)
@@ -3665,7 +3665,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                                        requires_array_free = true;
                                                        ccall.call = new CCodeIdentifier ("_vala_array_free");
                                                        ccall.add_argument (csizeexpr);
-                                                       ccall.add_argument (new CCodeCastExpression (get_destroy_func_expression (array_type.element_type), "GDestroyNotify"));
+                                                       ccall.add_argument (new CCodeCastExpression (get_destroy_func_expression (array_type.element_type), get_ccode_name (delegate_target_destroy_type)));
                                                }
                                        }
                                }