[Spice-commits] 2 commits - src/channel-base.c src/channel-cursor.c src/channel-display-gst.c src/decode-glz.c src/qmp-port.c src/spice-channel-cache.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 4 08:44:51 UTC 2018


 src/channel-base.c        |   11 +++++++----
 src/channel-cursor.c      |    2 +-
 src/channel-display-gst.c |    3 ++-
 src/decode-glz.c          |    8 ++++----
 src/qmp-port.c            |    2 +-
 src/spice-channel-cache.h |    1 -
 6 files changed, 15 insertions(+), 12 deletions(-)

New commits:
commit d1e9df19f57619fe5f2bfc549e97809bbfe97a22
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Oct 4 10:30:31 2018 +0200

    mingw: Fix compilation breakage because of memmem use
    
    mingw does not provide memmem. Since the qmp data is JSON, it won't
    contain embedded nul characters, we can use strstr instead of
    memmem.
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Marc-André Lureau <marcandre.lureau at gmail.com>

diff --git a/src/qmp-port.c b/src/qmp-port.c
index c91f967..d3a08ec 100644
--- a/src/qmp-port.c
+++ b/src/qmp-port.c
@@ -160,7 +160,7 @@ spice_qmp_handle_port_data(SpiceQmpPort *self, gpointer data,
     }
 
     str = qmp->str;
-    while ((crlf = memmem(str, qmp->len - (str - qmp->str), "\r\n", 2))) {
+    while ((crlf = strstr(str, "\r\n")) != NULL) {
         GError *err = NULL;
 
         *crlf = '\0';
commit a2ffc3e9ba6f169c8e5ea4c7d66c1366b47f7ef4
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Oct 4 10:30:30 2018 +0200

    mingw: Use G_GUINT64_FORMAT with glib printing functions
    
    mingw builds currently trigger a few warnings:
    ../../src/channel-cursor.c: In function 'set_cursor':
    ../../src/channel-cursor.c:392:210: warning: 'I' flag used with '%x' gnu_printf format [-Wformat=]
         CHANNEL_DEBUG(channel, "type %s(%d), %" PRIx64 ", %dx%d",
    ../../src/channel-cursor.c:392:210: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=]
    
    See this glib commit for a related issue https://gitlab.gnome.org/GNOME/glib/commit/3d7cde654c4c6f3bdad32f5521f28f5802a7c377
    and this comment in glib bugzilla for a lot of details
    https://bugzilla.gnome.org/show_bug.cgi?id=795569#c7
    
    This commit switches to using the format specifiers provided by glib
    instead which won't have the same issue as PRIx64
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/src/channel-base.c b/src/channel-base.c
index 15f25d2..d8fe769 100644
--- a/src/channel-base.c
+++ b/src/channel-base.c
@@ -87,7 +87,7 @@ spice_channel_handle_disconnect(SpiceChannel *channel, SpiceMsgIn *in)
 {
     SpiceMsgDisconnect *disconnect = spice_msg_in_parsed(in);
 
-    CHANNEL_DEBUG(channel, "%s: ts: %" PRIu64", reason: %u", __FUNCTION__,
+    CHANNEL_DEBUG(channel, "%s: ts: %" G_GUINT64_FORMAT", reason: %u", __FUNCTION__,
                   disconnect->time_stamp, disconnect->reason);
 }
 
@@ -127,11 +127,14 @@ void spice_channel_handle_wait_for_channels(SpiceChannel *channel, SpiceMsgIn *i
             .channel = channel
         };
 
-        CHANNEL_DEBUG(channel, "waiting for serial %" PRIu64 " (%d/%d)", data.wait->message_serial, i + 1, wfc->wait_count);
+        CHANNEL_DEBUG(channel, "waiting for serial %" G_GUINT64_FORMAT " (%d/%d)",
+                      data.wait->message_serial, i + 1, wfc->wait_count);
         if (g_coroutine_condition_wait(&c->coroutine, wait_for_channel, &data))
-            CHANNEL_DEBUG(channel, "waiting for serial %"  PRIu64 ", done", data.wait->message_serial);
+            CHANNEL_DEBUG(channel, "waiting for serial %"  G_GUINT64_FORMAT ", done",
+                          data.wait->message_serial);
         else
-            CHANNEL_DEBUG(channel, "waiting for serial %" PRIu64 ", cancelled", data.wait->message_serial);
+            CHANNEL_DEBUG(channel, "waiting for serial %" G_GUINT64_FORMAT ", cancelled",
+                          data.wait->message_serial);
     }
 }
 
diff --git a/src/channel-cursor.c b/src/channel-cursor.c
index 0e19206..459fc5a 100644
--- a/src/channel-cursor.c
+++ b/src/channel-cursor.c
@@ -389,7 +389,7 @@ static display_cursor *set_cursor(SpiceChannel *channel, SpiceCursor *scursor)
     if (scursor->flags & SPICE_CURSOR_FLAGS_NONE)
         return NULL;
 
-    CHANNEL_DEBUG(channel, "%s: type %s(%d), %" PRIx64 ", %dx%d", __FUNCTION__,
+    CHANNEL_DEBUG(channel, "%s: type %s(%d), %" G_GINT64_MODIFIER "x, %dx%d", __FUNCTION__,
                   cursor_type_to_string(hdr->type), hdr->type, hdr->unique,
                   hdr->width, hdr->height);
 
diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
index 3b306c1..13a024a 100644
--- a/src/channel-display-gst.c
+++ b/src/channel-display-gst.c
@@ -338,7 +338,8 @@ static gboolean handle_pipeline_message(GstBus *bus, GstMessage *msg, gpointer v
         if (gst_is_video_overlay_prepare_window_handle_message(msg)) {
             GstVideoOverlay *overlay;
 
-            SPICE_DEBUG("prepare-window-handle msg received (handle: %" PRIuPTR ")", decoder->win_handle);
+            SPICE_DEBUG("prepare-window-handle msg received (handle: %" G_GUINTPTR_FORMAT")",
+                        decoder->win_handle);
             if (decoder->win_handle != 0) {
                 overlay = GST_VIDEO_OVERLAY(GST_MESSAGE_SRC(msg));
                 gst_video_overlay_set_window_handle(overlay, decoder->win_handle);
diff --git a/src/decode-glz.c b/src/decode-glz.c
index 9091ea9..9132b05 100644
--- a/src/decode-glz.c
+++ b/src/decode-glz.c
@@ -346,10 +346,10 @@ static void decode_header(GlibGlzDecoder *d)
     d->image.id = decode_64(d);
     d->image.win_head_dist = decode_32(d);
 
-    SPICE_DEBUG("%s: %ux%u, id %" PRIu64 ", ref %" PRIu64,
-            __FUNCTION__,
-            d->image.width, d->image.height, d->image.id,
-            d->image.id - d->image.win_head_dist);
+    SPICE_DEBUG("%s: %ux%u, id %" G_GUINT64_FORMAT ", ref %" G_GUINT64_FORMAT,
+                __FUNCTION__,
+                d->image.width, d->image.height, d->image.id,
+                d->image.id - d->image.win_head_dist);
 }
 
 static void decode(SpiceGlzDecoder *decoder,
diff --git a/src/spice-channel-cache.h b/src/spice-channel-cache.h
index fc25c35..e6e01e1 100644
--- a/src/spice-channel-cache.h
+++ b/src/spice-channel-cache.h
@@ -18,7 +18,6 @@
 #ifndef SPICE_CHANNEL_CACHE_H_
 # define SPICE_CHANNEL_CACHE_H_
 
-#include <inttypes.h> /* For PRIx64 */
 #include "common/mem.h"
 #include "common/ring.h"
 


More information about the Spice-commits mailing list