On Mon, 2016-09-26 at 05:18 -0400, Frediano Ziglio wrote: > > > > Hi, > > > > does it make a sense to keep the function (or is it to avoid the > > header inclusion)? What about using the macro directly ? > > > > Pavel > > > > > The macro could be misleading as it refers to the agent. > Also macro could have side effects and usually are less type safe.. ok > > But a simple inline function as > > static inline gboolean test_capability(const uint32_t *caps, int > num_caps, uint32_t cap) > { > return VD_AGENT_HAS_CAPABILITY(caps, num_caps, cap); > } > looks good > could work too. I don't think header inclusion is a bit problem in > red-channel.h. > > Frediano Thanks, Pavel > > > On Mon, 2016-09-26 at 09:12 +0100, Frediano Ziglio wrote: > > > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> > > > --- > > > server/red-channel.c | 7 +------ > > > 1 file changed, 1 insertion(+), 6 deletions(-) > > > > > > diff --git a/server/red-channel.c b/server/red-channel.c > > > index 927e6e9..27c8632 100644 > > > --- a/server/red-channel.c > > > +++ b/server/red-channel.c > > > @@ -331,12 +331,7 @@ void > > > red_channel_register_client_cbs(RedChannel > > > *channel, const ClientCbs *clien > > > > > > 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; > > > + return VD_AGENT_HAS_CAPABILITY(caps, num_caps, cap); > > > } > > > > > > static void add_capability(uint32_t **caps, int *num_caps, > > > uint32_t > > > cap) > > > > > > > _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel