[Spice-devel] [PATCH spice-server 06/12] Reuse SPICE_N_ELEMENTS macro

Jonathon Jongsma jjongsma at redhat.com
Wed Oct 19 21:18:32 UTC 2016


Acked-by: Jonathon Jongsma <jjongsma at redhat.com>


On Tue, 2016-10-18 at 10:09 +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-worker.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/server/red-worker.c b/server/red-worker.c
> index 3784261..f3b8c4b 100644
> --- a/server/red-worker.c
> +++ b/server/red-worker.c
> @@ -407,11 +407,11 @@ static void
> guest_set_client_capabilities(RedWorker *worker)
>          red_qxl_set_client_capabilities(worker->qxl, FALSE, caps);
>      } else {
>          // Take least common denominator
> -        for (i = 0 ; i < sizeof(caps_available) /
> sizeof(caps_available[0]); ++i) {
> +        for (i = 0 ; i < SPICE_N_ELEMENTS(caps_available); ++i) {
>              SET_CAP(caps, caps_available[i]);
>          }
>          FOREACH_CLIENT(worker->display_channel, iter, rcc) {
> -            for (i = 0 ; i < sizeof(caps_available) /
> sizeof(caps_available[0]); ++i) {
> +            for (i = 0 ; i < SPICE_N_ELEMENTS(caps_available); ++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