aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/spice/spice/0001-Fix-compile-errors-on-Linux-32bit-system.patch
blob: d04bee95fa198260177d0b26db2c2d44ef319a88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
From a2af005b5d4a62839e56f42a43df793356e78f58 Mon Sep 17 00:00:00 2001
From: "Hongzhi.Song" <hongzhi.song@windriver.com>
Date: Tue, 4 Jun 2019 03:58:17 -0400
Subject: [PATCH] Fix compile errors on Linux 32bit system

There are folowing compile errors on Linux 32bit system:

red-channel.c:207:73: error: format '%x' expects argument of type
'unsigned int', but argument 7 has type 'long unsigned int' [-Werror=format=]
|207| red_channel_debug(self, "thread_id 0x%" G_GSIZE_MODIFIER "x",
                                ~~~~~~~~~~~~~~~~~~~~~^
                        self->priv->thread_id);
                ~~~~~~~~~~~~~~~~~~~~~^

On 32bit system, #define G_GSIZE_MODIFIER "". But the type of
'self->priv->thread_id' is 'unsigned long int' which should match '%lx'
not '%x'.

So we should recovery the <0x%" G_GSIZE_MODIFIER "x"> to <0x%lx">.
And others files modification are similar to G_GSIZE_MODIFIER.

Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
---
Upstream-Status: Submitted [https://lists.freedesktop.org/archives/spice-devel/2019-June/049285.html]

 server/red-channel.c    | 6 +++---
 server/red-client.c     | 8 ++++----
 server/red-replay-qxl.c | 2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/server/red-channel.c b/server/red-channel.c
index f81142d..6a03ec2 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -202,7 +202,7 @@ red_channel_constructed(GObject *object)
 {
     RedChannel *self = RED_CHANNEL(object);
 
-    red_channel_debug(self, "thread_id 0x%" G_GSIZE_MODIFIER "x", (unsigned long)self->priv->thread_id);
+    red_channel_debug(self, "thread_id 0x%lx", (unsigned long)self->priv->thread_id);
 
     RedChannelClass *klass = RED_CHANNEL_GET_CLASS(self);
 
@@ -473,8 +473,8 @@ void red_channel_remove_client(RedChannel *channel, RedChannelClient *rcc)
 
     if (!pthread_equal(pthread_self(), channel->priv->thread_id)) {
         red_channel_warning(channel,
-                            "channel->thread_id (0x%" G_GSIZE_MODIFIER "x) != "
-                            "pthread_self (0x%" G_GSIZE_MODIFIER "x)."
+                            "channel->thread_id (0x%lx) != "
+                            "pthread_self (0x%lx)."
                             "If one of the threads is != io-thread && != vcpu-thread, "
                             "this might be a BUG",
                             (unsigned long)channel->priv->thread_id,
diff --git a/server/red-client.c b/server/red-client.c
index 2b859cb..ff4da2a 100644
--- a/server/red-client.c
+++ b/server/red-client.c
@@ -174,8 +174,8 @@ void red_client_migrate(RedClient *client)
     RedChannel *channel;
 
     if (!pthread_equal(pthread_self(), client->thread_id)) {
-        spice_warning("client->thread_id (0x%" G_GSIZE_MODIFIER "x) != "
-                      "pthread_self (0x%" G_GSIZE_MODIFIER "x)."
+        spice_warning("client->thread_id (0x%lx) != "
+                      "pthread_self (0x%lx)."
                       "If one of the threads is != io-thread && != vcpu-thread,"
                       " this might be a BUG",
                       (unsigned long)client->thread_id, (unsigned long)pthread_self());
@@ -193,8 +193,8 @@ void red_client_destroy(RedClient *client)
     RedChannelClient *rcc;
 
     if (!pthread_equal(pthread_self(), client->thread_id)) {
-        spice_warning("client->thread_id (0x%" G_GSIZE_MODIFIER "x) != "
-                      "pthread_self (0x%" G_GSIZE_MODIFIER "x)."
+        spice_warning("client->thread_id (0x%lx) != "
+                      "pthread_self (0x%lx)."
                       "If one of the threads is != io-thread && != vcpu-thread,"
                       " this might be a BUG",
                       (unsigned long)client->thread_id,
diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
index 6d34818..0deb406 100644
--- a/server/red-replay-qxl.c
+++ b/server/red-replay-qxl.c
@@ -264,7 +264,7 @@ static replay_t read_binary(SpiceReplay *replay, const char *prefix, size_t *siz
             exit(1);
         }
         if ((ret = inflate(&strm, Z_NO_FLUSH)) != Z_STREAM_END) {
-            spice_error("inflate error %d (disc: %" G_GSSIZE_FORMAT ")",
+            spice_error("inflate error %d (disc: %li)",
                         ret, *size - strm.total_out);
             if (ret == Z_DATA_ERROR) {
                 /* last operation may be wrong. since we do the recording
-- 
2.8.1