GNOME Bugzilla – Bug 754137
List.search wrong binding
Last modified: 2016-09-14 13:49:30 UTC
I think that the following function: [CCode (cname = "g_list_find_custom", simple_generics = true)] public unowned List<G> search<T> (T data, SearchFunc<T,G> func); in glib vapi is wrong because the g_list_find_custom documentation says? Finds an element in a GList, using a supplied function to find the desired element. It iterates over the list, calling the given function which should return 0 when the desired element is found. The function takes two gconstpointer arguments, the GList element's data as the first argument and the given user data. so the function has to be: [CCode (cname = "g_list_find_custom", simple_generics = true)] public unowned List<G> search<T> (T data, SearchFunc<G,T> func);
Created attachment 313158 [details] [review] fix search methods
Created attachment 335298 [details] [review] Amend original patch so it now applies because [Version (since = "2.4")] is now present in Queue The original patch looks fine and matches the documentation: https://developer.gnome.org/glib/stable/glib-Doubly-Linked-Lists.html#g-list-find-custom https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html#g-slist-find-custom https://developer.gnome.org/glib/stable/glib-Double-ended-Queues.html#g-queue-find-custom The first type argument to SearchFunc should be the collection element's data type. The original patch no longer applies because Version attribute is present now. This new patch just amends that so it applies.
Review of attachment 313158 [details] [review]: Patch looks good, but no longer applies. Amended patch attached separately.