[wing/wip/nacho/poll-stream] More fixes
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [wing/wip/nacho/poll-stream] More fixes
- Date: Wed, 28 Nov 2018 15:26:30 +0000 (UTC)
commit dba7ffc53409608ee6df0fde7b6c24a964f18c3a
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date: Wed Nov 28 16:24:34 2018 +0100
More fixes
wing/winginputstream.c | 36 +++++++++++++++++++++++++++---------
1 file changed, 27 insertions(+), 9 deletions(-)
---
diff --git a/wing/winginputstream.c b/wing/winginputstream.c
index 354f828..d3d642d 100644
--- a/wing/winginputstream.c
+++ b/wing/winginputstream.c
@@ -290,20 +290,26 @@ wing_input_stream_init (WingInputStream *wing_stream)
static gboolean
wing_input_stream_pollable_is_readable (GPollableInputStream *pollable)
{
- WingInputStream *input_stream = WING_INPUT_STREAM (pollable);
+ WingInputStream *wing_stream = WING_INPUT_STREAM (pollable);
+ WingInputStreamPrivate *priv;
+
+ priv = wing_input_stream_get_instance_private (wing_stream);
- return WaitForSingleObject (input_stream->priv->overlapped.hEvent, 0) == WAIT_OBJECT_0
+ return WaitForSingleObject (priv->overlapped.hEvent, 0) == WAIT_OBJECT_0;
}
static GSource *
wing_input_stream_pollable_create_source (GPollableInputStream *pollable,
GCancellable *cancellable)
{
- WingInputStream *input_stream = WING_INPUT_STREAM (pollable);
+ WingInputStream *wing_stream = WING_INPUT_STREAM (pollable);
+ WingInputStreamPrivate *priv;
GSource *handle_source, *pollable_source;
+ priv = wing_input_stream_get_instance_private (wing_stream);
+
pollable_source = g_pollable_source_new (G_OBJECT (input_stream));
- handle_source = wing_create_source (input_stream->priv->overlapped.hEvent,
+ handle_source = wing_create_source (priv->overlapped.hEvent,
G_IO_IN, cancellable);
g_source_set_dummy_callback (handle_source);
g_source_add_child_source (pollable_source, handle_source);
@@ -366,14 +372,18 @@ wing_input_stream_new (void *handle,
*/
void
wing_input_stream_set_close_handle (WingInputStream *stream,
- gboolean close_handle)
+ gboolean close_handle)
{
+ WingInputStreamPrivate *priv;
+
g_return_if_fail (G_IS_WIN32_INPUT_STREAM (stream));
+ priv = wing_input_stream_get_instance_private (stream);
+
close_handle = close_handle != FALSE;
- if (stream->priv->close_handle != close_handle)
+ if (priv->close_handle != close_handle)
{
- stream->priv->close_handle = close_handle;
+ priv->close_handle = close_handle;
g_object_notify (G_OBJECT (stream), "close-handle");
}
}
@@ -390,9 +400,13 @@ wing_input_stream_set_close_handle (WingInputStream *stream,
gboolean
wing_input_stream_get_close_handle (WingInputStream *stream)
{
+ WingInputStreamPrivate *priv;
+
g_return_val_if_fail (G_IS_WIN32_INPUT_STREAM (stream), FALSE);
- return stream->priv->close_handle;
+ priv = wing_input_stream_get_instance_private (stream);
+
+ return priv->close_handle;
}
/**
@@ -406,7 +420,11 @@ wing_input_stream_get_close_handle (WingInputStream *stream)
void *
wing_input_stream_get_handle (WingInputStream *stream)
{
+ WingInputStreamPrivate *priv;
+
g_return_val_if_fail (G_IS_WIN32_INPUT_STREAM (stream), NULL);
- return stream->priv->handle;
+ priv = wing_input_stream_get_instance_private (stream);
+
+ return priv->handle;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]