After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730916 - Gst.Iterator.find_custom generates invalid C due to missing arg
Gst.Iterator.find_custom generates invalid C due to missing arg
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings: GTK+ GStreamer WebKitGTK+
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on: 730983
Blocks: 725230
 
 
Reported: 2014-05-29 07:39 UTC by Stefan Ringel
Modified: 2014-06-12 00:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add missed parameter (1.04 KB, patch)
2014-05-29 07:39 UTC, Stefan Ringel
none Details | Review

Description Stefan Ringel 2014-05-29 07:39:31 UTC
Created attachment 277436 [details] [review]
add missed parameter

vala: add missed parameter
Comment 1 Luca Bruno 2014-05-29 07:55:16 UTC
That's not missing, Vala uses user_data automatically. Can you please provide some example usage?
Comment 2 Stefan Ringel 2014-05-29 08:05:50 UTC
(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)) {
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Comment 3 Evan Nemerson 2014-05-29 08:12:08 UTC
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.
Comment 4 Stefan Ringel 2014-05-29 08:19:35 UTC
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)) {
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Comment 5 Stefan Ringel 2014-05-29 08:53:37 UTC
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)) {
Comment 6 Evan Nemerson 2014-05-29 09:37:25 UTC
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.
Comment 7 Evan Nemerson 2014-05-30 17:19:18 UTC
The patch in bug #730983 includes a fix for this.
Comment 8 Stefan Ringel 2014-05-30 19:10:30 UTC
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.
Comment 9 Evan Nemerson 2014-06-12 00:45:11 UTC
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.