r300: use ARRAY_SIZE macro
authorEric Engestrom <eric.engestrom@imgtec.com>
Wed, 6 Sep 2017 10:20:46 +0000 (11:20 +0100)
committerEric Engestrom <eric.engestrom@imgtec.com>
Fri, 8 Sep 2017 09:29:40 +0000 (10:29 +0100)
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/r300/compiler/r300_fragprog_swizzle.c

index 075eac50f7d4094633a62a58f11873c811739557..3ec5a42c72efe25accfb14d355b85b0006adbff2 100644 (file)
@@ -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.