[vapi/gio-2.0] incompatible pointer type for g_tls_client_connection_new
When using
TlsClientConnection.@new([...])
it is compiled to
_tmp7_ = g_tls_client_connection_new (_tmp5_, _tmp6_, &_inner_error0_);
which causes the compiler warning
warning: incompatible pointer types assigning to 'GTlsClientConnection *' (aka 'struct _GTlsClientConnection *') from 'GIOStream *' (aka 'struct _GIOStream *') [-Wincompatible-pointer-types]
Possible work around would be to change vapi to something like:
[CCode (cname = "g_tls_client_connection_new_vala")]
public static GLib.TlsClientConnection? @new (GLib.IOStream base_io_stream, GLib.SocketConnectable? server_identity) throws GLib.Error {
return new_stream(base_io_stream, server_identity) as GLib.TlsClientConnection;
}
[CCode (cname = "g_tls_client_connection_new")]
private static GLib.IOStream? new_stream (GLib.IOStream base_io_stream, GLib.SocketConnectable? server_identity) throws GLib.Error;
As a side note: according to https://developer.gnome.org/gio/stable/GTlsClientConnection.html#g-tls-client-connection-new g_tls_client_connection_new
only returns NULL on error, so this could actually be a non-nullable type.
Edited by Marvin W