]> 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>
Mon, 3 May 2021 19:12:38 +0000 (21:12 +0200)
This is used by plain GTypeInstance classes as well.

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

index dad2ad8934b27b3faa35fdc68a95021d209a5240..d9eb216c74d91fb571cb609fe9dbf52a2a55b10b 100644 (file)
@@ -4210,7 +4210,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 67a5434f3949c07372edc9beceefc80b96d86f75..b1f130eb990f62b1de354032c4965df993dbf26d 100644 (file)
@@ -712,13 +712,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 7648f41262717b6a827de493bfdd451f50ba6e04..8f9a197b90468f017213444ff28ea884bad9c2ee 100644 (file)
@@ -299,13 +299,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;
                        }