[vala/0.52] codegen: Replace wrongly hard coded usage of G_OBJECT_GET_CLASS



commit fc148ac7c0ba6c2d08bf3d3f35da2da1a7c3a6f4
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon May 3 21:12:38 2021 +0200

    codegen: Replace wrongly hard coded usage of G_OBJECT_GET_CLASS
    
    This is used by plain GTypeInstance classes as well.

 codegen/valaccodebasemodule.vala         | 2 +-
 codegen/valaccodememberaccessmodule.vala | 4 ++--
 codegen/valaccodemethodcallmodule.vala   | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 656461795..e38b0205c 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4257,7 +4257,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 {
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index 05e5541f8..ea8e3a3d8 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -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;
                        }
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index c1ef29677..50fdbbd69 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -300,13 +300,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;
                        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]