[Spice-devel] [PATCH spice-server] cursor-channel: Change cursor_visible type to bool

Victor Toso victortoso at redhat.com
Mon May 22 13:26:08 UTC 2017


On Mon, May 22, 2017 at 11:41:01AM +0100, Frediano Ziglio wrote:
> The variable is used to store a boolean type.
> Update style for this boolean variable.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
> ---
>  server/cursor-channel.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/server/cursor-channel.c b/server/cursor-channel.c
> index 9d21962..6aea64a 100644
> --- a/server/cursor-channel.c
> +++ b/server/cursor-channel.c
> @@ -41,7 +41,7 @@ struct CursorChannel
>      CommonGraphicsChannel parent;
>  
>      CursorItem *item;
> -    int cursor_visible;
> +    bool cursor_visible;
>      SpicePoint16 cursor_position;
>      uint16_t cursor_trail_length;
>      uint16_t cursor_trail_frequency;
> @@ -309,7 +309,7 @@ CursorChannel* cursor_channel_new(RedsState *server, QXLInstance *qxl,
>  void cursor_channel_process_cmd(CursorChannel *cursor, RedCursorCmd *cursor_cmd)
>  {
>      CursorItem *cursor_item;
> -    int cursor_show = FALSE;
> +    bool cursor_show = false;
>      QXLInstance *qxl;
>  
>      spice_return_if_fail(cursor);
> @@ -320,16 +320,16 @@ void cursor_channel_process_cmd(CursorChannel *cursor, RedCursorCmd *cursor_cmd)
>  
>      switch (cursor_cmd->type) {
>      case QXL_CURSOR_SET:
> -        cursor->cursor_visible = cursor_cmd->u.set.visible;
> +        cursor->cursor_visible = !!cursor_cmd->u.set.visible;
>          cursor_channel_set_item(cursor, cursor_item);
>          break;
>      case QXL_CURSOR_MOVE:
>          cursor_show = !cursor->cursor_visible;
> -        cursor->cursor_visible = TRUE;
> +        cursor->cursor_visible = true;
>          cursor->cursor_position = cursor_cmd->u.position;
>          break;
>      case QXL_CURSOR_HIDE:
> -        cursor->cursor_visible = FALSE;
> +        cursor->cursor_visible = false;
>          break;
>      case QXL_CURSOR_TRAIL:
>          cursor->cursor_trail_length = cursor_cmd->u.trail.length;
> @@ -358,7 +358,7 @@ void cursor_channel_reset(CursorChannel *cursor)
>      spice_return_if_fail(cursor);
>  
>      cursor_channel_set_item(cursor, NULL);
> -    cursor->cursor_visible = TRUE;
> +    cursor->cursor_visible = true;
>      cursor->cursor_position.x = cursor->cursor_position.y = 0;
>      cursor->cursor_trail_length = cursor->cursor_trail_frequency = 0;
>  
> @@ -455,6 +455,6 @@ cursor_channel_class_init(CursorChannelClass *klass)
>  static void
>  cursor_channel_init(CursorChannel *self)
>  {
> -    self->cursor_visible = TRUE;
> +    self->cursor_visible = true;
>      self->mouse_mode = SPICE_MOUSE_MODE_SERVER;
>  }
> -- 
> 2.9.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170522/a014e3b1/attachment.sig>


More information about the Spice-devel mailing list