]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girwriter: Remove hardcoded "int" length type and use ArrayType.length_type
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 31 Oct 2018 16:12:50 +0000 (17:12 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 2 Nov 2018 13:24:10 +0000 (14:24 +0100)
codegen/valagirwriter.vala

index cab520ac61c724102d74e199b9cead04c255b766..834396cf260103477356ca9a7b835337c652cf15 100644 (file)
@@ -831,9 +831,8 @@ public class Vala.GIRWriter : CodeVisitor {
 
        private void write_implicit_params (DataType? type, ref int index, bool has_array_length, string? name, ParameterDirection direction) {
                if (type is ArrayType && has_array_length) {
-                       var int_type = new IntegerType (context.root.scope.lookup ("int") as Struct);
                        for (var i = 0; i < ((ArrayType) type).rank; i++) {
-                               write_param_or_return (int_type, true, ref index, has_array_length, "%s_length%i".printf (name, i + 1), null, direction);
+                               write_param_or_return (((ArrayType) type).length_type, true, ref index, has_array_length, "%s_length%i".printf (name, i + 1), null, direction);
                        }
                } else if (type is DelegateType) {
                        var deleg_type = (DelegateType) type;