Re: [vdagent-win PATCH v3 09/10] Use enumeration types

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

 



Acked-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>


On Fri, 2018-06-29 at 08:11 +0100, Frediano Ziglio wrote:
> No reasons to allow any possible number.
> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
>  vdagent/vdagent.cpp | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
> index b3e18d9..5462d2d 100644
> --- a/vdagent/vdagent.cpp
> +++ b/vdagent/vdagent.cpp
> @@ -100,10 +100,10 @@ private:
>      void dispatch_message(VDAgentMessage* msg, uint32_t port);
>      uint32_t get_clipboard_format(uint32_t type) const;
>      uint32_t get_clipboard_type(uint32_t format) const;
> -    enum { owner_none, owner_guest, owner_client };
> -    void set_clipboard_owner(int new_owner);
> -    enum { CONTROL_STOP, CONTROL_RESET, CONTROL_DESKTOP_SWITCH,
> CONTROL_LOGON, CONTROL_CLIPBOARD };
> -    void set_control_event(int control_command);
> +    enum clipboard_owner_t { owner_none, owner_guest, owner_client
> };
> +    void set_clipboard_owner(clipboard_owner_t new_owner);
> +    enum control_command_t { CONTROL_STOP, CONTROL_RESET,
> CONTROL_DESKTOP_SWITCH, CONTROL_LOGON, CONTROL_CLIPBOARD };
> +    void set_control_event(control_command_t control_command);
>      void handle_control_event();
>      VDIChunk* new_chunk(DWORD bytes = 0);
>      void enqueue_chunk(VDIChunk* msg);
> @@ -334,7 +334,7 @@ bool VDAgent::run()
>      return true;
>  }
>  
> -void VDAgent::set_control_event(int control_command)
> +void VDAgent::set_control_event(control_command_t control_command)
>  {
>      MutexLocker lock(_control_mutex);
>      _control_queue.push(control_command);
> @@ -1195,7 +1195,7 @@ uint32_t VDAgent::get_clipboard_type(uint32_t
> format) const
>      return 0;
>  }
>  
> -void VDAgent::set_clipboard_owner(int new_owner)
> +void VDAgent::set_clipboard_owner(clipboard_owner_t new_owner)
>  {
>      // FIXME: Clear requests, clipboard data and state
>      if (new_owner == owner_none) {
> @@ -1460,7 +1460,7 @@ LRESULT CALLBACK VDAgent::wnd_proc(HWND hwnd,
> UINT message, WPARAM wparam, LPARA
>      case WM_CLIPBOARDUPDATE:
>      case WM_DRAWCLIPBOARD:
>          if (a->_hwnd != GetClipboardOwner()) {
> -            a->set_clipboard_owner(a->owner_none);
> +            a->set_clipboard_owner(owner_none);
>              a->on_clipboard_grab();
>          }
>          if (a->_hwnd_next_viewer) {
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




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