Commit bfcdb843 authored by Matt Turner's avatar Matt Turner

mesa: Use assert() instead of ASSERT wrapper.

Acked-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
parent 52049f8f
......@@ -2065,7 +2065,7 @@ img_filter_2d_ewa(struct sp_sampler_view *sp_sview,
float F = A*C-B*B/4.0f;
/* check if it is an ellipse */
/* ASSERT(F > 0.0); */
/* assert(F > 0.0); */
/* Compute the ellipse's (u,v) bounding box in texture space */
float d = -B*B+4.0f*C*A;
......
......@@ -1483,7 +1483,7 @@ glXQueryVersion( Display *dpy, int *maj, int *min )
static int
get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig )
{
ASSERT(xmvis);
assert(xmvis);
switch(attrib) {
case GLX_USE_GL:
if (fbconfig)
......
......@@ -441,7 +441,7 @@ create_xmesa_buffer(Drawable d, BufferType type,
XMesaDisplay xmdpy = xmesa_init_display(vis->display);
XMesaBuffer b;
ASSERT(type == WINDOW || type == PIXMAP || type == PBUFFER);
assert(type == WINDOW || type == PIXMAP || type == PBUFFER);
if (!xmdpy)
return NULL;
......@@ -556,7 +556,7 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b,
GLboolean rgb_flag, Drawable window,
Colormap cmap)
{
ASSERT(!b || b->xm_visual == v);
assert(!b || b->xm_visual == v);
/* Save true bits/pixel */
v->BitsPerPixel = bits_per_pixel(v);
......
......@@ -393,7 +393,7 @@ _mesa_meta_setup_vertex_objects(GLuint *VAO, GLuint *VBO,
void
_mesa_meta_init(struct gl_context *ctx)
{
ASSERT(!ctx->Meta);
assert(!ctx->Meta);
ctx->Meta = CALLOC_STRUCT(gl_meta_state);
}
......@@ -1045,7 +1045,7 @@ _mesa_meta_end(struct gl_context *ctx)
if (state & MESA_META_TEXTURE) {
GLuint u, tgt;
ASSERT(ctx->Texture.CurrentUnit == 0);
assert(ctx->Texture.CurrentUnit == 0);
/* restore texenv for unit[0] */
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, save->EnvMode);
......@@ -1332,8 +1332,8 @@ _mesa_meta_alloc_texture(struct temp_texture *tex,
{
GLboolean newTex = GL_FALSE;
ASSERT(width <= tex->MaxSize);
ASSERT(height <= tex->MaxSize);
assert(width <= tex->MaxSize);
assert(height <= tex->MaxSize);
if (width > tex->Width ||
height > tex->Height ||
......@@ -1747,7 +1747,7 @@ meta_clear(struct gl_context *ctx, GLbitfield buffers, bool glsl)
_mesa_ClampColor(GL_CLAMP_FRAGMENT_COLOR, GL_FALSE);
}
else {
ASSERT(metaSave & MESA_META_COLOR_MASK);
assert(metaSave & MESA_META_COLOR_MASK);
_mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
}
......
......@@ -83,7 +83,7 @@ intel_delete_renderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb)
{
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
ASSERT(irb);
assert(irb);
intel_miptree_release(&irb->mt);
......@@ -304,7 +304,7 @@ static GLboolean
intel_alloc_window_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
ASSERT(rb->Name == 0);
assert(rb->Name == 0);
rb->Width = width;
rb->Height = height;
rb->InternalFormat = internalFormat;
......
......@@ -266,7 +266,7 @@ intel_region_release(struct intel_region **region_handle)
_DBG("%s %p %d\n", __FUNCTION__, region, region->refcount - 1);
ASSERT(region->refcount > 0);
assert(region->refcount > 0);
region->refcount--;
if (region->refcount == 0) {
......
......@@ -74,7 +74,7 @@ intel_delete_renderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb)
{
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
ASSERT(irb);
assert(irb);
intel_miptree_release(&irb->mt);
intel_miptree_release(&irb->singlesample_mt);
......@@ -415,7 +415,7 @@ static GLboolean
intel_alloc_window_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
ASSERT(rb->Name == 0);
assert(rb->Name == 0);
rb->Width = width;
rb->Height = height;
rb->InternalFormat = internalFormat;
......
......@@ -1651,7 +1651,7 @@ static void r200LogicOpCode( struct gl_context *ctx, GLenum opcode )
r200ContextPtr rmesa = R200_CONTEXT(ctx);
GLuint rop = (GLuint)opcode - GL_CLEAR;
ASSERT( rop < 16 );
assert( rop < 16 );
R200_STATECHANGE( rmesa, msk );
rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = r200_rop_tab[rop];
......
......@@ -1432,7 +1432,7 @@ static void setup_hardware_state(r200ContextPtr rmesa, radeonTexObj *t)
}
else if (t->base.Target == GL_TEXTURE_CUBE_MAP) {
ASSERT(log2Width == log2Height);
assert(log2Width == log2Height);
t->pp_txformat |= ((log2Width << R200_TXFORMAT_F5_WIDTH_SHIFT) |
(log2Height << R200_TXFORMAT_F5_HEIGHT_SHIFT) |
/* don't think we need this bit, if it exists at all - fglrx does not set it */
......
......@@ -473,9 +473,9 @@ rcommonAllocDmaLowVerts( radeonContextPtr rmesa, int nverts, int vsize )
rmesa->dma.flush = rcommon_flush_last_swtcl_prim;
}
ASSERT( vsize == rmesa->swtcl.vertex_size * 4 );
ASSERT( rmesa->dma.flush == rcommon_flush_last_swtcl_prim );
ASSERT( rmesa->dma.current_used +
assert( vsize == rmesa->swtcl.vertex_size * 4 );
assert( rmesa->dma.flush == rcommon_flush_last_swtcl_prim );
assert( rmesa->dma.current_used +
rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
rmesa->dma.current_vertexptr );
......
......@@ -61,7 +61,7 @@ radeon_delete_renderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb)
"%s(rb %p, rrb %p) \n",
__func__, rb, rrb);
ASSERT(rrb);
assert(rrb);
if (rrb && rrb->bo) {
radeon_bo_unref(rrb->bo);
......@@ -474,7 +474,7 @@ radeon_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffe
"%s(%p, rb %p) \n",
__func__, ctx, rb);
ASSERT(rb->Name != 0);
assert(rb->Name != 0);
switch (internalFormat) {
case GL_R3_G3_B2:
case GL_RGB4:
......@@ -609,7 +609,7 @@ static GLboolean
radeon_alloc_window_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
ASSERT(rb->Name == 0);
assert(rb->Name == 0);
rb->Width = width;
rb->Height = height;
rb->InternalFormat = internalFormat;
......@@ -767,7 +767,7 @@ radeon_render_texture(struct gl_context * ctx,
(void) fb;
ASSERT(newImage);
assert(newImage);
radeon_image = (radeon_texture_image *)newImage;
......
......@@ -1434,7 +1434,7 @@ static void radeonLogicOpCode( struct gl_context *ctx, GLenum opcode )
r100ContextPtr rmesa = R100_CONTEXT(ctx);
GLuint rop = (GLuint)opcode - GL_CLEAR;
ASSERT( rop < 16 );
assert( rop < 16 );
RADEON_STATECHANGE( rmesa, msk );
rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = radeon_rop_tab[rop];
......
......@@ -995,7 +995,7 @@ static GLboolean setup_hardware_state(r100ContextPtr rmesa, radeonTexObj *t, int
t->tile_bits = 0;
if (t->base.Target == GL_TEXTURE_CUBE_MAP) {
ASSERT(log2Width == log2Height);
assert(log2Width == log2Height);
t->pp_txformat |= ((log2Width << RADEON_TXFORMAT_F5_WIDTH_SHIFT) |
(log2Height << RADEON_TXFORMAT_F5_HEIGHT_SHIFT) |
/* don't think we need this bit, if it exists at all - fglrx does not set it */
......
......@@ -481,7 +481,7 @@ swrast_map_renderbuffer(struct gl_context *ctx,
return;
}
ASSERT(xrb->Base.Buffer);
assert(xrb->Base.Buffer);
if (rb->AllocStorage == swrast_alloc_back_storage) {
map += (rb->Height - 1) * stride;
......
......@@ -519,7 +519,7 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
}
}
else if (osmesa->format == OSMESA_RGB_565) {
ASSERT(osmesa->DataType == GL_UNSIGNED_BYTE);
assert(osmesa->DataType == GL_UNSIGNED_BYTE);
rb->Format = MESA_FORMAT_B5G6R5_UNORM;
}
else {
......
......@@ -1545,7 +1545,7 @@ Fake_glXQueryVersion( Display *dpy, int *maj, int *min )
static int
get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig )
{
ASSERT(xmvis);
assert(xmvis);
switch(attrib) {
case GLX_USE_GL:
if (fbconfig)
......
......@@ -285,7 +285,7 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type,
{
XMesaBuffer b;
ASSERT(type == WINDOW || type == PIXMAP || type == PBUFFER);
assert(type == WINDOW || type == PIXMAP || type == PBUFFER);
b = (XMesaBuffer) CALLOC_STRUCT(xmesa_buffer);
if (!b)
......@@ -564,7 +564,7 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b,
const int xclass = v->visualType;
ASSERT(!b || b->xm_visual == v);
assert(!b || b->xm_visual == v);
/* Save true bits/pixel */
v->BitsPerPixel = bits_per_pixel(v);
......@@ -605,8 +605,8 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b,
/* Do window-specific initializations */
/* these should have been set in create_xmesa_buffer */
ASSERT(b->frontxrb->drawable == window);
ASSERT(b->frontxrb->pixmap == (XMesaPixmap) window);
assert(b->frontxrb->drawable == window);
assert(b->frontxrb->pixmap == (XMesaPixmap) window);
/* Setup for single/double buffering */
if (v->mesa_visual.doubleBufferMode) {
......
......@@ -386,10 +386,10 @@ xmesa_DrawPixels_8R8G8B( struct gl_context *ctx,
const int rowLength = clippedUnpack.RowLength;
XMesaImage ximage;
ASSERT(xmesa->xm_visual->dithered_pf == PF_8R8G8B);
ASSERT(xmesa->xm_visual->undithered_pf == PF_8R8G8B);
ASSERT(dpy);
ASSERT(gc);
assert(xmesa->xm_visual->dithered_pf == PF_8R8G8B);
assert(xmesa->xm_visual->undithered_pf == PF_8R8G8B);
assert(dpy);
assert(gc);
/* This is a little tricky since all coordinates up to now have
* been in the OpenGL bottom-to-top orientation. X is top-to-bottom
......@@ -518,9 +518,9 @@ xmesa_DrawPixels_5R6G5B( struct gl_context *ctx,
const int rowLength = clippedUnpack.RowLength;
XMesaImage ximage;
ASSERT(xmesa->xm_visual->undithered_pf == PF_5R6G5B);
ASSERT(dpy);
ASSERT(gc);
assert(xmesa->xm_visual->undithered_pf == PF_5R6G5B);
assert(dpy);
assert(gc);
/* This is a little tricky since all coordinates up to now have
* been in the OpenGL bottom-to-top orientation. X is top-to-bottom
......@@ -614,8 +614,8 @@ xmesa_CopyPixels( struct gl_context *ctx,
struct xmesa_renderbuffer *dstXrb
= xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]);
ASSERT(dpy);
ASSERT(gc);
assert(dpy);
assert(gc);
/* Note: we don't do any special clipping work here. We could,
* but X will do it for us.
......
......@@ -1548,7 +1548,7 @@ _ae_update_state(struct gl_context *ctx)
*/
at->array = attribArray;
at->binding = &vao->VertexBinding[attribArray->VertexBinding];
ASSERT(!at->array->Normalized);
assert(!at->array->Normalized);
at->func = AttribFuncsNV[at->array->Normalized]
[at->array->Size-1]
[TYPE_IDX(at->array->Type)];
......@@ -1610,8 +1610,8 @@ _ae_update_state(struct gl_context *ctx)
check_vbo(actx, vao->IndexBufferObj);
ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX);
ASSERT(aa - actx->arrays < 32);
assert(at - actx->attribs <= VERT_ATTRIB_MAX);
assert(aa - actx->arrays < 32);
at->func = NULL; /* terminate the list */
aa->offset = -1; /* terminate the list */
......
......@@ -118,8 +118,8 @@ _mesa_BindProgramARB(GLenum target, GLuint id)
}
/* Never null pointers */
ASSERT(ctx->VertexProgram.Current);
ASSERT(ctx->FragmentProgram.Current);
assert(ctx->VertexProgram.Current);
assert(ctx->FragmentProgram.Current);
if (ctx->Driver.BindProgram)
ctx->Driver.BindProgram(ctx, target, newProg);
......@@ -524,7 +524,7 @@ _mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index,
if (get_local_param_pointer(ctx, "glProgramLocalParameterARB",
target, index, &param)) {
ASSERT(index < MAX_PROGRAM_LOCAL_PARAMS);
assert(index < MAX_PROGRAM_LOCAL_PARAMS);
ASSIGN_4V(param, x, y, z, w);
}
}
......@@ -639,8 +639,8 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params)
return;
}
ASSERT(prog);
ASSERT(limits);
assert(prog);
assert(limits);
/* Queries supported for both vertex and fragment programs */
switch (pname) {
......@@ -817,7 +817,7 @@ _mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string)
return;
}
ASSERT(prog);
assert(prog);
if (pname != GL_PROGRAM_STRING_ARB) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramStringARB(pname)");
......
......@@ -143,7 +143,7 @@ _mesa_reference_vao_(struct gl_context *ctx,
struct gl_vertex_array_object *oldObj = *ptr;
mtx_lock(&oldObj->Mutex);
ASSERT(oldObj->RefCount > 0);
assert(oldObj->RefCount > 0);
oldObj->RefCount--;
#if 0
printf("ArrayObj %p %d DECR to %d\n",
......@@ -153,13 +153,13 @@ _mesa_reference_vao_(struct gl_context *ctx,
mtx_unlock(&oldObj->Mutex);
if (deleteFlag) {
ASSERT(ctx->Driver.DeleteArrayObject);
assert(ctx->Driver.DeleteArrayObject);
ctx->Driver.DeleteArrayObject(ctx, oldObj);
}
*ptr = NULL;
}
ASSERT(!*ptr);
assert(!*ptr);
if (vao) {
/* reference new array object */
......@@ -335,7 +335,7 @@ bind_vertex_array(struct gl_context *ctx, GLuint id, GLboolean genRequired)
struct gl_vertex_array_object * const oldObj = ctx->Array.VAO;
struct gl_vertex_array_object *newObj = NULL;
ASSERT(oldObj != NULL);
assert(oldObj != NULL);
if ( oldObj->Name == id )
return; /* rebinding the same array object- no change */
......@@ -456,7 +456,7 @@ _mesa_DeleteVertexArrays(GLsizei n, const GLuint *ids)
struct gl_vertex_array_object *obj = _mesa_lookup_vao(ctx, ids[i]);
if ( obj != NULL ) {
ASSERT( obj->Name == ids[i] );
assert( obj->Name == ids[i] );
/* If the array object is currently bound, the spec says "the binding
* for that object reverts to zero and the default vertex array
......
......@@ -255,7 +255,7 @@ _mesa_BindFragmentShaderATI(GLuint id)
/* do actual bind */
ctx->ATIFragmentShader.Current = newProg;
ASSERT(ctx->ATIFragmentShader.Current);
assert(ctx->ATIFragmentShader.Current);
if (newProg)
newProg->RefCount++;
......
......@@ -799,7 +799,7 @@ get_clamp_color(const struct gl_framebuffer *fb, GLenum clamp)
if (clamp == GL_TRUE || clamp == GL_FALSE)
return clamp;
ASSERT(clamp == GL_FIXED_ONLY);
assert(clamp == GL_FIXED_ONLY);
if (!fb)
return GL_TRUE;
......
......@@ -505,7 +505,7 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
return;
}
ASSERT(ctx->Driver.BlitFramebuffer);
assert(ctx->Driver.BlitFramebuffer);
ctx->Driver.BlitFramebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1,
......
......@@ -446,7 +446,7 @@ _mesa_reference_buffer_object_(struct gl_context *ctx,
struct gl_buffer_object *oldObj = *ptr;
mtx_lock(&oldObj->Mutex);
ASSERT(oldObj->RefCount > 0);
assert(oldObj->RefCount > 0);
oldObj->RefCount--;
#if 0
printf("BufferObj %p %d DECR to %d\n",
......@@ -460,18 +460,18 @@ _mesa_reference_buffer_object_(struct gl_context *ctx,
/* some sanity checking: don't delete a buffer still in use */
#if 0
/* unfortunately, these tests are invalid during context tear-down */
ASSERT(ctx->Array.ArrayBufferObj != bufObj);
ASSERT(ctx->Array.VAO->IndexBufferObj != bufObj);
ASSERT(ctx->Array.VAO->Vertex.BufferObj != bufObj);
assert(ctx->Array.ArrayBufferObj != bufObj);
assert(ctx->Array.VAO->IndexBufferObj != bufObj);
assert(ctx->Array.VAO->Vertex.BufferObj != bufObj);
#endif
ASSERT(ctx->Driver.DeleteBuffer);
assert(ctx->Driver.DeleteBuffer);
ctx->Driver.DeleteBuffer(ctx, oldObj);
}
*ptr = NULL;
}
ASSERT(!*ptr);
assert(!*ptr);
if (bufObj) {
/* reference new buffer */
......@@ -614,7 +614,7 @@ _mesa_buffer_subdata( struct gl_context *ctx, GLintptrARB offset,
(void) ctx;
/* this should have been caught in _mesa_BufferSubData() */
ASSERT(size + offset <= bufObj->Size);
assert(size + offset <= bufObj->Size);
if (bufObj->Data) {
memcpy( (GLubyte *) bufObj->Data + offset, data, size );
......@@ -679,7 +679,7 @@ _mesa_buffer_clear_subdata(struct gl_context *ctx,
GLsizeiptr i;
GLubyte *dest;
ASSERT(ctx->Driver.MapBufferRange);
assert(ctx->Driver.MapBufferRange);
dest = ctx->Driver.MapBufferRange(ctx, offset, size,
GL_MAP_WRITE_BIT |
GL_MAP_INVALIDATE_RANGE_BIT,
......@@ -908,7 +908,7 @@ _mesa_handle_bind_buffer_gen(struct gl_context *ctx,
/* If this is a new buffer object id, or one which was generated but
* never used before, allocate a buffer object now.
*/
ASSERT(ctx->Driver.NewBufferObject);
assert(ctx->Driver.NewBufferObject);
buf = ctx->Driver.NewBufferObject(ctx, buffer);
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", caller);
......@@ -1124,7 +1124,7 @@ _mesa_buffer_unmap_all_mappings(struct gl_context *ctx,
for (i = 0; i < MAP_COUNT; i++) {
if (_mesa_bufferobj_mapped(bufObj, i)) {
ctx->Driver.UnmapBuffer(ctx, bufObj, i);
ASSERT(bufObj->Mappings[i].Pointer == NULL);
assert(bufObj->Mappings[i].Pointer == NULL);
bufObj->Mappings[i].AccessFlags = 0;
}
}
......@@ -1174,7 +1174,7 @@ _mesa_DeleteBuffers(GLsizei n, const GLuint *ids)
struct gl_vertex_array_object *vao = ctx->Array.VAO;
GLuint j;
ASSERT(bufObj->Name == ids[i] || bufObj == &DummyBufferObject);
assert(bufObj->Name == ids[i] || bufObj == &DummyBufferObject);
_mesa_buffer_unmap_all_mappings(ctx, bufObj);
......@@ -1387,7 +1387,7 @@ _mesa_BufferStorage(GLenum target, GLsizeiptr size, const GLvoid *data,
bufObj->Written = GL_TRUE;
bufObj->Immutable = GL_TRUE;
ASSERT(ctx->Driver.BufferData);
assert(ctx->Driver.BufferData);
if (!ctx->Driver.BufferData(ctx, target, size, data, GL_DYNAMIC_DRAW,
flags, bufObj)) {
if (target == GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD) {
......@@ -1477,7 +1477,7 @@ _mesa_BufferData(GLenum target, GLsizeiptrARB size,
size += 100;
#endif
ASSERT(ctx->Driver.BufferData);
assert(ctx->Driver.BufferData);
if (!ctx->Driver.BufferData(ctx, target, size, data, usage,
GL_MAP_READ_BIT |
GL_MAP_WRITE_BIT |
......@@ -1525,7 +1525,7 @@ _mesa_BufferSubData(GLenum target, GLintptrARB offset,
bufObj->Written = GL_TRUE;
ASSERT(ctx->Driver.BufferSubData);
assert(ctx->Driver.BufferSubData);
ctx->Driver.BufferSubData( ctx, offset, size, data, bufObj );
}
......@@ -1545,7 +1545,7 @@ _mesa_GetBufferSubData(GLenum target, GLintptrARB offset,
return;
}
ASSERT(ctx->Driver.GetBufferSubData);
assert(ctx->Driver.GetBufferSubData);
ctx->Driver.GetBufferSubData( ctx, offset, size, data, bufObj );
}
......@@ -1722,7 +1722,7 @@ _mesa_MapBuffer(GLenum target, GLenum access)
return NULL;
}
ASSERT(ctx->Driver.MapBufferRange);
assert(ctx->Driver.MapBufferRange);
map = ctx->Driver.MapBufferRange(ctx, 0, bufObj->Size, accessFlags, bufObj,
MAP_USER);
if (!map) {
......@@ -1734,9 +1734,9 @@ _mesa_MapBuffer(GLenum target, GLenum access)
* This is important because other modules (like VBO) might call
* the driver function directly.
*/
ASSERT(bufObj->Mappings[MAP_USER].Pointer == map);
ASSERT(bufObj->Mappings[MAP_USER].Length == bufObj->Size);
ASSERT(bufObj->Mappings[MAP_USER].Offset == 0);
assert(bufObj->Mappings[MAP_USER].Pointer == map);
assert(bufObj->Mappings[MAP_USER].Length == bufObj->Size);
assert(bufObj->Mappings[MAP_USER].Offset == 0);
bufObj->Mappings[MAP_USER].AccessFlags = accessFlags;
}
......@@ -1824,9 +1824,9 @@ _mesa_UnmapBuffer(GLenum target)
status = ctx->Driver.UnmapBuffer(ctx, bufObj, MAP_USER);
bufObj->Mappings[MAP_USER].AccessFlags = 0;
ASSERT(bufObj->Mappings[MAP_USER].Pointer == NULL);
ASSERT(bufObj->Mappings[MAP_USER].Offset == 0);
ASSERT(bufObj->Mappings[MAP_USER].Length == 0);
assert(bufObj->Mappings[MAP_USER].Pointer == NULL);
assert(bufObj->Mappings[MAP_USER].Offset == 0);
assert(bufObj->Mappings[MAP_USER].Length == 0);
return status;
}
......@@ -2203,7 +2203,7 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
return bufObj->Mappings[MAP_USER].Pointer;
}
ASSERT(ctx->Driver.MapBufferRange);
assert(ctx->Driver.MapBufferRange);
map = ctx->Driver.MapBufferRange(ctx, offset, length, access, bufObj,
MAP_USER);
if (!map) {
......@@ -2214,10 +2214,10 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
* This is important because other modules (like VBO) might call
* the driver function directly.
*/
ASSERT(bufObj->Mappings[MAP_USER].Pointer == map);
ASSERT(bufObj->Mappings[MAP_USER].Length == length);
ASSERT(bufObj->Mappings[MAP_USER].Offset == offset);
ASSERT(bufObj->Mappings[MAP_USER].AccessFlags == access);
assert(bufObj->Mappings[MAP_USER].Pointer == map);
assert(bufObj->Mappings[MAP_USER].Length == length);
assert(bufObj->Mappings[MAP_USER].Offset == offset);
assert(bufObj->Mappings[MAP_USER].AccessFlags == access);
}
return map;
......@@ -2278,7 +2278,7 @@ _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
return;
}
ASSERT(bufObj->Mappings[MAP_USER].AccessFlags & GL_MAP_WRITE_BIT);
assert(bufObj->Mappings[MAP_USER].AccessFlags & GL_MAP_WRITE_BIT);
if (ctx->Driver.FlushMappedBufferRange)
ctx->Driver.FlushMappedBufferRange(ctx, offset, length, bufObj,
......
......@@ -502,7 +502,7 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers,
GLuint output;
for (output = 0; output < n; output++) {
mask[output] = draw_buffer_enum_to_bitmask(ctx, buffers[output]);
ASSERT(mask[output] != BAD_MASK);
assert(mask[output] != BAD_MASK);
mask[output] &= supportedMask;
}
destMask = mask;
......@@ -533,7 +533,7 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers,
if (destMask[buf]) {
GLint bufIndex = ffs(destMask[buf]) - 1;
/* only one bit should be set in the destMask[buf] field */
ASSERT(_mesa_bitcount(destMask[buf]) == 1);
assert(_mesa_bitcount(destMask[buf]) == 1);
if (fb->_ColorDrawBufferIndexes[buf] != bufIndex) {
updated_drawbuffers(ctx);
fb->_ColorDrawBufferIndexes[buf] = bufIndex;
......
......@@ -218,7 +218,7 @@ _mesa_Clear( GLbitfield mask )
bufferMask |= BUFFER_BIT_ACCUM;
}
ASSERT(ctx->Driver.Clear);
assert(ctx->Driver.Clear);
ctx->Driver.Clear(ctx, bufferMask);
}
}
......
......@@ -200,16 +200,6 @@ static inline GLuint CPU_TO_LE32(GLuint x)
#endif
/**
* ASSERT macro
*/
#if defined(DEBUG)
# define ASSERT(X) assert(X)
#else
# define ASSERT(X)
#endif
/*
* A trick to suppress uninitialized variable warning without generating any
* code
......
......@@ -55,7 +55,7 @@ _mesa_BeginConditionalRender(GLuint queryId, GLenum mode)
return;
}
ASSERT(ctx->Query.CondRenderMode == GL_NONE);
assert(ctx->Query.CondRenderMode == GL_NONE);
/* Section 2.14 (Conditional Rendering) of the OpenGL 3.0 spec says:
*
......@@ -70,7 +70,7 @@ _mesa_BeginConditionalRender(GLuint queryId, GLenum mode)
"glBeginConditionalRender(bad queryId=%u)", queryId);
return;
}
ASSERT(q->Id == queryId);
assert(q->Id == queryId);