[Spice-commits] 4 commits - src/channel-display.c src/gio-coroutine.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Mon Apr 16 10:34:44 UTC 2018


 src/channel-display.c |    2 +-
 src/gio-coroutine.c   |    6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 761c200f130a78d62fe78cc329e90d2dba8cdebc
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Apr 13 15:44:15 2018 +0100

    channel-display: Update debug message
    
    The flags field in SpiceMsgSurfaceCreate does not only contains
    the primary flag.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/src/channel-display.c b/src/channel-display.c
index 2ea0922..5329ed0 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -1776,7 +1776,7 @@ static void display_handle_surface_create(SpiceChannel *channel, SpiceMsgIn *in)
     surface->size   = surface->height * surface->stride;
 
     if (create->flags & SPICE_SURFACE_FLAGS_PRIMARY) {
-        SPICE_DEBUG("primary flags: %x", create->flags);
+        SPICE_DEBUG("surface flags: %x", create->flags);
         surface->primary = true;
         create_canvas(channel, surface);
         if (c->mark_false_event_id != 0) {
commit 46d78d3ebe988a7c2ba21ebf678d9c2f20587c2d
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Apr 13 15:42:50 2018 +0100

    gio-coroutine: Remove only assigned self field
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/src/gio-coroutine.c b/src/gio-coroutine.c
index 86623c3..59ae06c 100644
--- a/src/gio-coroutine.c
+++ b/src/gio-coroutine.c
@@ -25,7 +25,6 @@
 typedef struct _GConditionWaitSource
 {
     GSource parent; // this MUST be the first field
-    GCoroutine *self;
     GConditionWaitFunc func;
     gpointer data;
 } GConditionWaitSource;
@@ -167,7 +166,6 @@ gboolean g_coroutine_condition_wait(GCoroutine *self, GConditionWaitFunc func, g
 
     vsrc->func = func;
     vsrc->data = data;
-    vsrc->self = self;
 
     self->condition_id = g_source_attach(src, NULL);
     g_source_set_callback(src, g_condition_wait_helper, self, NULL);
commit 5f3e58035f752b83a8102921ce43ac8217bbb98e
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Apr 13 15:22:18 2018 +0100

    gio-coroutine: Make waitFuncs static
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/src/gio-coroutine.c b/src/gio-coroutine.c
index 1322f01..86623c3 100644
--- a/src/gio-coroutine.c
+++ b/src/gio-coroutine.c
@@ -118,7 +118,7 @@ static gboolean g_condition_wait_dispatch(GSource *src G_GNUC_UNUSED,
     return cb(data);
 }
 
-GSourceFuncs waitFuncs = {
+static GSourceFuncs waitFuncs = {
     .prepare = g_condition_wait_prepare,
     .check = g_condition_wait_check,
     .dispatch = g_condition_wait_dispatch,
commit 070dea03c1d688c7fc87659a05c18c0a43160660
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Apr 13 15:21:48 2018 +0100

    gio-coroutine: Fix C inheritance
    
    GConditionWaitSource should inherit from GSource so GSource
    should be the first field.
    
    GSource is
    struct _GSource
    {
      /*< private >*/
      gpointer callback_data;
      ...
    };
    
    With GSource being opaque, the only thing which could cause issues
    was modifying GConditionWaitSource::self.
    However, GConditionWaitSource::self is precisely what we use as
    callback_data, and anyway the GSource probably sets callback_data after
    spice-gtk set GConditiionWaitSource::self. So this ends up all working
    even though this is wrong.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/src/gio-coroutine.c b/src/gio-coroutine.c
index c866e15..1322f01 100644
--- a/src/gio-coroutine.c
+++ b/src/gio-coroutine.c
@@ -24,8 +24,8 @@
 
 typedef struct _GConditionWaitSource
 {
+    GSource parent; // this MUST be the first field
     GCoroutine *self;
-    GSource src;
     GConditionWaitFunc func;
     gpointer data;
 } GConditionWaitSource;


More information about the Spice-commits mailing list