Add missing casts and checks for non-GObject classes
authorJürg Billeter <j@bitron.ch>
Thu, 14 Aug 2008 19:55:23 +0000 (19:55 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Thu, 14 Aug 2008 19:55:23 +0000 (19:55 +0000)
2008-08-14  Jürg Billeter  <j@bitron.ch>

* gobject/valaccodegenerator.vala:

Add missing casts and checks for non-GObject classes

svn path=/trunk/; revision=1750

ChangeLog
gobject/valaccodegenerator.vala

index 27f620b..e5e30f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-14  Jürg Billeter  <j@bitron.ch>
+
+       * gobject/valaccodegenerator.vala:
+
+       Add missing casts and checks for non-GObject classes
+
 2008-08-14  Jared Moore  <jaredm@svn.gnome.org>
 
        * gobject/valaccodegenerator.vala:
index b4f79f1..47f05c5 100644 (file)
@@ -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));