summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-02-28 08:57:11 -0700
committerBrian Paul <[email protected]>2015-03-02 08:55:30 -0700
commitc2e130f8201239f836f429cab3beddb4d66a3357 (patch)
tree244eb29a1db25d23e6bd5f276e64817838c470fb /src/mesa/main/varray.c
parentcd6db1989ad98b3e848d3ab132de98dc06274385 (diff)
mesa/main: replace Elements() with ARRAY_SIZE()
We've been using a mix of these two macros for a while now. Let's just use the later everywhere. It seems to be the convention used by other open-source projects. Acked-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r--src/mesa/main/varray.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 6df50de6aa0..3db9e06d37d 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -714,7 +714,7 @@ _mesa_EnableVertexAttribArray(GLuint index)
vao = ctx->Array.VAO;
- assert(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) < ARRAY_SIZE(vao->VertexAttrib));
if (!vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) {
/* was disabled, now being enabled */
@@ -740,7 +740,7 @@ _mesa_DisableVertexAttribArray(GLuint index)
vao = ctx->Array.VAO;
- assert(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) < ARRAY_SIZE(vao->VertexAttrib));
if (vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) {
/* was enabled, now being disabled */
@@ -769,7 +769,7 @@ get_vertex_array_attrib(struct gl_context *ctx, GLuint index, GLenum pname,
return 0;
}
- assert(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) < ARRAY_SIZE(vao->VertexAttrib));
array = &vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)];
@@ -834,7 +834,7 @@ get_current_attrib(struct gl_context *ctx, GLuint index, const char *function)
return NULL;
}
- assert(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) < ARRAY_SIZE(ctx->Array.VAO->VertexAttrib));
FLUSH_CURRENT(ctx, 0);
return ctx->Current.Attrib[VERT_ATTRIB_GENERIC(index)];
@@ -956,7 +956,7 @@ _mesa_GetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid **pointer)
return;
}
- assert(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) < ARRAY_SIZE(ctx->Array.VAO->VertexAttrib));
*pointer = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Ptr;
}
@@ -1348,7 +1348,7 @@ _mesa_VertexAttribDivisor(GLuint index, GLuint divisor)
return;
}
- assert(genericIndex < Elements(ctx->Array.VAO->VertexAttrib));
+ assert(genericIndex < ARRAY_SIZE(ctx->Array.VAO->VertexAttrib));
/* The ARB_vertex_attrib_binding spec says:
*
@@ -1803,7 +1803,7 @@ _mesa_VertexAttribBinding(GLuint attribIndex, GLuint bindingIndex)
}
assert(VERT_ATTRIB_GENERIC(attribIndex) <
- Elements(ctx->Array.VAO->VertexAttrib));
+ ARRAY_SIZE(ctx->Array.VAO->VertexAttrib));
vertex_attrib_binding(ctx, VERT_ATTRIB_GENERIC(attribIndex),
VERT_ATTRIB_GENERIC(bindingIndex));