[Piglit] [PATCH 05/13] texture-integer-glsl130: Use ARRAY_SIZE().
Eric Anholt
eric at anholt.net
Sat Oct 15 13:19:34 PDT 2011
---
.../ext_texture_integer/texture-integer-glsl130.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/tests/spec/ext_texture_integer/texture-integer-glsl130.c b/tests/spec/ext_texture_integer/texture-integer-glsl130.c
index 934b761..49291bc 100644
--- a/tests/spec/ext_texture_integer/texture-integer-glsl130.c
+++ b/tests/spec/ext_texture_integer/texture-integer-glsl130.c
@@ -30,9 +30,6 @@
#include "piglit-util.h"
-#define ELEMENTS(ARRAY) (sizeof(ARRAY) / sizeof(ARRAY[0]))
-
-
int piglit_width = 100, piglit_height = 100;
int piglit_window_mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE;
@@ -97,9 +94,6 @@ static const struct format_info Formats[] = {
};
-#define NUM_FORMATS (sizeof(Formats) / sizeof(Formats[0]))
-
-
static const char *FragShaderText =
"#version 130\n"
"uniform vec4 bias; \n"
@@ -373,7 +367,7 @@ test_general_formats(void)
{
int f, i;
- for (f = 0; f < NUM_FORMATS; f++) {
+ for (f = 0; f < ARRAY_SIZE(Formats); f++) {
for (i = 0; i < 5; i++) {
if (!test_format(&Formats[f]))
return GL_FALSE;
@@ -405,7 +399,7 @@ test_specific_formats(void)
while (glGetError() != GL_NO_ERROR)
;
- for (i = 0; i < ELEMENTS(formats); i++) {
+ for (i = 0; i < ARRAY_SIZE(formats); i++) {
glTexImage2D(GL_TEXTURE_2D, 0, formats[i].intFormat,
16, 16, 0,
formats[i].srcFormat, formats[i].srcType, NULL);
--
1.7.7
More information about the Piglit
mailing list