From: Eric Engestrom Date: Wed, 6 Sep 2017 10:20:46 +0000 (+0100) Subject: r300: use ARRAY_SIZE macro X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db8c5ae853ea34f17ef94c5a873c0cca8231f353;p=mesa.git r300: use ARRAY_SIZE macro Signed-off-by: Eric Engestrom Reviewed-by: Marek Olšák --- diff --git a/src/gallium/drivers/r300/compiler/r300_fragprog_swizzle.c b/src/gallium/drivers/r300/compiler/r300_fragprog_swizzle.c index 075eac50f7d..3ec5a42c72e 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 +#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.