[Mesa-dev] [PATCH mesa 3/6] r300: use ARRAY_SIZE macro

Marek Olšák maraeo at gmail.com
Thu Sep 7 16:10:22 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/drivers/r300/compiler/r300_fragprog_swizzle.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/r300/compiler/r300_fragprog_swizzle.c b/src/gallium/drivers/r300/compiler/r300_fragprog_swizzle.c
> index 075eac50f7..3ec5a42c72 100644
> --- a/src/gallium/drivers/r300/compiler/r300_fragprog_swizzle.c
> +++ b/src/gallium/drivers/r300/compiler/r300_fragprog_swizzle.c
> @@ -35,6 +35,8 @@
>
>  #include <stdio.h>
>
> +#include "util/macros.h"
> +
>  #include "r300_reg.h"
>  #include "radeon_compiler.h"
>
> @@ -61,7 +63,7 @@ static const struct swizzle_data native_swizzles[] = {
>         {MAKE_SWZ3(HALF, HALF, HALF), R300_ALU_ARGC_HALF, 0, 0}
>  };
>
> -static const int num_native_swizzles = sizeof(native_swizzles)/sizeof(native_swizzles[0]);
> +static const int num_native_swizzles = ARRAY_SIZE(native_swizzles);
>
>  /**
>   * Find a native RGB swizzle that matches the given swizzle.
> --
> Cheers,
>   Eric
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list