Re: [PATCH v2] Reuse VD_AGENT_HAS_CAPABILITY macro for bit array

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

 



On Mon, 2016-09-26 at 12:27 +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
Acked-by: Pavel Grunt <pgrunt@xxxxxxxxxx>
> ---
>  server/red-channel.c | 10 ----------
>  server/red-channel.h |  5 ++++-
>  2 files changed, 4 insertions(+), 11 deletions(-)
> 
> Changes since v1:
> - make test_capability function inline
> 
> diff --git a/server/red-channel.c b/server/red-channel.c
> index 927e6e9..af49824 100644
> --- a/server/red-channel.c
> +++ b/server/red-channel.c
> @@ -329,16 +329,6 @@ void red_channel_register_client_cbs(RedChannel
> *channel, const ClientCbs *clien
>      channel->data = cbs_data;
>  }
>  
> -int test_capability(const uint32_t *caps, int num_caps, uint32_t
> cap)
> -{
> -    uint32_t index = cap / 32;
> -    if (num_caps < index + 1) {
> -        return FALSE;
> -    }
> -
> -    return (caps[index] & (1 << (cap % 32))) != 0;
> -}
> -
>  static void add_capability(uint32_t **caps, int *num_caps, uint32_t
> cap)
>  {
>      int nbefore, n;
> diff --git a/server/red-channel.h b/server/red-channel.h
> index def5de0..fc59dee 100644
> --- a/server/red-channel.h
> +++ b/server/red-channel.h
> @@ -189,7 +189,10 @@ typedef struct RedChannelCapabilities {
>      uint32_t *caps;
>  } RedChannelCapabilities;
>  
> -int test_capability(const uint32_t *caps, int num_caps, uint32_t
> cap);
> +static inline gboolean test_capability(const uint32_t *caps, int
> num_caps, uint32_t cap)
> +{
> +    return VD_AGENT_HAS_CAPABILITY(caps, num_caps, cap);
> +}
>  
>  typedef struct RedChannelClientLatencyMonitor {
>      int state;
> 
_______________________________________________
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]