]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Replace wrongly hard coded usage of G_OBJECT_GET_CLASS
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 3 May 2021 19:12:38 +0000 (21:12 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 19 May 2021 06:52:49 +0000 (08:52 +0200)
This is used by plain GTypeInstance classes as well.

codegen/valaccodebasemodule.vala
codegen/valaccodememberaccessmodule.vala
codegen/valaccodemethodcallmodule.vala

index 141f194674588a5a5be350b032bea511d030541d..90e1034d6d3fb50ee378f60e1d1c1ecd8aa1a358 100644 (file)
@@ -4211,7 +4211,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        CCodeExpression klass;
 
                        if (get_this_type () != null) {
-                               var k = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_GET_CLASS"));
+                               var k = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_type_get_function ((Class) parent)));
                                k.add_argument (new CCodeIdentifier ("self"));
                                klass = k;
                        } else {
index 7b22c9f2304afc5bd994780a110c7d911674e801..e18e4cb794d8c685546cfd82c5fbfcf4bc22738f 100644 (file)
@@ -715,13 +715,13 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
                                        klass = new CCodeIdentifier ("klass");
                                } else {
                                        // Accessing the field from within an instance method
-                                       var k = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_GET_CLASS"));
+                                       var k = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_type_get_function (cl)));
                                        k.add_argument (new CCodeIdentifier ("self"));
                                        klass = k;
                                }
                        } else {
                                // Accessing the field of an instance
-                               var k = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_GET_CLASS"));
+                               var k = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_type_get_function (cl)));
                                k.add_argument (get_cvalue_ (instance));
                                klass = k;
                        }
index 42a7fcaa0635bd35968865e690713fd15fa2cdc7..a7e61c221db0c556c9700edefa68bd283c91ef22 100644 (file)
@@ -289,13 +289,13 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                        klass = new CCodeIdentifier ("klass");
                                } else {
                                        // Accessing the method from within an instance method
-                                       var k = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_GET_CLASS"));
+                                       var k = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_type_get_function (cl)));
                                        k.add_argument (get_this_cexpression ());
                                        klass = k;
                                }
                        } else {
                                // Accessing the method of an instance
-                               var k = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_GET_CLASS"));
+                               var k = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_type_get_function (cl)));
                                k.add_argument (get_cvalue (ma.inner));
                                klass = k;
                        }