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



commit e2322237e19db90602cff73f4f3cd15baac79dfc
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 dad2ad893..d9eb216c7 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -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 {
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index 67a5434f3..b1f130eb9 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 7648f4126..8f9a197b9 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -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;
                        }


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