GNOME Bugzilla – Bug 686338
qsort_with_data have incorrect bindings
Last modified: 2014-01-29 20:17:18 UTC
Instead of: private static void qsort_with_data<T> (T[] elems, size_t size, [CCode (type = "GCompareDataFunc")] GLib.CompareDataFunc<T> compare_func); It should be: private static void qsort_with_data<T> (T[] elems, size_t size, [CCode (type = "GCompareDataFunc")] GLib.CompareDataFunc<T *> compare_func); Currently to sort array of strings (as an example) one need to do: qsort_with_data<string> (sorted_data, sizeof(string), (a, b) => {return strcmp(*(string **)a, *(string **)b);});
Didn't you have a patch for this which used a wrapper like we do for GenericArray? I hate the idea of making people write wrapper functions instead of just using functions like strcmp directly if we can avoid it.
*** This bug has been marked as a duplicate of bug 640786 ***