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.53.1~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2322237e19db90602cff73f4f3cd15baac79dfc;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 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; }