From: Rico Tzschichholz Date: Wed, 31 Oct 2018 16:12:50 +0000 (+0100) Subject: girwriter: Remove hardcoded "int" length type and use ArrayType.length_type X-Git-Tag: 0.43.1~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54841543d926621d547e811ea9d3a1995f146682;p=thirdparty%2Fvala.git girwriter: Remove hardcoded "int" length type and use ArrayType.length_type --- diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala index cab520ac6..834396cf2 100644 --- a/codegen/valagirwriter.vala +++ b/codegen/valagirwriter.vala @@ -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;