[Spice-devel] [PATCH] Avoid double conversion

Uri Lublin uril at redhat.com
Thu May 26 14:29:56 UTC 2016


On 05/26/2016 02:25 PM, Frediano Ziglio wrote:
> Avoid converting from RedChannelClient* to DisplayChannelClient* and
> DisplayChannelClient* to RedChannelClient* just to use RedChannelClient*.

Ack.

Consider adding to the commit log that 'channel->clients' is a list
of RedChannelClients.

Uri.

>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-worker.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/server/red-worker.c b/server/red-worker.c
> index 3603025..aee6f28 100644
> --- a/server/red-worker.c
> +++ b/server/red-worker.c
> @@ -498,7 +498,6 @@ CommonGraphicsChannel *red_worker_new_channel(RedWorker *worker, int size,
>  static void guest_set_client_capabilities(RedWorker *worker)
>  {
>      int i;
> -    DisplayChannelClient *dcc;
>      RedChannelClient *rcc;
>      GList *link, *next;
>      uint8_t caps[SPICE_CAPABILITIES_SIZE] = { 0 };
> @@ -533,8 +532,7 @@ static void guest_set_client_capabilities(RedWorker *worker)
>          for (i = 0 ; i < sizeof(caps_available) / sizeof(caps_available[0]); ++i) {
>              SET_CAP(caps, caps_available[i]);
>          }
> -        FOREACH_CLIENT(worker->display_channel, link, next, dcc) {
> -            rcc = (RedChannelClient *)dcc;
> +        FOREACH_CLIENT(worker->display_channel, link, next, rcc) {
>              for (i = 0 ; i < sizeof(caps_available) / sizeof(caps_available[0]); ++i) {
>                  if (!red_channel_client_test_remote_cap(rcc, caps_available[i]))
>                      CLEAR_CAP(caps, caps_available[i]);
>



More information about the Spice-devel mailing list