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



commit 3383080a7f0107bd83e5c66932320cacad644133
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 509b76a8d..e24394863 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4184,7 +4184,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 7b22c9f23..e18e4cb79 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -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;
                        }
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index 42a7fcaa0..a7e61c221 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -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;
                        }


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