From: Jürg Billeter Date: Thu, 14 Aug 2008 19:55:23 +0000 (+0000) Subject: Add missing casts and checks for non-GObject classes X-Git-Tag: VALA_0_3_5~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e81e2933d074b56a3d279ee5fa4b423d6023c8bd;p=thirdparty%2Fvala.git Add missing casts and checks for non-GObject classes 2008-08-14 Jürg Billeter * gobject/valaccodegenerator.vala: Add missing casts and checks for non-GObject classes svn path=/trunk/; revision=1750 --- diff --git a/ChangeLog b/ChangeLog index 27f620b9e..e5e30f9f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-14 Jürg Billeter + + * gobject/valaccodegenerator.vala: + + Add missing casts and checks for non-GObject classes + 2008-08-14 Jared Moore * gobject/valaccodegenerator.vala: diff --git a/gobject/valaccodegenerator.vala b/gobject/valaccodegenerator.vala index b4f79f113..47f05c52d 100644 --- a/gobject/valaccodegenerator.vala +++ b/gobject/valaccodegenerator.vala @@ -3471,8 +3471,8 @@ public class Vala.CCodeGenerator : CodeGenerator { var left_type_as_struct = expr.left.value_type.data_type as Struct; var right_type_as_struct = expr.right.value_type.data_type as Struct; - if (expr.left.value_type.data_type is Class && ((Class) expr.left.value_type.data_type).is_subtype_of (gobject_type) && - expr.right.value_type.data_type is Class && ((Class) expr.right.value_type.data_type).is_subtype_of (gobject_type)) { + if (expr.left.value_type.data_type is Class && !((Class) expr.left.value_type.data_type).is_compact && + expr.right.value_type.data_type is Class && !((Class) expr.right.value_type.data_type).is_compact) { var left_cl = (Class) expr.left.value_type.data_type; var right_cl = (Class) expr.right.value_type.data_type; @@ -4048,7 +4048,7 @@ public class Vala.CCodeGenerator : CodeGenerator { public CCodeStatement? create_type_check_statement (CodeNode method_node, DataType ret_type, TypeSymbol t, bool non_null, string var_name) { var ccheck = new CCodeFunctionCall (); - if ((t is Class && ((Class) t).is_subtype_of (gobject_type)) || t is Interface) { + if ((t is Class && !((Class) t).is_compact) || t is Interface) { var ctype_check = new CCodeFunctionCall (new CCodeIdentifier (get_type_check_function (t))); ctype_check.add_argument (new CCodeIdentifier (var_name));