mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 14:41:25 +00:00
Reuse VD_AGENT_HAS_CAPABILITY macro for bit array
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
This commit is contained in:
parent
435daaffdb
commit
46a4543d9d
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user