[Spice-devel] [PATCH spice-server 1a/3] red-channel: Use directly a GArray to pass capabilities

Christophe Fergeau cfergeau at redhat.com
Tue Feb 28 15:01:57 UTC 2017


On Tue, Feb 28, 2017 at 09:43:33AM +0000, Frediano Ziglio wrote:
> Capabilities where almost always passed using 2 arguments,
> a number of elements and an array but then before using
> these were converted to a GArray.
> Converting to GArray much earlier allows to easily pass
> the capabilities around.

Hey, nice improvement!

> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> I don't know if is worth defining an abstract type
> instead of using a simple GArray.
> Maybe a "typedef GArray RedCapabilities" could help future
> replacement of the GArray?

There's already a RedChannelCapabilities in red-channel.h, I'd reuse
this one.

> On the other side this patch moves most of the array boxing
> into a single function.

I'd create the GArray one level higher, in reds_channel_do_link() rather
than red_channel_connect, let reds.c do the grunt work, and have
RedChannel deal with higher level types.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170228/5939cf26/attachment.sig>


More information about the Spice-devel mailing list