[Spice-devel] [PATCH 2/3] use G_N_ELEMENTS instead of manually compute array size

Jonathon Jongsma jjongsma at redhat.com
Tue Feb 23 17:41:26 UTC 2016


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


On Tue, 2016-02-23 at 16:06 +0000, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/reds.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/reds.c b/server/reds.c
> index 444d7ac..e58cec5 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -880,7 +880,7 @@ static const int secondary_channels[] = {
>  static int channel_is_secondary(RedChannel *channel)
>  {
>      int i;
> -    for (i = 0 ; i <
> sizeof(secondary_channels)/sizeof(secondary_channels[0]); ++i) {
> +    for (i = 0 ; i < G_N_ELEMENTS(secondary_channels); ++i) {
>          if (channel->type == secondary_channels[i]) {
>              return TRUE;
>          }


More information about the Spice-devel mailing list