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
|
From 26ae6be2c1ac03e6ea017f58d0b126c9eebae5f9 Mon Sep 17 00:00:00 2001
From: Jason Wessel <jason.wessel@windriver.com>
Date: Fri, 2 Mar 2018 10:47:09 -0600
Subject: [PATCH] spice: Fix compile problems against spice 0.12.4 with gcc 7
These errors are generated by gcc 7.
../../git/server/red_parse_qxl.c:367:18: error: 'BITMAP_FMT_IS_RGB' defined but not used [-Werror=unused-const-variable=]
static const int BITMAP_FMT_IS_RGB[] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1};
^~~~~~~~~~~~~~~~~
../../git/server/inputs_channel.c: In function 'inputs_channel_handle_parsed':
../../git/server/inputs_channel.c:317:38: error: this statement may fall through [-Werror=implicit-fallthrough=]
case SPICE_MSGC_INPUTS_KEY_DOWN: {
^
../../git/server/inputs_channel.c:324:5: note: here
case SPICE_MSGC_INPUTS_KEY_UP: {
^~~~
../../git/server/reds.c: In function 'vdi_port_read_one_msg_from_device':
../../git/server/reds.c:797:31: error: this statement may fall through [-Werror=implicit-fallthrough=]
state->read_state = VDI_PORT_READ_STATE_GET_BUFF;
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/server/reds.c:798:9: note: here
case VDI_PORT_READ_STATE_GET_BUFF: {
^~~~
../../git/server/reds.c:807:31: error: this statement may fall through [-Werror=implicit-fallthrough=]
state->read_state = VDI_PORT_READ_STATE_READ_DATA;
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/server/reds.c:809:9: note: here
case VDI_PORT_READ_STATE_READ_DATA:
^~~~
This patch just adds the fallthrough comments which are already
checked in upstream along with the removal of the static variable
which is not used.
---
server/inputs_channel.c | 1 +
server/red_parse_qxl.c | 4 ----
server/reds.c | 2 ++
spice-common | 2 +-
4 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/server/inputs_channel.c b/server/inputs_channel.c
index 931dac1..d6805c4 100644
--- a/server/inputs_channel.c
+++ b/server/inputs_channel.c
@@ -321,6 +321,7 @@ static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, ui
activate_modifiers_watch();
}
}
+ /* fallthrough */
case SPICE_MSGC_INPUTS_KEY_UP: {
SpiceMsgcKeyDown *key_down = (SpiceMsgcKeyDown *)buf;
for (i = 0; i < 4; i++) {
diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c
index 6c0b065..c361e6b 100644
--- a/server/red_parse_qxl.c
+++ b/server/red_parse_qxl.c
@@ -362,10 +362,6 @@ static int bitmap_consistent(SpiceBitmap *bitmap)
return TRUE;
}
-// This is based on SPICE_BITMAP_FMT_*, copied from server/red_worker.c
-// to avoid a possible unoptimization from making it non static.
-static const int BITMAP_FMT_IS_RGB[] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1};
-
static SpiceImage *red_get_image(RedMemSlotInfo *slots, int group_id,
QXLPHYSICAL addr, uint32_t flags, int is_mask)
{
diff --git a/server/reds.c b/server/reds.c
index 6f262b0..4246170 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -795,6 +795,7 @@ static SpiceCharDeviceMsgToClient *vdi_port_read_one_msg_from_device(SpiceCharDe
}
state->message_recive_len = state->vdi_chunk_header.size;
state->read_state = VDI_PORT_READ_STATE_GET_BUFF;
+ /* fallthrough */
case VDI_PORT_READ_STATE_GET_BUFF: {
if (!(state->current_read_buf = vdi_port_read_buf_get())) {
return NULL;
@@ -806,6 +807,7 @@ static SpiceCharDeviceMsgToClient *vdi_port_read_one_msg_from_device(SpiceCharDe
state->message_recive_len -= state->recive_len;
state->read_state = VDI_PORT_READ_STATE_READ_DATA;
}
+ /* fallthrough */
case VDI_PORT_READ_STATE_READ_DATA:
n = sif->read(vdagent, state->recive_pos, state->recive_len);
if (!n) {
|