summaryrefslogtreecommitdiff
path: root/hw/kdrive
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2020-01-28 18:31:13 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2020-01-28 20:35:06 +0000
commit4287604425e7ff905036541829896d1ddf7c65d0 (patch)
tree76e41d66bfed521320288028e3f92cb158a2ef3a /hw/kdrive
parent65387391a551fff6fec808d48b9bf4b6181cb050 (diff)
Xephyr: Cast "red" to char* for xcb_aux_parse_color
xcb_aux_parse_color takes a non-const pointer, even though it doesn't modify the string or take ownership of its memory. Avoids the following warning from GCC: ../hw/kdrive/ephyr/hostx.c: In function ‘hostx_init’: ../hw/kdrive/ephyr/hostx.c:683:30: warning: passing argument 1 of ‘xcb_aux_parse_color’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 683 | if (!xcb_aux_parse_color("red", &red, &green, &blue)) { | ^~~~~ In file included from ../hw/kdrive/ephyr/hostx.c:50: /usr/include/xcb/xcb_aux.h:194:27: note: expected ‘char *’ but argument is of type ‘const char *’ 194 | xcb_aux_parse_color(char *color_name, | ~~~~~~^~~~~~~~~~
Diffstat (limited to 'hw/kdrive')
-rw-r--r--hw/kdrive/ephyr/hostx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 5b79407e2..6b1d3eb40 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -680,7 +680,7 @@ hostx_init(void)
}
}
- if (!xcb_aux_parse_color("red", &red, &green, &blue)) {
+ if (!xcb_aux_parse_color((char*)"red", &red, &green, &blue)) {
xcb_lookup_color_cookie_t c =
xcb_lookup_color(HostX.conn, xscreen->default_colormap, 3, "red");
xcb_lookup_color_reply_t *reply =