]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Use `const' for struct input parameters, fixes bug 548413
authorJürg Billeter <j@bitron.ch>
Sun, 21 Dec 2008 08:55:15 +0000 (08:55 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sun, 21 Dec 2008 08:55:15 +0000 (08:55 +0000)
2008-12-21  Jürg Billeter  <j@bitron.ch>

* gobject/valaccodebasemodule.vala:

Use `const' for struct input parameters, fixes bug 548413

svn path=/trunk/; revision=2234

ChangeLog
gobject/valaccodebasemodule.vala

index 6fe38ea69426521c7835809a9e876f4bfdfa4ae4..395cb94496a96c5cdb7cb56e38b09982e02e6ae5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-21  Jürg Billeter  <j@bitron.ch>
+
+       * gobject/valaccodebasemodule.vala:
+
+       Use `const' for struct input parameters, fixes bug 548413
+
 2008-12-21  Jürg Billeter  <j@bitron.ch>
 
        * vapi/packages/gstreamer-base-0.10/:
index f11f722fbd266d2f42a35a195b423ced392342b7..61aa8988b6079d71270c6dd374ab2f65a7bdca3c 100644 (file)
@@ -1048,8 +1048,11 @@ public class Vala.CCodeBaseModule : CCodeModule {
                        // pass non-simple structs always by reference
                        if (p.parameter_type.data_type is Struct) {
                                var st = (Struct) p.parameter_type.data_type;
-                               if (!st.is_simple_type () && p.direction == ParameterDirection.IN && !p.parameter_type.nullable) {
-                                       ctypename += "*";
+                               if (!st.is_simple_type () && p.direction == ParameterDirection.IN) {
+                                       ctypename = "const " + ctypename;
+                                       if (!p.parameter_type.nullable) {
+                                               ctypename += "*";
+                                       }
                                }
                        }