[Spice-devel] [PATCH spice-server 05/22] reds: use bool for RedsState::dispatcher_allows_client_mouse

Christophe Fergeau cfergeau at redhat.com
Fri Jun 16 12:41:13 UTC 2017


On Fri, Jun 16, 2017 at 10:13:17AM +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/reds-private.h | 2 +-
>  server/reds.c         | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/server/reds-private.h b/server/reds-private.h
> index 227827d..5aebd5c 100644
> --- a/server/reds-private.h
> +++ b/server/reds-private.h
> @@ -103,7 +103,7 @@ struct RedsState {
>      GList *channels;
>      int mouse_mode;
>      int is_client_mouse_allowed;
> -    int dispatcher_allows_client_mouse;
> +    bool dispatcher_allows_client_mouse;
>      MonitorMode monitor_mode;
>      SpiceTimer *mig_timer;
>  
> diff --git a/server/reds.c b/server/reds.c
> index 5b6bb1a..e1bac2d 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -4318,7 +4318,7 @@ void reds_core_timer_remove(RedsState *reds,
>  
>  void reds_update_client_mouse_allowed(RedsState *reds)
>  {
> -    int allow_now = FALSE;
> +    bool allow_now = false;
>      int x_res = 0;
>      int y_res = 0;
>      int num_active_workers = g_list_length(reds->qxl_instances);
> @@ -4327,10 +4327,10 @@ void reds_update_client_mouse_allowed(RedsState *reds)
>          GListIter it;
>          QXLInstance *qxl;
>  
> -        allow_now = TRUE;
> +        allow_now = true;
>          FOREACH_QXL_INSTANCE(reds, it, qxl) {
>              if (red_qxl_get_primary_active(qxl)) {
> -                allow_now = red_qxl_get_allow_client_mouse(qxl, &x_res, &y_res);
> +                allow_now = !!red_qxl_get_allow_client_mouse(qxl, &x_res, &y_res);

red_qxl_get_allow_client_mouse returns a gboolean for now, I think it
should be up to it to do the return !!foo; if needed, not to its caller.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170616/f9394960/attachment.sig>


More information about the Spice-devel mailing list