summaryrefslogtreecommitdiff
path: root/tests/shaders/vp-address-02.c
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2012-01-25 14:34:00 -0800
committerPaul Berry <stereotype441@gmail.com>2012-01-27 10:24:59 -0800
commit90e906e817879b499594023794761c9bcb98d9dd (patch)
tree271365cfcf535a8e7b1fd2cadef8a1ee4adcc6e3 /tests/shaders/vp-address-02.c
parentd6ce2ad3f212934882049efb681292818062750b (diff)
Change ELEMENTS macros to ARRAY_SIZE.
The ELEMENTS() macro is defined in several parts of Piglit. An equivalent macro, ARRAY_SIZE(), already exists in piglit-util.h. This patch eliminates all of the definitions of ELEMENTS() and replaces their uses with ARRAY_SIZE(). Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'tests/shaders/vp-address-02.c')
-rw-r--r--tests/shaders/vp-address-02.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/shaders/vp-address-02.c b/tests/shaders/vp-address-02.c
index 19cb57af5..28a69174f 100644
--- a/tests/shaders/vp-address-02.c
+++ b/tests/shaders/vp-address-02.c
@@ -49,10 +49,8 @@ static const GLfloat attrib[] = {
2.0, -2.0,
};
-#define ELEMENTS(x) (sizeof(x) / sizeof(x[0]))
-
#define TEST_ROWS 1
-#define TEST_COLS (ELEMENTS(attrib) / 2)
+#define TEST_COLS (ARRAY_SIZE(attrib) / 2)
#define BOX_SIZE 32
@@ -98,7 +96,7 @@ piglit_display(void)
glProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, 2, bad_color);
glProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, 3, bad_color);
- for (i = 0; i < ELEMENTS(progs); i++) {
+ for (i = 0; i < ARRAY_SIZE(progs); i++) {
const int x = 1 + (i * (BOX_SIZE + 1));
glBindProgramARB(GL_VERTEX_PROGRAM_ARB, progs[i]);
@@ -161,7 +159,7 @@ piglit_init(int argc, char **argv)
}
}
- for (i = 0; i < ELEMENTS(progs); i++) {
+ for (i = 0; i < ARRAY_SIZE(progs); i++) {
char shader_source[1024];
int offset[2];
char direction[2];