aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/varray.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/varray.c')
-rw-r--r--mesalib/src/mesa/main/varray.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/mesalib/src/mesa/main/varray.c b/mesalib/src/mesa/main/varray.c
index 978ec7b53..42e7f89b2 100644
--- a/mesalib/src/mesa/main/varray.c
+++ b/mesalib/src/mesa/main/varray.c
@@ -24,6 +24,7 @@
*/
+#include <stdio.h>
#include <inttypes.h> /* for PRId64 macro */
#include "glheader.h"
@@ -356,7 +357,7 @@ update_array_format(struct gl_context *ctx,
return false;
}
- ASSERT(size <= 4);
+ assert(size <= 4);
elementSize = _mesa_bytes_per_vertex_attrib(size, type);
assert(elementSize != -1);
@@ -714,7 +715,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 +741,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 +770,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 +835,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 +957,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 +1349,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:
*
@@ -1802,8 +1803,8 @@ _mesa_VertexAttribBinding(GLuint attribIndex, GLuint bindingIndex)
return;
}
- ASSERT(VERT_ATTRIB_GENERIC(attribIndex) <
- Elements(ctx->Array.VAO->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(attribIndex) <
+ ARRAY_SIZE(ctx->Array.VAO->VertexAttrib));
vertex_attrib_binding(ctx, VERT_ATTRIB_GENERIC(attribIndex),
VERT_ATTRIB_GENERIC(bindingIndex));