[Mesa-dev] [PATCH mesa 6/6] gallium/tests: use ARRAY_SIZE macro

Marek Olšák maraeo at gmail.com
Thu Sep 7 15:13:36 UTC 2017


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Sep 7, 2017 at 12:21 PM, Eric Engestrom
<eric.engestrom at imgtec.com> wrote:
> Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
> ---
>  src/gallium/tests/graw/fs-fragcoord.c | 4 +++-
>  src/gallium/tests/graw/fs-frontface.c | 4 +++-
>  src/gallium/tests/graw/fs-write-z.c   | 4 +++-
>  3 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/tests/graw/fs-fragcoord.c b/src/gallium/tests/graw/fs-fragcoord.c
> index cf7642c782..9afea0caa0 100644
> --- a/src/gallium/tests/graw/fs-fragcoord.c
> +++ b/src/gallium/tests/graw/fs-fragcoord.c
> @@ -7,6 +7,8 @@
>
>  #include "graw_util.h"
>
> +#include "util/macros.h"
> +
>
>  static int width = 300;
>  static int height = 300;
> @@ -44,7 +46,7 @@ static struct vertex vertices[] =
>     }
>  };
>
> -#define NUM_VERTS (sizeof(vertices) / sizeof(vertices[0]))
> +#define NUM_VERTS ARRAY_SIZE(vertices)
>
>
>  static void
> diff --git a/src/gallium/tests/graw/fs-frontface.c b/src/gallium/tests/graw/fs-frontface.c
> index 32a13cb9e2..3ad89f6b64 100644
> --- a/src/gallium/tests/graw/fs-frontface.c
> +++ b/src/gallium/tests/graw/fs-frontface.c
> @@ -5,6 +5,8 @@
>
>  #include "graw_util.h"
>
> +#include "util/macros.h"
> +
>
>  static int width = 300;
>  static int height = 300;
> @@ -65,7 +67,7 @@ static struct vertex vertices[] =
>     },
>  };
>
> -#define NUM_VERTS (sizeof(vertices) / sizeof(vertices[0]))
> +#define NUM_VERTS ARRAY_SIZE(vertices)
>
>
>
> diff --git a/src/gallium/tests/graw/fs-write-z.c b/src/gallium/tests/graw/fs-write-z.c
> index 12267ed820..196c67bc36 100644
> --- a/src/gallium/tests/graw/fs-write-z.c
> +++ b/src/gallium/tests/graw/fs-write-z.c
> @@ -7,6 +7,8 @@
>
>  #include "graw_util.h"
>
> +#include "util/macros.h"
> +
>
>  static int width = 300;
>  static int height = 300;
> @@ -69,7 +71,7 @@ static struct vertex vertices[] =
>     },
>  };
>
> -#define NUM_VERTS (sizeof(vertices) / sizeof(vertices[0]))
> +#define NUM_VERTS ARRAY_SIZE(vertices)
>
>
>
> --
> Cheers,
>   Eric
>


More information about the mesa-dev mailing list