]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Honor array_length_type when generating method parameters
authorLuca Bruno <lethalman88@gmail.com>
Mon, 16 Aug 2010 20:06:25 +0000 (22:06 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 20 Aug 2010 08:17:48 +0000 (10:17 +0200)
Based on patch by Sam Thursfield, fixes bug 621830.

codegen/valaccodearraymodule.vala

index d0966e6d9c3090d3c80ccad3045f348bbfe80845..2eebca776e81c6050bedae20b4750107e94ee0ee 100644 (file)
@@ -1023,9 +1023,12 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
                }
 
                if (!param.no_array_length) {
-                       var length_ctype = "int";
+                       string length_ctype = "int";
+                       if (param.array_length_type != null) {
+                               length_ctype = param.array_length_type;
+                       }
                        if (param.direction != ParameterDirection.IN) {
-                               length_ctype = "int*";
+                               length_ctype = "%s*".printf (length_ctype);
                        }
                        
                        for (int dim = 1; dim <= array_type.rank; dim++) {