From: Rico Tzschichholz Date: Mon, 3 May 2021 19:12:38 +0000 (+0200) Subject: codegen: Replace wrongly hard coded usage of G_OBJECT_GET_CLASS X-Git-Tag: 0.50.9~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1713239a43ee4828465d5f2d448956b22cf557b6;p=thirdparty%2Fvala.git codegen: Replace wrongly hard coded usage of G_OBJECT_GET_CLASS This is used by plain GTypeInstance classes as well. --- diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 141f19467..90e1034d6 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -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 { 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; }