Re: [Vala] Stacked arrays in Vala



El 07/05/18 a las 08:43, Abderrahim Kitouni escribió:
Hi,

Le dim. 6 mai 2018 à 19:33, rastersoft <raster rastersoft com <mailto:raster rastersoft com>> a écrit :

    An extra tip about the problem: I tried to use

         uint8[,] Property;

    and it seems to work as long as the outmost array has zero or one
    entries; if there are two or more entries, it gives trash.


This should be the thing to do. If it doesn't work, then it is a bug.
Do you get something similar to https://bugzilla.gnome.org/show_bug.cgi?id=735437 ? Does the patch there fix your problem?


No, it's not the same error. It "seems" to work in the sense that there are neither warnings nor errors, but if I print the contents, they are truncated because it is supposed that the size of each member must be the same, but it uses the size of the first one always.

Example: if I receive an AAY which contains two sequences with different size, like [[8,45,7,32],[10, 56,8,9,234,22,45,45,23,8,10]], the array will have two rows (which is fine), but the first one will contain the first 5 (yes, one more than the size of the first sequence) numbers of the second sequence, plus an "odd character" that is like an "V" in UTF-8, and the second one contains the 5 next numbers of the second sequence (and the same "odd character"), and the first sequence will be completely lost.

Anyway, using:

    [DBus (signature = "aay")]
    public abstract Variant Property { owned get; }

works fine, so, at least, there is a workaround.


Abderrahim




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]