[Piglit] [PATCH 2/2] arb_copy_image-formats: use ARRAY_SIZE() macro

Brian Paul brianp at vmware.com
Fri Jun 10 19:01:27 UTC 2016


---
 tests/spec/arb_copy_image/formats.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/spec/arb_copy_image/formats.c b/tests/spec/arb_copy_image/formats.c
index 14271d0..381650a 100644
--- a/tests/spec/arb_copy_image/formats.c
+++ b/tests/spec/arb_copy_image/formats.c
@@ -179,7 +179,6 @@ static const struct texture_format formats[] = {
 #undef FORMAT
 };
 
-#define ARRAY_LENGTH(X) (sizeof(X)/sizeof(*(X)))
 
 static const struct texture_format *
 find_format(const char *str)
@@ -926,7 +925,7 @@ piglit_display(void)
 		src_format_count = 1;
 	} else {
 		src_format_list = formats;
-		src_format_count = ARRAY_LENGTH(formats);
+		src_format_count = ARRAY_SIZE(formats);
 	}
 
 	if (dst_format_arg) {
@@ -934,7 +933,7 @@ piglit_display(void)
 		dst_format_count = 1;
 	} else {
 		dst_format_list = formats;
-		dst_format_count = ARRAY_LENGTH(formats);
+		dst_format_count = ARRAY_SIZE(formats);
 	}
 
 	for (sf = 0; sf < src_format_count; ++sf) {
-- 
1.9.1



More information about the Piglit mailing list