[PATCH spice-server 2/2] red-qxl: Enforce boolean for QXLDevSurfaceCreate::mouse_mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In some cases mouse_mode is a bit field.
However for this structure is used always as a boolean
value.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/red-qxl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/red-qxl.c b/server/red-qxl.c
index e386ba629..8cf09d9a8 100644
--- a/server/red-qxl.c
+++ b/server/red-qxl.c
@@ -349,7 +349,8 @@ void red_qxl_create_primary_surface_complete(QXLState *qxl_state, const QXLDevSu
 {
     qxl_state->x_res = surface->width;
     qxl_state->y_res = surface->height;
-    qxl_state->use_hardware_cursor = surface->mouse_mode;
+    // mouse_mode is a boolean value, enforce it
+    qxl_state->use_hardware_cursor = !!surface->mouse_mode;
     qxl_state->primary_active = TRUE;
 
     reds_update_client_mouse_allowed(qxl_state->reds);
-- 
2.13.6

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]