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 710103 - Async call GLib.IOStream.splice_async failed!
Async call GLib.IOStream.splice_async failed!
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator: GAsync
0.35.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
: 670029 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-10-14 13:45 UTC by Heiher
Modified: 2017-03-06 14:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
part 1 (12.92 KB, patch)
2014-02-13 21:08 UTC, Florian Brosch
committed Details | Review
part 2 (3.39 KB, patch)
2014-02-13 21:09 UTC, Florian Brosch
none Details | Review
part 3 (1.51 KB, patch)
2014-02-13 21:09 UTC, Florian Brosch
committed Details | Review
part 4 (1.76 KB, patch)
2014-02-13 21:10 UTC, Florian Brosch
committed Details | Review
part 5 (2.79 KB, patch)
2014-02-13 21:10 UTC, Florian Brosch
committed Details | Review

Description Heiher 2013-10-14 13:45:04 UTC
Hello,

vala codes:
public static int main (string args[]) {
        GLib.IOStream? is0 = null;
        GLib.IOStream? is1 = null;

        is0.splice_async.begin (is1, GLib.IOStreamSpliceFlags.NONE,
                                GLib.Priority.DEFAULT, null, (obj, res) => {
                try {
                        is0.splice_async.end (res);
                } catch (GLib.Error e) {
                }
        });

        return 0;
}

compile errors:
$ valac -X -w -o test test.vala --pkg gio-2.0
/home/heiher/work/test.vala.c: In function ‘__lambda2_’:
/home/heiher/work/test.vala.c:51:3: error: too many arguments to
function ‘g_io_stream_splice_finish’
   g_io_stream_splice_finish (_data1_->is0, _tmp0_, &_inner_error_);
   ^
In file included from /usr/include/glib-2.0/gio/gfileiostream.h:30:0,
                 from /usr/include/glib-2.0/gio/gio.h:71,
                 from /home/heiher/work/test.vala.c:9:
/usr/include/glib-2.0/gio/giostream.h:104:16: note: declared here
 gboolean       g_io_stream_splice_finish     (GAsyncResult         *result,
                ^
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)

Thx!
Comment 1 Luca Bruno 2013-11-01 11:25:16 UTC
g_io_stream_splice_finish does not have the instance parameter.
There's a fix coming soon for finish functions that don't have an instance parameter.
Comment 2 Luca Bruno 2014-01-27 20:03:37 UTC
*** Bug 670029 has been marked as a duplicate of this bug. ***
Comment 3 Florian Brosch 2014-02-13 21:08:52 UTC
Created attachment 269065 [details] [review]
part 1
Comment 4 Florian Brosch 2014-02-13 21:09:26 UTC
Created attachment 269066 [details] [review]
part 2
Comment 5 Florian Brosch 2014-02-13 21:09:59 UTC
Created attachment 269067 [details] [review]
part 3
Comment 6 Florian Brosch 2014-02-13 21:10:29 UTC
Created attachment 269068 [details] [review]
part 4
Comment 7 Florian Brosch 2014-02-13 21:10:52 UTC
Created attachment 269069 [details] [review]
part 5
Comment 8 Luca Bruno 2014-03-21 20:32:10 UTC
Review of attachment 269065 [details] [review]:

What about the proposed changes? I can apply them but I'd like to hear whether they are safe or not.

::: codegen/valaccodeattribute.vala
@@ +455,3 @@
 	}
 
+	public bool finish_instance {

I'm not very convinced here. I'd prefer to always give preference to the CCode, like it's being done with the other properties.

::: codegen/valaccodemethodcallmodule.vala
@@ +219,3 @@
 			}
 
+			if (expr.is_yield_expression) {

This is a little cryptic. If the in_arg_map is always done, put it outside the conditions. Clear out only when the out_arg_map must not be set for the finish function.