mesa: use Elements() macro in program printing code
authorBrian Paul <brianp@vmware.com>
Tue, 29 Nov 2011 14:36:50 +0000 (07:36 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 30 Nov 2011 13:57:37 +0000 (06:57 -0700)
src/mesa/program/prog_print.c

index f2b91979f7d6c53a0e26cb8508a0c6adb854b5af..e9bf3aadf37f57948b253f5abdf4fa7d073b5580 100644 (file)
@@ -157,11 +157,11 @@ arb_input_attrib_string(GLint index, GLenum progType)
    assert(strcmp(vertAttribs[VERT_ATTRIB_GENERIC15], "vertex.attrib[15]") == 0);
 
    if (progType == GL_VERTEX_PROGRAM_ARB) {
-      assert(index < sizeof(vertAttribs) / sizeof(vertAttribs[0]));
+      assert(index < Elements(vertAttribs));
       return vertAttribs[index];
    }
    else {
-      assert(index < sizeof(fragAttribs) / sizeof(fragAttribs[0]));
+      assert(index < Elements(fragAttribs));
       return fragAttribs[index];
    }
 }
@@ -246,11 +246,11 @@ arb_output_attrib_string(GLint index, GLenum progType)
    };
 
    if (progType == GL_VERTEX_PROGRAM_ARB) {
-      assert(index < sizeof(vertResults) / sizeof(vertResults[0]));
+      assert(index < Elements(vertResults));
       return vertResults[index];
    }
    else {
-      assert(index < sizeof(fragResults) / sizeof(fragResults[0]));
+      assert(index < Elements(fragResults));
       return fragResults[index];
    }
 }