]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Use get_ccode_delegate_target_name() for fields
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 6 Jun 2018 15:22:40 +0000 (17:22 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 14 Jan 2019 13:20:35 +0000 (14:20 +0100)
Replace get_delegate_target_destroy_notify_cname (get_ccode_name (...))

codegen/valaccodebasemodule.vala
codegen/valaccodememberaccessmodule.vala
codegen/valaccodestructmodule.vala
codegen/valagtypemodule.vala

index 5e5b7e15300b5db788d637f71323ae99c58396b7..192ce92bf353246794f75ff97f90120606c969cf 100644 (file)
@@ -1119,7 +1119,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
                                if (delegate_type.is_disposable ()) {
                                        cdecl = new CCodeDeclaration (get_ccode_name (delegate_target_destroy_type));
-                                       cdecl.add_declarator (new CCodeVariableDeclarator (get_delegate_target_destroy_notify_cname  (get_ccode_name (f))));
+                                       cdecl.add_declarator (new CCodeVariableDeclarator (get_ccode_delegate_target_destroy_notify_name (f)));
                                        if (f.is_private_symbol ()) {
                                                cdecl.modifiers = CCodeModifiers.STATIC;
                                        } else if (context.hide_internal && f.is_internal_symbol ()) {
@@ -1329,7 +1329,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
                                                if (delegate_type.is_disposable ()) {
                                                        var target_destroy_notify_def = new CCodeDeclaration (get_ccode_name (delegate_target_destroy_type));
-                                                       target_destroy_notify_def.add_declarator (new CCodeVariableDeclarator (get_delegate_target_destroy_notify_cname (get_ccode_name (f)), new CCodeConstant ("NULL")));
+                                                       target_destroy_notify_def.add_declarator (new CCodeVariableDeclarator (get_ccode_delegate_target_destroy_notify_name (f), new CCodeConstant ("NULL")));
                                                        if (!f.is_private_symbol ()) {
                                                                target_destroy_notify_def.modifiers = CCodeModifiers.EXTERN;
                                                        } else {
index 03a20429996c47dfb2e1d48849634bce12c0997c..aa3506ca05899d2838ef0ef970463f447ff85bff 100644 (file)
@@ -631,7 +631,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
                                }
                        } else if (delegate_type != null && delegate_type.delegate_symbol.has_target && get_ccode_delegate_target (field)) {
                                string target_cname = get_ccode_delegate_target_name (field);
-                               string target_destroy_notify_cname = get_delegate_target_destroy_notify_cname (get_ccode_name (field));
+                               string target_destroy_notify_cname = get_ccode_delegate_target_destroy_notify_name (field);
 
                                if (((TypeSymbol) field.parent_symbol).is_reference_type ()) {
                                        result.delegate_target_cvalue = new CCodeMemberAccess.pointer (inst, target_cname);
@@ -698,7 +698,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
                        } else if (delegate_type != null && delegate_type.delegate_symbol.has_target && get_ccode_delegate_target (field)) {
                                result.delegate_target_cvalue = new CCodeIdentifier (get_ccode_delegate_target_name (field));
                                if (result.value_type.is_disposable ()) {
-                                       result.delegate_target_destroy_notify_cvalue = new CCodeIdentifier (get_delegate_target_destroy_notify_cname (get_ccode_name (field)));
+                                       result.delegate_target_destroy_notify_cvalue = new CCodeIdentifier (get_ccode_delegate_target_destroy_notify_name (field));
                                }
                        }
                }
index d5db42951ffdee4f0a9c6f80dfd7d31ab4736305..980fde023b8b6c892632964d165a222c84f5e667 100644 (file)
@@ -107,7 +107,7 @@ public abstract class Vala.CCodeStructModule : CCodeBaseModule {
                                                // create field to store delegate target
                                                instance_struct.add_field (get_ccode_name (delegate_target_type), get_ccode_delegate_target_name (f));
                                                if (delegate_type.is_disposable ()) {
-                                                       instance_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_delegate_target_destroy_notify_cname (get_ccode_name (f)));
+                                                       instance_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_ccode_delegate_target_destroy_notify_name (f));
                                                }
                                        }
                                }
index 9bb8a305249d70ccb38e060ec63649e77cd0bbd7..1fec5e531480658fbeb87de1982f416b9c9befb4 100644 (file)
@@ -438,7 +438,7 @@ public class Vala.GTypeModule : GErrorModule {
                                        // create field to store delegate target
                                        instance_struct.add_field (get_ccode_name (delegate_target_type), get_ccode_delegate_target_name (f));
                                        if (delegate_type.is_disposable ()) {
-                                               instance_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_delegate_target_destroy_notify_cname (get_ccode_name (f)));
+                                               instance_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_ccode_delegate_target_destroy_notify_name (f));
                                        }
                                }
                        }
@@ -540,7 +540,7 @@ public class Vala.GTypeModule : GErrorModule {
                                                        // create field to store delegate target
                                                        instance_priv_struct.add_field (get_ccode_name (delegate_target_type), get_ccode_delegate_target_name (f));
                                                        if (delegate_type.is_disposable ()) {
-                                                               instance_priv_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_delegate_target_destroy_notify_cname (get_ccode_name (f)));
+                                                               instance_priv_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_ccode_delegate_target_destroy_notify_name (f));
                                                        }
                                                }
                                        }