explicitly cast callbacks to reduce the number of warnings during C
authorJürg Billeter <j@bitron.ch>
Thu, 26 Oct 2006 10:54:56 +0000 (10:54 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Thu, 26 Oct 2006 10:54:56 +0000 (10:54 +0000)
2006-10-26  Jürg Billeter  <j@bitron.ch>

* vala/valacodegenerator.vala: explicitly cast callbacks to reduce the
  number of warnings during C compilation

svn path=/trunk/; revision=155

vala/ChangeLog
vala/vala/valacodegenerator.vala

index 8d725d8..a1fa3f1 100644 (file)
@@ -1,5 +1,10 @@
 2006-10-26  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valacodegenerator.vala: explicitly cast callbacks to reduce the
+         number of warnings during C compilation
+
+2006-10-26  Jürg Billeter  <j@bitron.ch>
+
        * vala/valacodegenerator.vala: convert integer to pointer for generic
          parameters to reduce the number of warnings during C compilation
 
index d3b561e..6e910b4 100644 (file)
@@ -2771,6 +2771,8 @@ public class Vala.CodeGenerator : CodeVisitor {
                                                        ccall.add_argument (cexpr);
                                                        cexpr = ccall;
                                                }
+                                       } else if (param.type_reference.data_type is Callback) {
+                                               cexpr = new CCodeCastExpression (cexpr, param.type_reference.data_type.get_cname ());
                                        } else if (param.type_reference.data_type == null
                                                   && arg.static_type.data_type is Struct) {
                                                /* convert integer to pointer if this is a generic method parameter */