GNOME Bugzilla – Bug 730916
Gst.Iterator.find_custom generates invalid C due to missing arg
Last modified: 2014-06-12 00:45:11 UTC
Created attachment 277436 [details] [review] add missed parameter vala: add missed parameter
That's not missing, Vala uses user_data automatically. Can you please provide some example usage?
(In reply to comment #1) > That's not missing, Vala uses user_data automatically. Can you please provide > some example usage? No auto. I have a build break. Is something different between vala 0.24 and newer? src/ChannelFactory.vala:277.29-277.91: error: 1 extra arguments for `bool Gst.Iterator.find_custom (GLib.CompareFunc func, out GLib.Value elem)' if (it.find_custom ((GLib.CompareFunc)find_element, out elem, sink)) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GStreamer annotates this as (closure) for a GCompareFunc, but GCompareFunc doesn't take a closure parameters, so that should be removed. What we should probably do is use GLib.SearchFunc instead, just not sure what the generic parameters should be.
the same effect src/ChannelFactory.vala:277.45-277.74: error: Argument 1: Cannot convert from `GLib.CompareFunc' to `GLib.SearchFunc' if (it.find_custom ((GLib.CompareFunc)find_element, out elem, sink)) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/ChannelFactory.vala:277.29-277.90: error: 1 extra arguments for `bool Gst.Iterator.find_custom (GLib.SearchFunc func, out GLib.Value elem)' if (it.find_custom ((GLib.SearchFunc)find_element, out elem, sink)) {
No, the VAPI should be changed to something like public bool find_custom<A,B> (GLib.SearchFunc<A,B> func, out GLib.Value elem, B data); Optimally, though, we should make Iterator a generic so that one of those type arguments is filled in automatically: public class Iterator<T> { public void find_custom<N> (GLib.SearchFunc<T,N> func, out GLib.Value elem, N data); } I'll take a look at it soon. I want to start going through all the gstreamer vapis and clean them up.
The patch in bug #730983 includes a fix for this.
Great. It looks good. Build works. (In reply to comment #5) > if (it.find_custom ((GLib.SearchFunc)find_element, out > elem, sink)) { no cast needed anymore.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.