[Vala] Sorting a GLib.List<string>



What function should I use to sort a list of strings to avoid the compiler warning I get with strcmp:

  ...
  my_list.sort( strcmp );
  ...

Test.vala:60: warning: passing argument 2 of ‘g_list_sort’ from incompatible pointer type /usr/include/glib-2.0/glib/glist.h:101: note: expected ‘GCompareFunc’ but argument is of type ‘int (*)(const char *, const char *)’

/M

--
Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org          Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe

Attachment: signature.asc
Description: OpenPGP digital signature



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