Re: [Vala] [vala] problem with sorting an array
- From: Ulink <ulink gmx at>
- To: vala-list gnome org
- Subject: Re: [Vala] [vala] problem with sorting an array
- Date: Wed, 29 Aug 2018 15:34:53 +0200
Hi,
I don't understand why I can't sort my array... :-/ (glib.array)
seems this is a GLib.Array compare function binding (vapi) error or
something like this.
On C level, the compare objects are putted into your compare function as
pointers to pointers and not as pointers.
For a quick and dirty workaround, change the following two lines:
int sort_by_size(ref FileAndChunks o1, ref FileAndChunks o2) { ... }
list.sort((CompareFunc)sort_by_size);
Note that after vapi fix, your code is broken again so it would be
better to fix the vapi file instead of the above workaround.
Regards,
Bernhard
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]