Don't cast out arguments
authorJuerg Billeter <j@bitron.ch>
Wed, 23 Apr 2008 20:24:24 +0000 (20:24 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Wed, 23 Apr 2008 20:24:24 +0000 (20:24 +0000)
2008-04-23  Juerg Billeter  <j@bitron.ch>

* gobject/valaccodeinvocationexpressionbinding.vala:
Don't cast out arguments

svn path=/trunk/; revision=1310

ChangeLog
gobject/valaccodeinvocationexpressionbinding.vala

index 0ab546e..33aa824 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-04-23  Jürg Billeter  <j@bitron.ch>
 
+       * gobject/valaccodeinvocationexpressionbinding.vala:
+       Don't cast out arguments
+
+2008-04-23  Jürg Billeter  <j@bitron.ch>
+
        Add support for class constructors, class fields, and class
        methods, fixes bug 507136
 
index 0207266..857e28e 100644 (file)
@@ -193,7 +193,10 @@ public class Vala.CCodeInvocationExpressionBinding : CCodeExpressionBinding {
                                                carg_map.set (codegen.get_param_pos (param.cdelegate_target_parameter_position), codegen.get_delegate_target_cexpression (arg));
                                                multiple_cargs = true;
                                        }
-                                       cexpr = codegen.get_implicit_cast_expression (cexpr, arg.static_type, param.type_reference);
+                                       if (param.direction == ParameterDirection.IN) {
+                                               // don't cast arguments passed by reference
+                                               cexpr = codegen.get_implicit_cast_expression (cexpr, arg.static_type, param.type_reference);
+                                       }
 
                                        // pass non-simple struct instances always by reference
                                        if (!(arg.static_type is NullType) && param.type_reference.data_type is Struct && !((Struct) param.type_reference.data_type).is_simple_type ()) {