diff options
131 files changed, 735 insertions, 746 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c index 91f2701c025..68dcf57240d 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.c +++ b/src/gallium/drivers/softpipe/sp_tex_sample.c @@ -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; diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index ad80dc09d1c..f59b0bad049 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -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) diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 34be1f70108..e6f40c344bc 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -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); diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 3636ee83b9b..dabf9345bb0 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -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); } diff --git a/src/mesa/drivers/dri/i915/intel_fbo.c b/src/mesa/drivers/dri/i915/intel_fbo.c index ead1b17b69d..2a343856c52 100644 --- a/src/mesa/drivers/dri/i915/intel_fbo.c +++ b/src/mesa/drivers/dri/i915/intel_fbo.c @@ -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; diff --git a/src/mesa/drivers/dri/i915/intel_regions.c b/src/mesa/drivers/dri/i915/intel_regions.c index ff27d7f81f0..5768357f193 100644 --- a/src/mesa/drivers/dri/i915/intel_regions.c +++ b/src/mesa/drivers/dri/i915/intel_regions.c @@ -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) { diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c index 174cea06cbb..63ed7adc0ee 100644 --- a/src/mesa/drivers/dri/i965/intel_fbo.c +++ b/src/mesa/drivers/dri/i965/intel_fbo.c @@ -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; diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index 930ead86ad1..832718714c3 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -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]; diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 5f740968e64..43ecdb999db 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -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 */ diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c index a2be3d684e0..5b98eff169f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_dma.c +++ b/src/mesa/drivers/dri/radeon/radeon_dma.c @@ -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 ); diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 5a6d9da771c..110b03020ca 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -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; diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index 002fc86f9a4..e83a34db9c3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -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]; diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 4600d34ce82..0439f6d0c05 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -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 */ diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 8005f7d6964..a2a6c844d16 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -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; diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 74cbb5a2bd7..9f1a5a858b4 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -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 { diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 33c024a8c07..00c583f1637 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -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) diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index b49133b730d..89c219ec7aa 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -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) { diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 10634fe73c0..cd5809e070e 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -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. diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 536326f6e14..ea015fd65bf 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -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 */ diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c index fe8cd6bbce0..f474951d729 100644 --- a/src/mesa/main/arbprogram.c +++ b/src/mesa/main/arbprogram.c @@ -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, ¶m)) { - 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)"); diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 6440ea670b2..bdbd169ef9f 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -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 diff --git a/src/mesa/main/atifragshader.c b/src/mesa/main/atifragshader.c index 1eab7731aea..9d967b9e67e 100644 --- a/src/mesa/main/atifragshader.c +++ b/src/mesa/main/atifragshader.c @@ -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++; diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index c37c0fea52b..b941937d82d 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -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; diff --git a/src/mesa/main/blit.c b/src/mesa/main/blit.c index b97b564793c..b244c8de846 100644 --- a/src/mesa/main/blit.c +++ b/src/mesa/main/blit.c @@ -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, diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index b372c68f21c..f026fc39341 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -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, diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index e5076e9bbde..37a9790923b 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -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; diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c index 3c4ced8ed06..8d707bc34a1 100644 --- a/src/mesa/main/clear.c +++ b/src/mesa/main/clear.c @@ -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); } } diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 91a6cd136f4..9a5dbcfd3a4 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -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 diff --git a/src/mesa/main/condrender.c b/src/mesa/main/condrender.c index 75f9d74bc88..77e4b95ee8f 100644 --- a/src/mesa/main/condrender.c +++ b/src/mesa/main/condrender.c @@ -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); switch (mode) { case GL_QUERY_WAIT: diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index b186a1fad50..43acc9d283d 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1644,7 +1644,7 @@ _mesa_make_current( struct gl_context *newCtx, /* We used to call _glapi_check_multithread() here. Now do it in drivers */ _glapi_set_context((void *) newCtx); - ASSERT(_mesa_get_current_context() == newCtx); + assert(_mesa_get_current_context() == newCtx); if (!newCtx) { _glapi_set_dispatch(NULL); /* none current */ @@ -1653,8 +1653,8 @@ _mesa_make_current( struct gl_context *newCtx, _glapi_set_dispatch(newCtx->CurrentDispatch); if (drawBuffer && readBuffer) { - ASSERT(_mesa_is_winsys_fbo(drawBuffer)); - ASSERT(_mesa_is_winsys_fbo(readBuffer)); + assert(_mesa_is_winsys_fbo(drawBuffer)); + assert(_mesa_is_winsys_fbo(readBuffer)); _mesa_reference_framebuffer(&newCtx->WinSysDrawBuffer, drawBuffer); _mesa_reference_framebuffer(&newCtx->WinSysReadBuffer, readBuffer); diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index ec8662b3089..0c1a13fa4bf 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -824,7 +824,7 @@ struct dd_function_table { void (*BeginVertices)( struct gl_context *ctx ); /** - * If inside glBegin()/glEnd(), it should ASSERT(0). Otherwise, if + * If inside glBegin()/glEnd(), it should assert(0). Otherwise, if * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered * vertices, if FLUSH_UPDATE_CURRENT bit is set updates * __struct gl_contextRec::Current and gl_light_attrib::Material diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 025f6abd227..ff9ab07c6ec 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1035,7 +1035,7 @@ dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes, bool align8) } else { /* make sure instruction size agrees */ - ASSERT(numNodes == InstSize[opcode]); + assert(numNodes == InstSize[opcode]); } } @@ -5089,7 +5089,7 @@ save_Attr1fNV(GLenum attr, GLfloat x) n[2].f = x; } - ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS); + assert(attr < MAX_VERTEX_GENERIC_ATTRIBS); ctx->ListState.ActiveAttribSize[attr] = 1; ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1); @@ -5111,7 +5111,7 @@ save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y) n[3].f = y; } - ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS); + assert(attr < MAX_VERTEX_GENERIC_ATTRIBS); ctx->ListState.ActiveAttribSize[attr] = 2; ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1); @@ -5134,7 +5134,7 @@ save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z) n[4].f = z; } - ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS); + assert(attr < MAX_VERTEX_GENERIC_ATTRIBS); ctx->ListState.ActiveAttribSize[attr] = 3; ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1); @@ -5158,7 +5158,7 @@ save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w) n[5].f = w; } - ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS); + assert(attr < MAX_VERTEX_GENERIC_ATTRIBS); ctx->ListState.ActiveAttribSize[attr] = 4; ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w); @@ -5180,7 +5180,7 @@ save_Attr1fARB(GLenum attr, GLfloat x) n[2].f = x; } - ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS); + assert(attr < MAX_VERTEX_GENERIC_ATTRIBS); ctx->ListState.ActiveAttribSize[attr] = 1; ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1); @@ -5202,7 +5202,7 @@ save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y) n[3].f = y; } - ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS); + assert(attr < MAX_VERTEX_GENERIC_ATTRIBS); ctx->ListState.ActiveAttribSize[attr] = 2; ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1); @@ -5225,7 +5225,7 @@ save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z) n[4].f = z; } - ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS); + assert(attr < MAX_VERTEX_GENERIC_ATTRIBS); ctx->ListState.ActiveAttribSize[attr] = 3; ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1); @@ -5249,7 +5249,7 @@ save_Attr4fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w) n[5].f = w; } - ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS); + assert(attr < MAX_VERTEX_GENERIC_ATTRIBS); ctx->ListState.ActiveAttribSize[attr] = 4; ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w); diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 1865a66b9da..55035f214b3 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -173,7 +173,7 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, ctx->Current.RasterTexCoords[0] ); } else { - ASSERT(ctx->RenderMode == GL_SELECT); + assert(ctx->RenderMode == GL_SELECT); /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */ } @@ -279,7 +279,7 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, ctx->Current.RasterTexCoords[0] ); } else { - ASSERT(ctx->RenderMode == GL_SELECT); + assert(ctx->RenderMode == GL_SELECT); /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */ } @@ -355,7 +355,7 @@ _mesa_Bitmap( GLsizei width, GLsizei height, ctx->Current.RasterTexCoords[0] ); } else { - ASSERT(ctx->RenderMode == GL_SELECT); + assert(ctx->RenderMode == GL_SELECT); /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */ } diff --git a/src/mesa/main/drawtex.c b/src/mesa/main/drawtex.c index 7c0ec832bb9..9c4fdf90e3b 100644 --- a/src/mesa/main/drawtex.c +++ b/src/mesa/main/drawtex.c @@ -46,7 +46,7 @@ draw_texture(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, if (ctx->NewState) _mesa_update_state(ctx); - ASSERT(ctx->Driver.DrawTex); + assert(ctx->Driver.DrawTex); ctx->Driver.DrawTex(ctx, x, y, z, width, height); _mesa_set_vp_override(ctx, GL_FALSE); diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 11365ecc404..9008a386343 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -1060,7 +1060,7 @@ void _mesa_set_enablei(struct gl_context *ctx, GLenum cap, GLuint index, GLboolean state) { - ASSERT(state == 0 || state == 1); + assert(state == 0 || state == 1); switch (cap) { case GL_BLEND: if (!ctx->Extensions.EXT_draw_buffers2) { diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c index 478e4ed33db..f16b33fa378 100644 --- a/src/mesa/main/errors.c +++ b/src/mesa/main/errors.c @@ -1465,7 +1465,7 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) /* Too long error message. Whoever calls _mesa_error should use * shorter strings. */ - ASSERT(0); + assert(0); return; } @@ -1473,7 +1473,7 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) _mesa_lookup_enum_by_nr(error), s); if (len >= MAX_DEBUG_MESSAGE_LENGTH) { /* Same as above. */ - ASSERT(0); + assert(0); return; } diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index 84cd7563be4..86c8f75a1d2 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -309,7 +309,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLfloat *pnts; struct gl_1d_map *map = NULL; - ASSERT(type == GL_FLOAT || type == GL_DOUBLE); + assert(type == GL_FLOAT || type == GL_DOUBLE); if (u1 == u2) { _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(u1,u2)" ); @@ -391,7 +391,7 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat *pnts; struct gl_2d_map *map = NULL; - ASSERT(type == GL_FLOAT || type == GL_DOUBLE); + assert(type == GL_FLOAT || type == GL_DOUBLE); if (u1==u2) { _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(u1,u2)" ); @@ -505,7 +505,7 @@ _mesa_GetnMapdvARB( GLenum target, GLenum query, GLsizei bufSize, GLdouble *v ) map1d = get_1d_map(ctx, target); map2d = get_2d_map(ctx, target); - ASSERT(map1d || map2d); + assert(map1d || map2d); switch (query) { case GL_COEFF: @@ -595,7 +595,7 @@ _mesa_GetnMapfvARB( GLenum target, GLenum query, GLsizei bufSize, GLfloat *v ) map1d = get_1d_map(ctx, target); map2d = get_2d_map(ctx, target); - ASSERT(map1d || map2d); + assert(map1d || map2d); switch (query) { case GL_COEFF: @@ -687,7 +687,7 @@ _mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v ) map1d = get_1d_map(ctx, target); map2d = get_2d_map(ctx, target); - ASSERT(map1d || map2d); + assert(map1d || map2d); switch (query) { case GL_COEFF: diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 30536229764..f8d0d92bfb7 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -324,14 +324,14 @@ remove_attachment(struct gl_context *ctx, ctx->Driver.FinishRenderTexture(ctx, rb); if (att->Type == GL_TEXTURE) { - ASSERT(att->Texture); + assert(att->Texture); _mesa_reference_texobj(&att->Texture, NULL); /* unbind */ - ASSERT(!att->Texture); + assert(!att->Texture); } if (att->Type == GL_TEXTURE || att->Type == GL_RENDERBUFFER_EXT) { - ASSERT(!att->Texture); + assert(!att->Texture); _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); /* unbind */ - ASSERT(!att->Renderbuffer); + assert(!att->Renderbuffer); } att->Type = GL_NONE; att->Complete = GL_TRUE; @@ -433,7 +433,7 @@ set_texture_attachment(struct gl_context *ctx, if (att->Texture == texObj) { /* re-attaching same texture */ - ASSERT(att->Type == GL_TEXTURE); + assert(att->Type == GL_TEXTURE); } else { /* new attachment */ @@ -488,7 +488,7 @@ _mesa_framebuffer_renderbuffer(struct gl_context *ctx, mtx_lock(&fb->Mutex); att = get_attachment(ctx, fb, attachment); - ASSERT(att); + assert(att); if (rb) { set_renderbuffer_attachment(ctx, att, rb); if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { @@ -809,7 +809,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, } } else { - ASSERT(format == GL_STENCIL); + assert(format == GL_STENCIL); if (ctx->Extensions.ARB_depth_texture && baseFormat == GL_DEPTH_STENCIL) { /* OK */ @@ -826,7 +826,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, const GLenum baseFormat = _mesa_get_format_base_format(att->Renderbuffer->Format); - ASSERT(att->Renderbuffer); + assert(att->Renderbuffer); if (!att->Renderbuffer->InternalFormat || att->Renderbuffer->Width < 1 || att->Renderbuffer->Height < 1) { @@ -868,7 +868,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, } } else { - ASSERT(att->Type == GL_NONE); + assert(att->Type == GL_NONE); /* complete */ return; } @@ -1239,7 +1239,7 @@ bind_renderbuffer(GLenum target, GLuint renderbuffer, bool allow_user_names) _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindRenderbufferEXT"); return; } - ASSERT(newRb->AllocStorage); + assert(newRb->AllocStorage); _mesa_HashInsert(ctx->Shared->RenderBuffers, renderbuffer, newRb); newRb->RefCount = 1; /* referenced by hash table */ } @@ -1248,7 +1248,7 @@ bind_renderbuffer(GLenum target, GLuint renderbuffer, bool allow_user_names) newRb = NULL; } - ASSERT(newRb != &DummyRenderbuffer); + assert(newRb != &DummyRenderbuffer); _mesa_reference_renderbuffer(&ctx->CurrentRenderbuffer, newRb); } @@ -1339,7 +1339,7 @@ _mesa_DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers) /* check if deleting currently bound renderbuffer object */ if (rb == ctx->CurrentRenderbuffer) { /* bind default */ - ASSERT(rb->RefCount >= 2); + assert(rb->RefCount >= 2); _mesa_BindRenderbuffer(GL_RENDERBUFFER_EXT, 0); } @@ -1838,7 +1838,7 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, rb->NumSamples = samples; /* Now allocate the storage */ - ASSERT(rb->AllocStorage); + assert(rb->AllocStorage); if (rb->AllocStorage(ctx, rb, internalFormat, width, height)) { /* No error - check/set fields now */ /* If rb->Format == MESA_FORMAT_NONE, the format is unsupported. */ @@ -2036,7 +2036,7 @@ static void check_begin_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb) { GLuint i; - ASSERT(ctx->Driver.RenderTexture); + assert(ctx->Driver.RenderTexture); if (_mesa_is_winsys_fbo(fb)) return; /* can't render to texture with winsys framebuffers */ @@ -2134,8 +2134,8 @@ bind_framebuffer(GLenum target, GLuint framebuffer, bool allow_user_names) newReadFb = ctx->WinSysReadBuffer; } - ASSERT(newDrawFb); - ASSERT(newDrawFb != &DummyFramebuffer); + assert(newDrawFb); + assert(newDrawFb != &DummyFramebuffer); /* save pointers to current/old framebuffers */ oldDrawFb = ctx->DrawBuffer; @@ -2227,17 +2227,17 @@ _mesa_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers) struct gl_framebuffer *fb; fb = _mesa_lookup_framebuffer(ctx, framebuffers[i]); if (fb) { - ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]); + assert(fb == &DummyFramebuffer || fb->Name == framebuffers[i]); /* check if deleting currently bound framebuffer object */ if (fb == ctx->DrawBuffer) { /* bind default */ - ASSERT(fb->RefCount >= 2); + assert(fb->RefCount >= 2); _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); } if (fb == ctx->ReadBuffer) { /* bind default */ - ASSERT(fb->RefCount >= 2); + assert(fb->RefCount >= 2); _mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, 0); } diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index c51c20ddf02..395b00e1528 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -479,7 +479,7 @@ static struct ureg register_const4f( struct tnl_program *p, values[3].f = s3; idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4, &swizzle ); - ASSERT(swizzle == SWIZZLE_NOOP); + assert(swizzle == SWIZZLE_NOOP); return make_ureg(PROGRAM_CONSTANT, idx); } @@ -530,7 +530,7 @@ static void emit_arg( struct prog_src_register *src, src->Abs = 0; src->RelAddr = 0; /* Check that bitfield sizes aren't exceeded */ - ASSERT(src->Index == reg.idx); + assert(src->Index == reg.idx); } @@ -544,7 +544,7 @@ static void emit_dst( struct prog_dst_register *dst, dst->CondMask = COND_TR; /* always pass cond test */ dst->CondSwizzle = SWIZZLE_NOOP; /* Check that bitfield sizes aren't exceeded */ - ASSERT(dst->Index == reg.idx); + assert(dst->Index == reg.idx); } diff --git a/src/mesa/main/format_unpack.py b/src/mesa/main/format_unpack.py index 2276a1063f5..53bdf641d12 100644 --- a/src/mesa/main/format_unpack.py +++ b/src/mesa/main/format_unpack.py @@ -463,8 +463,8 @@ unpack_float_z_X8_UINT_Z24_UNORM(GLuint n, const void *src, GLfloat *dst) GLuint i; for (i = 0; i < n; i++) { dst[i] = (GLfloat) ((s[i] >> 8) * scale); - ASSERT(dst[i] >= 0.0F); - ASSERT(dst[i] <= 1.0F); + assert(dst[i] >= 0.0F); + assert(dst[i] <= 1.0F); } } @@ -477,8 +477,8 @@ unpack_float_z_Z24_UNORM_X8_UINT(GLuint n, const void *src, GLfloat *dst) GLuint i; for (i = 0; i < n; i++) { dst[i] = (GLfloat) ((s[i] & 0x00ffffff) * scale); - ASSERT(dst[i] >= 0.0F); - ASSERT(dst[i] <= 1.0F); + assert(dst[i] >= 0.0F); + assert(dst[i] <= 1.0F); } } diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 958d6f245ea..df852f303e5 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -107,8 +107,8 @@ GLint _mesa_get_format_bytes(mesa_format format) { const struct gl_format_info *info = _mesa_get_format_info(format); - ASSERT(info->BytesPerBlock); - ASSERT(info->BytesPerBlock <= MAX_PIXEL_BYTES || + assert(info->BytesPerBlock); + assert(info->BytesPerBlock <= MAX_PIXEL_BYTES || _mesa_is_format_compressed(format)); return info->BytesPerBlock; } diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index dc0386d23be..5df1ecc4f07 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -223,8 +223,8 @@ _mesa_free_framebuffer_data(struct gl_framebuffer *fb) if (att->Texture) { _mesa_reference_texobj(&att->Texture, NULL); } - ASSERT(!att->Renderbuffer); - ASSERT(!att->Texture); + assert(!att->Renderbuffer); + assert(!att->Texture); att->Type = GL_NONE; } } @@ -245,7 +245,7 @@ _mesa_reference_framebuffer_(struct gl_framebuffer **ptr, struct gl_framebuffer *oldFb = *ptr; mtx_lock(&oldFb->Mutex); - ASSERT(oldFb->RefCount > 0); + assert(oldFb->RefCount > 0); oldFb->RefCount--; deleteFlag = (oldFb->RefCount == 0); mtx_unlock(&oldFb->Mutex); @@ -296,8 +296,8 @@ _mesa_resize_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb, /* only resize if size is changing */ if (rb->Width != width || rb->Height != height) { if (rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) { - ASSERT(rb->Width == width); - ASSERT(rb->Height == height); + assert(rb->Width == width); + assert(rb->Height == height); } else { _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer"); @@ -402,8 +402,8 @@ _mesa_scissor_bounding_box(const struct gl_context *ctx, } } - ASSERT(bbox[0] <= bbox[1]); - ASSERT(bbox[2] <= bbox[3]); + assert(bbox[0] <= bbox[1]); + assert(bbox[2] <= bbox[3]); } /** @@ -621,8 +621,8 @@ update_color_read_buffer(struct gl_context *ctx, struct gl_framebuffer *fb) fb->_ColorReadBuffer = NULL; /* legal! */ } else { - ASSERT(fb->_ColorReadBufferIndex >= 0); - ASSERT(fb->_ColorReadBufferIndex < BUFFER_COUNT); + assert(fb->_ColorReadBufferIndex >= 0); + assert(fb->_ColorReadBufferIndex < BUFFER_COUNT); fb->_ColorReadBuffer = fb->Attachment[fb->_ColorReadBufferIndex].Renderbuffer; } @@ -756,7 +756,7 @@ renderbuffer_exists(struct gl_context *ctx, if (!readBuf) { return GL_FALSE; } - ASSERT(_mesa_get_format_bits(readBuf->Format, GL_RED_BITS) > 0 || + assert(_mesa_get_format_bits(readBuf->Format, GL_RED_BITS) > 0 || _mesa_get_format_bits(readBuf->Format, GL_ALPHA_BITS) > 0 || _mesa_get_format_bits(readBuf->Format, GL_TEXTURE_LUMINANCE_SIZE) > 0 || _mesa_get_format_bits(readBuf->Format, GL_TEXTURE_INTENSITY_SIZE) > 0 || diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 3f9d745161d..2f4693ad6a0 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -758,7 +758,7 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu case GL_COMPRESSED_TEXTURE_FORMATS_ARB: v->value_int_n.n = _mesa_get_compressed_formats(ctx, v->value_int_n.ints); - ASSERT(v->value_int_n.n <= (int) ARRAY_SIZE(v->value_int_n.ints)); + assert(v->value_int_n.n <= (int) ARRAY_SIZE(v->value_int_n.ints)); break; case GL_MAX_VARYING_FLOATS_ARB: diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c index 1a152ec340c..d04cccd94d2 100644 --- a/src/mesa/main/hash.c +++ b/src/mesa/main/hash.c @@ -371,8 +371,8 @@ _mesa_HashDeleteAll(struct _mesa_HashTable *table, { struct hash_entry *entry; - ASSERT(table); - ASSERT(callback); + assert(table); + assert(callback); mtx_lock(&table->Mutex); table->InDeleteAll = GL_TRUE; hash_table_foreach(table->ht, entry) { @@ -401,7 +401,7 @@ _mesa_HashClone(const struct _mesa_HashTable *table) struct hash_entry *entry; struct _mesa_HashTable *clonetable; - ASSERT(table); + assert(table); mtx_lock(&table2->Mutex); clonetable = _mesa_NewHashTable(); @@ -437,8 +437,8 @@ _mesa_HashWalk(const struct _mesa_HashTable *table, struct _mesa_HashTable *table2 = (struct _mesa_HashTable *) table; struct hash_entry *entry; - ASSERT(table); - ASSERT(callback); + assert(table); + assert(callback); mtx_lock(&table2->WalkMutex); hash_table_foreach(table->ht, entry) { callback((uintptr_t)entry->key, entry->data, userData); diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index e97b006e071..711a19062a9 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -118,7 +118,7 @@ _mesa_image_offset( GLuint dimensions, GLint skipimages; /* for 3-D volume images */ GLintptr offset; - ASSERT(dimensions >= 1 && dimensions <= 3); + assert(dimensions >= 1 && dimensions <= 3); alignment = packing->Alignment; if (packing->RowLength > 0) { @@ -174,7 +174,7 @@ _mesa_image_offset( GLuint dimensions, if (remainder > 0) bytes_per_row += (alignment - remainder); - ASSERT(bytes_per_row % alignment == 0); + assert(bytes_per_row % alignment == 0); bytes_per_image = bytes_per_row * rows_per_image; @@ -288,7 +288,7 @@ _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing, { GLint bytesPerRow, remainder; - ASSERT(packing); + assert(packing); if (type == GL_BITMAP) { if (packing->RowLength == 0) { @@ -336,7 +336,7 @@ _mesa_image_image_stride( const struct gl_pixelstore_attrib *packing, { GLint bytesPerRow, bytesPerImage, remainder; - ASSERT(packing); + assert(packing); if (type == GL_BITMAP) { if (packing->RowLength == 0) { @@ -476,7 +476,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, if (!tempBuffer) return; - ASSERT(srcType != dstType); + assert(srcType != dstType); switch (srcType) { case GL_UNSIGNED_BYTE: @@ -499,7 +499,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, const GLubyte (*src1)[4] = (const GLubyte (*)[4]) src; GLfloat (*dst4)[4] = (GLfloat (*)[4]) (useTemp ? tempBuffer : dst); GLuint i; - ASSERT(dstType == GL_FLOAT); + assert(dstType == GL_FLOAT); for (i = 0; i < count; i++) { if (!mask || mask[i]) { dst4[i][RCOMP] = UBYTE_TO_FLOAT(src1[i][RCOMP]); @@ -532,7 +532,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, const GLushort (*src2)[4] = (const GLushort (*)[4]) src; GLfloat (*dst4)[4] = (GLfloat (*)[4]) (useTemp ? tempBuffer : dst); GLuint i; - ASSERT(dstType == GL_FLOAT); + assert(dstType == GL_FLOAT); for (i = 0; i < count; i++) { if (!mask || mask[i]) { dst4[i][RCOMP] = USHORT_TO_FLOAT(src2[i][RCOMP]); @@ -561,7 +561,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, const GLfloat (*src4)[4] = (const GLfloat (*)[4]) src; GLushort (*dst2)[4] = (GLushort (*)[4]) (useTemp ? tempBuffer : dst); GLuint i; - ASSERT(dstType == GL_UNSIGNED_SHORT); + assert(dstType == GL_UNSIGNED_SHORT); for (i = 0; i < count; i++) { if (!mask || mask[i]) { UNCLAMPED_FLOAT_TO_USHORT(dst2[i][RCOMP], src4[i][RCOMP]); @@ -607,8 +607,8 @@ _mesa_clip_drawpixels(const struct gl_context *ctx, unpack->RowLength = *width; } - ASSERT(ctx->Pixel.ZoomX == 1.0F); - ASSERT(ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F); + assert(ctx->Pixel.ZoomX == 1.0F); + assert(ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F); /* left clipping */ if (*destX < buffer->_Xmin) { @@ -792,20 +792,20 @@ clip_right_or_top(GLint *srcX0, GLint *srcX1, if (*dstX1 > maxValue) { /* X1 outside right edge */ - ASSERT(*dstX0 < maxValue); /* X0 should be inside right edge */ + assert(*dstX0 < maxValue); /* X0 should be inside right edge */ t = (GLfloat) (maxValue - *dstX0) / (GLfloat) (*dstX1 - *dstX0); /* chop off [t, 1] part */ - ASSERT(t >= 0.0 && t <= 1.0); + assert(t >= 0.0 && t <= 1.0); *dstX1 = maxValue; bias = (*srcX0 < *srcX1) ? 0.5F : -0.5F; *srcX1 = *srcX0 + (GLint) (t * (*srcX1 - *srcX0) + bias); } else if (*dstX0 > maxValue) { /* X0 outside right edge */ - ASSERT(*dstX1 < maxValue); /* X1 should be inside right edge */ + assert(*dstX1 < maxValue); /* X1 should be inside right edge */ t = (GLfloat) (maxValue - *dstX1) / (GLfloat) (*dstX0 - *dstX1); /* chop off [t, 1] part */ - ASSERT(t >= 0.0 && t <= 1.0); + assert(t >= 0.0 && t <= 1.0); *dstX0 = maxValue; bias = (*srcX0 < *srcX1) ? -0.5F : 0.5F; *srcX0 = *srcX1 + (GLint) (t * (*srcX0 - *srcX1) + bias); @@ -825,20 +825,20 @@ clip_left_or_bottom(GLint *srcX0, GLint *srcX1, if (*dstX0 < minValue) { /* X0 outside left edge */ - ASSERT(*dstX1 > minValue); /* X1 should be inside left edge */ + assert(*dstX1 > minValue); /* X1 should be inside left edge */ t = (GLfloat) (minValue - *dstX0) / (GLfloat) (*dstX1 - *dstX0); /* chop off [0, t] part */ - ASSERT(t >= 0.0 && t <= 1.0); + assert(t >= 0.0 && t <= 1.0); *dstX0 = minValue; bias = (*srcX0 < *srcX1) ? 0.5F : -0.5F; *srcX0 = *srcX0 + (GLint) (t * (*srcX1 - *srcX0) + bias); } else if (*dstX1 < minValue) { /* X1 outside left edge */ - ASSERT(*dstX0 > minValue); /* X0 should be inside left edge */ + assert(*dstX0 > minValue); /* X0 should be inside left edge */ t = (GLfloat) (minValue - *dstX1) / (GLfloat) (*dstX0 - *dstX1); /* chop off [0, t] part */ - ASSERT(t >= 0.0 && t <= 1.0); + assert(t >= 0.0 && t <= 1.0); *dstX1 = minValue; bias = (*srcX0 < *srcX1) ? -0.5F : 0.5F; *srcX1 = *srcX1 + (GLint) (t * (*srcX0 - *srcX1) + bias); @@ -936,25 +936,25 @@ _mesa_clip_blit(struct gl_context *ctx, *srcY0, *srcY1, *dstY0, *dstY1); */ - ASSERT(*dstX0 >= dstXmin); - ASSERT(*dstX0 <= dstXmax); - ASSERT(*dstX1 >= dstXmin); - ASSERT(*dstX1 <= dstXmax); - - ASSERT(*dstY0 >= dstYmin); - ASSERT(*dstY0 <= dstYmax); - ASSERT(*dstY1 >= dstYmin); - ASSERT(*dstY1 <= dstYmax); - - ASSERT(*srcX0 >= srcXmin); - ASSERT(*srcX0 <= srcXmax); - ASSERT(*srcX1 >= srcXmin); - ASSERT(*srcX1 <= srcXmax); - - ASSERT(*srcY0 >= srcYmin); - ASSERT(*srcY0 <= srcYmax); - ASSERT(*srcY1 >= srcYmin); - ASSERT(*srcY1 <= srcYmax); + assert(*dstX0 >= dstXmin); + assert(*dstX0 <= dstXmax); + assert(*dstX1 >= dstXmin); + assert(*dstX1 <= dstXmax); + + assert(*dstY0 >= dstYmin); + assert(*dstY0 <= dstYmax); + assert(*dstY1 >= dstYmin); + assert(*dstY1 <= dstYmax); + + assert(*srcX0 >= srcXmin); + assert(*srcX0 <= srcXmax); + assert(*srcX1 >= srcXmin); + assert(*srcX1 <= srcXmax); + + assert(*srcY0 >= srcYmin); + assert(*srcY0 <= srcYmax); + assert(*srcY1 >= srcYmin); + assert(*srcY1 <= srcYmax); return GL_TRUE; } diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 4f5a2d11fa9..7997b0e0c36 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -92,7 +92,7 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment) #else uintptr_t ptr, buf; - ASSERT( alignment > 0 ); + assert( alignment > 0 ); ptr = (uintptr_t)malloc(bytes + alignment + sizeof(void *)); if (!ptr) @@ -141,7 +141,7 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment) #else uintptr_t ptr, buf; - ASSERT( alignment > 0 ); + assert( alignment > 0 ); ptr = (uintptr_t)calloc(1, bytes + alignment + sizeof(void *)); if (!ptr) diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index e483b826e91..7a1afd95930 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -101,7 +101,7 @@ _mesa_light(struct gl_context *ctx, GLuint lnum, GLenum pname, const GLfloat *pa { struct gl_light *light; - ASSERT(lnum < MAX_LIGHTS); + assert(lnum < MAX_LIGHTS); light = &ctx->Light.Light[lnum]; switch (pname) { @@ -142,15 +142,15 @@ _mesa_light(struct gl_context *ctx, GLuint lnum, GLenum pname, const GLfloat *pa COPY_3V(light->SpotDirection, params); break; case GL_SPOT_EXPONENT: - ASSERT(params[0] >= 0.0); - ASSERT(params[0] <= ctx->Const.MaxSpotExponent); + assert(params[0] >= 0.0); + assert(params[0] <= ctx->Const.MaxSpotExponent); if (light->SpotExponent == params[0]) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); light->SpotExponent = params[0]; break; case GL_SPOT_CUTOFF: - ASSERT(params[0] == 180.0 || (params[0] >= 0.0 && params[0] <= 90.0)); + assert(params[0] == 180.0 || (params[0] >= 0.0 && params[0] <= 90.0)); if (light->SpotCutoff == params[0]) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); @@ -164,21 +164,21 @@ _mesa_light(struct gl_context *ctx, GLuint lnum, GLenum pname, const GLfloat *pa light->_Flags &= ~LIGHT_SPOT; break; case GL_CONSTANT_ATTENUATION: - ASSERT(params[0] >= 0.0); + assert(params[0] >= 0.0); if (light->ConstantAttenuation == params[0]) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); light->ConstantAttenuation = params[0]; break; case GL_LINEAR_ATTENUATION: - ASSERT(params[0] >= 0.0); + assert(params[0] >= 0.0); if (light->LinearAttenuation == params[0]) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); light->LinearAttenuation = params[0]; break; case GL_QUADRATIC_ATTENUATION: - ASSERT(params[0] >= 0.0); + assert(params[0] >= 0.0); if (light->QuadraticAttenuation == params[0]) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); @@ -808,7 +808,7 @@ _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ) GLuint f; GLfloat (*mat)[4] = ctx->Light.Material.Attrib; - ASSERT(ctx->API == API_OPENGL_COMPAT); + assert(ctx->API == API_OPENGL_COMPAT); FLUSH_VERTICES(ctx, 0); /* update materials */ FLUSH_CURRENT(ctx, 0); /* update ctx->Light.Material from vertex buffer */ diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index cf1f0e9c957..11e3b2a62d4 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -621,7 +621,7 @@ COPY_CLEAN_4V_TYPE_AS_FLOAT(GLfloat dst[4], int sz, const GLfloat src[4], break; default: ASSIGN_4V(dst, 0.0f, 0.0f, 0.0f, 1.0f); /* silence warnings */ - ASSERT(!"Unexpected type in COPY_CLEAN_4V_TYPE_AS_FLOAT macro"); + assert(!"Unexpected type in COPY_CLEAN_4V_TYPE_AS_FLOAT macro"); } COPY_SZ_4V(dst, sz, src); } diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 0539caa4722..4a2ce751aa5 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -176,7 +176,7 @@ _mesa_MatrixMode( GLenum mode ) return; } #endif - ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->TextureMatrixStack)); + assert(ctx->Texture.CurrentUnit < Elements(ctx->TextureMatrixStack)); ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit]; break; case GL_MATRIX0_ARB: diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 75a12cd165b..7732d09b2ec 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -153,8 +153,8 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth, const GLuint k0 = (srcWidth == dstWidth) ? 0 : 1; const GLuint colStride = (srcWidth == dstWidth) ? 1 : 2; - ASSERT(comps >= 1); - ASSERT(comps <= 4); + assert(comps >= 1); + assert(comps <= 4); /* This assertion is no longer valid with non-power-of-2 textures assert(srcWidth == dstWidth || srcWidth == 2 * dstWidth); @@ -788,8 +788,8 @@ do_row_3D(GLenum datatype, GLuint comps, GLint srcWidth, const GLuint colStride = (srcWidth == dstWidth) ? 1 : 2; GLuint i, j, k; - ASSERT(comps >= 1); - ASSERT(comps <= 4); + assert(comps >= 1); + assert(comps <= 4); if ((datatype == GL_UNSIGNED_BYTE) && (comps == 4)) { DECLARE_ROW_POINTERS(GLubyte, 4); @@ -1650,7 +1650,7 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, } else { /* average border pixels from adjacent src image pairs */ - ASSERT(srcDepthNB == 2 * dstDepthNB); + assert(srcDepthNB == 2 * dstDepthNB); for (img = 0; img < dstDepthNB; img++) { const GLubyte *srcA, *srcB; GLubyte *dst; @@ -1902,7 +1902,7 @@ generate_mipmap_uncompressed(struct gl_context *ctx, GLenum target, /* get src image parameters */ srcImage = _mesa_select_tex_image(texObj, target, level); - ASSERT(srcImage); + assert(srcImage); srcWidth = srcImage->Width; srcHeight = srcImage->Height; srcDepth = srcImage->Depth; @@ -2097,7 +2097,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target, /* get src image parameters */ srcImage = _mesa_select_tex_image(texObj, target, level); - ASSERT(srcImage); + assert(srcImage); srcWidth = srcImage->Width; srcHeight = srcImage->Height; srcDepth = srcImage->Depth; @@ -2192,12 +2192,12 @@ _mesa_generate_mipmap(struct gl_context *ctx, GLenum target, struct gl_texture_image *srcImage; GLint maxLevel; - ASSERT(texObj); + assert(texObj); srcImage = _mesa_select_tex_image(texObj, target, texObj->BaseLevel); - ASSERT(srcImage); + assert(srcImage); maxLevel = _mesa_max_texture_levels(ctx, texObj->Target) - 1; - ASSERT(maxLevel >= 0); /* bad target */ + assert(maxLevel >= 0); /* bad target */ maxLevel = MIN2(maxLevel, texObj->MaxLevel); diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 2111a760400..3b77c494f91 100644 --- a/src/mesa/main/pack.c +++ b/src/mesa/main/pack.c @@ -257,9 +257,9 @@ extract_uint_indexes(GLuint n, GLuint indexes[], GLenum srcFormat, GLenum srcType, const GLvoid *src, const struct gl_pixelstore_attrib *unpack ) { - ASSERT(srcFormat == GL_COLOR_INDEX || srcFormat == GL_STENCIL_INDEX); + assert(srcFormat == GL_COLOR_INDEX || srcFormat == GL_STENCIL_INDEX); - ASSERT(srcType == GL_BITMAP || + assert(srcType == GL_BITMAP || srcType == GL_UNSIGNED_BYTE || srcType == GL_BYTE || srcType == GL_UNSIGNED_SHORT || @@ -503,7 +503,7 @@ _mesa_unpack_stencil_span( struct gl_context *ctx, GLuint n, const struct gl_pixelstore_attrib *srcPacking, GLbitfield transferOps ) { - ASSERT(srcType == GL_BITMAP || + assert(srcType == GL_BITMAP || srcType == GL_UNSIGNED_BYTE || srcType == GL_BYTE || srcType == GL_UNSIGNED_SHORT || @@ -516,7 +516,7 @@ _mesa_unpack_stencil_span( struct gl_context *ctx, GLuint n, srcType == GL_FLOAT || srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV); - ASSERT(dstType == GL_UNSIGNED_BYTE || + assert(dstType == GL_UNSIGNED_BYTE || dstType == GL_UNSIGNED_SHORT || dstType == GL_UNSIGNED_INT || dstType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV); @@ -988,7 +988,7 @@ _mesa_unpack_depth_span( struct gl_context *ctx, GLuint n, else if (dstType == GL_UNSIGNED_SHORT) { GLushort *zValues = (GLushort *) dest; GLuint i; - ASSERT(depthMax <= 0xffff); + assert(depthMax <= 0xffff); for (i = 0; i < n; i++) { zValues[i] = (GLushort) (depthValues[i] * (GLfloat) depthMax); } @@ -1004,7 +1004,7 @@ _mesa_unpack_depth_span( struct gl_context *ctx, GLuint n, } } else { - ASSERT(0); + assert(0); } free(depthTemp); diff --git a/src/mesa/main/pbo.c b/src/mesa/main/pbo.c index a0d61a6436b..5c906ed749a 100644 --- a/src/mesa/main/pbo.c +++ b/src/mesa/main/pbo.c @@ -182,7 +182,7 @@ _mesa_map_validate_pbo_source(struct gl_context *ctx, GLsizei clientMemSize, const GLvoid *ptr, const char *where) { - ASSERT(dimensions == 1 || dimensions == 2 || dimensions == 3); + assert(dimensions == 1 || dimensions == 2 || dimensions == 3); if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth, format, type, clientMemSize, ptr)) { @@ -220,7 +220,7 @@ void _mesa_unmap_pbo_source(struct gl_context *ctx, const struct gl_pixelstore_attrib *unpack) { - ASSERT(unpack != &ctx->Pack); /* catch pack/unpack mismatch */ + assert(unpack != &ctx->Pack); /* catch pack/unpack mismatch */ if (_mesa_is_bufferobj(unpack->BufferObj)) { ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj, MAP_INTERNAL); } @@ -279,7 +279,7 @@ _mesa_map_validate_pbo_dest(struct gl_context *ctx, GLenum format, GLenum type, GLsizei clientMemSize, GLvoid *ptr, const char *where) { - ASSERT(dimensions == 1 || dimensions == 2 || dimensions == 3); + assert(dimensions == 1 || dimensions == 2 || dimensions == 3); if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth, format, type, clientMemSize, ptr)) { @@ -317,7 +317,7 @@ void _mesa_unmap_pbo_dest(struct gl_context *ctx, const struct gl_pixelstore_attrib *pack) { - ASSERT(pack != &ctx->Unpack); /* catch pack/unpack mismatch */ + assert(pack != &ctx->Unpack); /* catch pack/unpack mismatch */ if (_mesa_is_bufferobj(pack->BufferObj)) { ctx->Driver.UnmapBuffer(ctx, pack->BufferObj, MAP_INTERNAL); } diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c index b713d956f78..fb241af1e31 100644 --- a/src/mesa/main/pipelineobj.c +++ b/src/mesa/main/pipelineobj.c @@ -187,7 +187,7 @@ _mesa_reference_pipeline_object_(struct gl_context *ctx, struct gl_pipeline_object *oldObj = *ptr; mtx_lock(&oldObj->Mutex); - ASSERT(oldObj->RefCount > 0); + assert(oldObj->RefCount > 0); oldObj->RefCount--; deleteFlag = (oldObj->RefCount == 0); mtx_unlock(&oldObj->Mutex); @@ -198,7 +198,7 @@ _mesa_reference_pipeline_object_(struct gl_context *ctx, *ptr = NULL; } - ASSERT(!*ptr); + assert(!*ptr); if (obj) { /* reference new pipeline object */ @@ -471,7 +471,7 @@ _mesa_DeleteProgramPipelines(GLsizei n, const GLuint *pipelines) lookup_pipeline_object(ctx, pipelines[i]); if (obj) { - ASSERT(obj->Name == pipelines[i]); + assert(obj->Name == pipelines[i]); /* If the pipeline object is currently bound, the spec says "If an * object that is currently bound is deleted, the binding for that diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index de26bf96150..0a7807d77ac 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -103,7 +103,7 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params) * If point parameters aren't supported, then this function shouldn't even * exist. */ - ASSERT(!(ctx->Extensions.ARB_point_sprite + assert(!(ctx->Extensions.ARB_point_sprite || ctx->Extensions.NV_point_sprite) || ctx->Extensions.EXT_point_parameters); diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index ca4b9431bbe..2e4a460c1fa 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -127,7 +127,7 @@ _mesa_readpixels_needs_slow_path(const struct gl_context *ctx, GLenum format, _mesa_get_read_renderbuffer_for_format(ctx, format); GLenum srcType; - ASSERT(rb); + assert(rb); /* There are different rules depending on the base format. */ switch (format) { @@ -180,7 +180,7 @@ readpixels_can_use_memcpy(const struct gl_context *ctx, GLenum format, GLenum ty struct gl_renderbuffer *rb = _mesa_get_read_renderbuffer_for_format(ctx, format); - ASSERT(rb); + assert(rb); if (_mesa_readpixels_needs_slow_path(ctx, format, type, GL_FALSE)) { return GL_FALSE; @@ -313,10 +313,10 @@ read_depth_pixels( struct gl_context *ctx, return; /* clipping should have been done already */ - ASSERT(x >= 0); - ASSERT(y >= 0); - ASSERT(x + width <= (GLint) rb->Width); - ASSERT(y + height <= (GLint) rb->Height); + assert(x >= 0); + assert(y >= 0); + assert(x + width <= (GLint) rb->Width); + assert(y + height <= (GLint) rb->Height); if (type == GL_UNSIGNED_INT && read_uint_depth_pixels(ctx, x, y, width, height, type, pixels, packing)) { diff --git a/src/mesa/main/remap.c b/src/mesa/main/remap.c index 4a881865a44..01f7594dc49 100644 --- a/src/mesa/main/remap.c +++ b/src/mesa/main/remap.c @@ -197,7 +197,7 @@ _mesa_do_init_remap_table(const char *pool, const char *spec; /* sanity check */ - ASSERT(i == remap[i].remap_index); + assert(i == remap[i].remap_index); spec = _mesa_function_pool + remap[i].pool_index; offset = _mesa_map_function_spec(spec); diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 98f3c13b557..e9d129a1dbb 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -172,7 +172,7 @@ _mesa_reference_renderbuffer_(struct gl_renderbuffer **ptr, struct gl_renderbuffer *oldRb = *ptr; mtx_lock(&oldRb->Mutex); - ASSERT(oldRb->RefCount > 0); + assert(oldRb->RefCount > 0); oldRb->RefCount--; /*printf("RB DECR %p (%d) to %d\n", (void*) oldRb, oldRb->Name, oldRb->RefCount);*/ deleteFlag = (oldRb->RefCount == 0); diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c index d62a06bf15b..d66b0b5e8d4 100644 --- a/src/mesa/main/samplerobj.c +++ b/src/mesa/main/samplerobj.c @@ -89,7 +89,7 @@ _mesa_reference_sampler_object_(struct gl_context *ctx, struct gl_sampler_object *oldSamp = *ptr; /*mtx_lock(&oldSamp->Mutex);*/ - ASSERT(oldSamp->RefCount > 0); + assert(oldSamp->RefCount > 0); oldSamp->RefCount--; #if 0 printf("SamplerObj %p %d DECR to %d\n", @@ -99,13 +99,13 @@ _mesa_reference_sampler_object_(struct gl_context *ctx, /*mtx_unlock(&oldSamp->Mutex);*/ if (deleteFlag) { - ASSERT(ctx->Driver.DeleteSamplerObject); + assert(ctx->Driver.DeleteSamplerObject); ctx->Driver.DeleteSamplerObject(ctx, oldSamp); } *ptr = NULL; } - ASSERT(!*ptr); + assert(!*ptr); if (samp) { /* reference new sampler */ diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c index 02ccf450bf9..d7620c8ef7e 100644 --- a/src/mesa/main/shaderobj.c +++ b/src/mesa/main/shaderobj.c @@ -67,7 +67,7 @@ _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, GLboolean deleteFlag = GL_FALSE; struct gl_shader *old = *ptr; - ASSERT(old->RefCount > 0); + assert(old->RefCount > 0); old->RefCount--; /*printf("SHADER DECR %p (%d) to %d\n", (void*) old, old->Name, old->RefCount);*/ @@ -207,7 +207,7 @@ _mesa_reference_shader_program_(struct gl_context *ctx, GLboolean deleteFlag = GL_FALSE; struct gl_shader_program *old = *ptr; - ASSERT(old->RefCount > 0); + assert(old->RefCount > 0); old->RefCount--; #if 0 printf("ShaderProgram %p ID=%u RefCount-- to %d\n", diff --git a/src/mesa/main/shaderobj.h b/src/mesa/main/shaderobj.h index 92f7a33eec2..3d696a1887e 100644 --- a/src/mesa/main/shaderobj.h +++ b/src/mesa/main/shaderobj.h @@ -114,7 +114,7 @@ _mesa_shader_enum_to_shader_stage(GLenum v) case GL_COMPUTE_SHADER: return MESA_SHADER_COMPUTE; default: - ASSERT(0 && "bad value in _mesa_shader_enum_to_shader_stage()"); + assert(0 && "bad value in _mesa_shader_enum_to_shader_stage()"); return MESA_SHADER_VERTEX; } } diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index ccf5355f3c4..7162bbc761e 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -159,7 +159,7 @@ delete_program_cb(GLuint id, void *data, void *userData) struct gl_program *prog = (struct gl_program *) data; struct gl_context *ctx = (struct gl_context *) userData; if(prog != &_mesa_DummyProgram) { - ASSERT(prog->RefCount == 1); /* should only be referenced by hash table */ + assert(prog->RefCount == 1); /* should only be referenced by hash table */ prog->RefCount = 0; /* now going away */ ctx->Driver.DeleteProgram(ctx, prog); } @@ -223,7 +223,7 @@ delete_shader_cb(GLuint id, void *data, void *userData) } else { struct gl_shader_program *shProg = (struct gl_shader_program *) data; - ASSERT(shProg->Type == GL_SHADER_PROGRAM_MESA); + assert(shProg->Type == GL_SHADER_PROGRAM_MESA); ctx->Driver.DeleteShaderProgram(ctx, shProg); } } @@ -346,7 +346,7 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared) * Free texture objects (after FBOs since some textures might have * been bound to FBOs). */ - ASSERT(ctx->Driver.DeleteTexture); + assert(ctx->Driver.DeleteTexture); /* the default textures */ for (i = 0; i < NUM_TEXTURE_TARGETS; i++) { ctx->Driver.DeleteTexture(ctx, shared->DefaultTex[i]); diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 45bce78fd4a..dadfb3c8c71 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -275,7 +275,7 @@ update_viewport_matrix(struct gl_context *ctx) const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; unsigned i; - ASSERT(depthMax > 0); + assert(depthMax > 0); /* Compute scale and bias values. This is really driver-specific * and should be maintained elsewhere if at all. diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index b4efeee3bcc..00234d4ccb3 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -570,8 +570,8 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img, _mesa_get_format_block_size(mesaFormat, &bw, &bh); - ASSERT(col % bw == 0); - ASSERT(row % bh == 0); + assert(col % bw == 0); + assert(row % bh == 0); offset = ((width + bw - 1) / bw) * (row / bh) + col / bw; offset *= blockSize; diff --git a/src/mesa/main/texcompress_bptc.c b/src/mesa/main/texcompress_bptc.c index c944ac26f34..a600180e236 100644 --- a/src/mesa/main/texcompress_bptc.c +++ b/src/mesa/main/texcompress_bptc.c @@ -1630,7 +1630,7 @@ texstore_bptc_rgb_float(TEXSTORE_PARAMS, GLboolean _mesa_texstore_bptc_rgb_signed_float(TEXSTORE_PARAMS) { - ASSERT(dstFormat == MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT); + assert(dstFormat == MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT); return texstore_bptc_rgb_float(ctx, dims, baseInternalFormat, dstFormat, dstRowStride, dstSlices, @@ -1643,7 +1643,7 @@ _mesa_texstore_bptc_rgb_signed_float(TEXSTORE_PARAMS) GLboolean _mesa_texstore_bptc_rgb_unsigned_float(TEXSTORE_PARAMS) { - ASSERT(dstFormat == MESA_FORMAT_BPTC_RGB_UNSIGNED_FLOAT); + assert(dstFormat == MESA_FORMAT_BPTC_RGB_UNSIGNED_FLOAT); return texstore_bptc_rgb_float(ctx, dims, baseInternalFormat, dstFormat, dstRowStride, dstSlices, diff --git a/src/mesa/main/texcompress_cpal.c b/src/mesa/main/texcompress_cpal.c index 54e9af41d05..c46ef8c53fb 100644 --- a/src/mesa/main/texcompress_cpal.c +++ b/src/mesa/main/texcompress_cpal.c @@ -32,7 +32,6 @@ #include "glheader.h" -#include "compiler.h" /* for ASSERT */ #include "context.h" #include "mtypes.h" #include "imports.h" @@ -120,7 +119,7 @@ _mesa_cpal_compressed_size(int level, GLenum internalFormat, } info = &formats[internalFormat - GL_PALETTE4_RGB8_OES]; - ASSERT(info->cpal_format == internalFormat); + assert(info->cpal_format == internalFormat); expect_size = info->palette_size * info->size; for (lvl = 0; lvl < num_levels; lvl++) { diff --git a/src/mesa/main/texcompress_etc.c b/src/mesa/main/texcompress_etc.c index 98b4fe20157..f29561cc61a 100644 --- a/src/mesa/main/texcompress_etc.c +++ b/src/mesa/main/texcompress_etc.c @@ -108,7 +108,7 @@ GLboolean _mesa_texstore_etc1_rgb8(TEXSTORE_PARAMS) { /* GL_ETC1_RGB8_OES is only valid in glCompressedTexImage2D */ - ASSERT(0); + assert(0); return GL_FALSE; } @@ -1099,7 +1099,7 @@ etc2_unpack_srgb8_punchthrough_alpha1(uint8_t *dst_row, GLboolean _mesa_texstore_etc2_rgb8(TEXSTORE_PARAMS) { - ASSERT(0); + assert(0); return GL_FALSE; } @@ -1107,7 +1107,7 @@ _mesa_texstore_etc2_rgb8(TEXSTORE_PARAMS) GLboolean _mesa_texstore_etc2_srgb8(TEXSTORE_PARAMS) { - ASSERT(0); + assert(0); return GL_FALSE; } @@ -1115,7 +1115,7 @@ _mesa_texstore_etc2_srgb8(TEXSTORE_PARAMS) GLboolean _mesa_texstore_etc2_rgba8_eac(TEXSTORE_PARAMS) { - ASSERT(0); + assert(0); return GL_FALSE; } @@ -1123,7 +1123,7 @@ _mesa_texstore_etc2_rgba8_eac(TEXSTORE_PARAMS) GLboolean _mesa_texstore_etc2_srgb8_alpha8_eac(TEXSTORE_PARAMS) { - ASSERT(0); + assert(0); return GL_FALSE; } @@ -1131,7 +1131,7 @@ _mesa_texstore_etc2_srgb8_alpha8_eac(TEXSTORE_PARAMS) GLboolean _mesa_texstore_etc2_r11_eac(TEXSTORE_PARAMS) { - ASSERT(0); + assert(0); return GL_FALSE; } @@ -1139,7 +1139,7 @@ _mesa_texstore_etc2_r11_eac(TEXSTORE_PARAMS) GLboolean _mesa_texstore_etc2_signed_r11_eac(TEXSTORE_PARAMS) { - ASSERT(0); + assert(0); return GL_FALSE; } @@ -1147,7 +1147,7 @@ _mesa_texstore_etc2_signed_r11_eac(TEXSTORE_PARAMS) GLboolean _mesa_texstore_etc2_rg11_eac(TEXSTORE_PARAMS) { - ASSERT(0); + assert(0); return GL_FALSE; } @@ -1155,7 +1155,7 @@ _mesa_texstore_etc2_rg11_eac(TEXSTORE_PARAMS) GLboolean _mesa_texstore_etc2_signed_rg11_eac(TEXSTORE_PARAMS) { - ASSERT(0); + assert(0); return GL_FALSE; } @@ -1163,7 +1163,7 @@ _mesa_texstore_etc2_signed_rg11_eac(TEXSTORE_PARAMS) GLboolean _mesa_texstore_etc2_rgb8_punchthrough_alpha1(TEXSTORE_PARAMS) { - ASSERT(0); + assert(0); return GL_FALSE; } @@ -1171,7 +1171,7 @@ _mesa_texstore_etc2_rgb8_punchthrough_alpha1(TEXSTORE_PARAMS) GLboolean _mesa_texstore_etc2_srgb8_punchthrough_alpha1(TEXSTORE_PARAMS) { - ASSERT(0); + assert(0); return GL_FALSE; } diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 7b25e103905..562359410b2 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -61,7 +61,7 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS) GLubyte *dst; const GLubyte *tempImage = NULL; - ASSERT(dstFormat == MESA_FORMAT_RGB_FXT1); + assert(dstFormat == MESA_FORMAT_RGB_FXT1); if (srcFormat != GL_RGB || srcType != GL_UNSIGNED_BYTE || @@ -116,7 +116,7 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS) GLubyte *dst; const GLubyte *tempImage = NULL; - ASSERT(dstFormat == MESA_FORMAT_RGBA_FXT1); + assert(dstFormat == MESA_FORMAT_RGBA_FXT1); if (srcFormat != GL_RGBA || srcType != GL_UNSIGNED_BYTE || @@ -1264,12 +1264,12 @@ upscale_teximage2d(GLsizei inWidth, GLsizei inHeight, { GLint i, j, k; - ASSERT(outWidth >= inWidth); - ASSERT(outHeight >= inHeight); + assert(outWidth >= inWidth); + assert(outHeight >= inHeight); #if 0 - ASSERT(inWidth == 1 || inWidth == 2 || inHeight == 1 || inHeight == 2); - ASSERT((outWidth & 3) == 0); - ASSERT((outHeight & 3) == 0); + assert(inWidth == 1 || inWidth == 2 || inHeight == 1 || inHeight == 2); + assert((outWidth & 3) == 0); + assert((outHeight & 3) == 0); #endif for (i = 0; i < outHeight; i++) { diff --git a/src/mesa/main/texcompress_rgtc.c b/src/mesa/main/texcompress_rgtc.c index e3042011a71..f40e4e6c09b 100644 --- a/src/mesa/main/texcompress_rgtc.c +++ b/src/mesa/main/texcompress_rgtc.c @@ -86,7 +86,7 @@ _mesa_texstore_red_rgtc1(TEXSTORE_PARAMS) GLint dstRowDiff, redRowStride; GLubyte *tempImageSlices[1]; - ASSERT(dstFormat == MESA_FORMAT_R_RGTC1_UNORM || + assert(dstFormat == MESA_FORMAT_R_RGTC1_UNORM || dstFormat == MESA_FORMAT_L_LATC1_UNORM); tempImage = malloc(srcWidth * srcHeight * 1 * sizeof(GLubyte)); @@ -139,7 +139,7 @@ _mesa_texstore_signed_red_rgtc1(TEXSTORE_PARAMS) GLint dstRowDiff, redRowStride; GLfloat *tempImageSlices[1]; - ASSERT(dstFormat == MESA_FORMAT_R_RGTC1_SNORM || + assert(dstFormat == MESA_FORMAT_R_RGTC1_SNORM || dstFormat == MESA_FORMAT_L_LATC1_SNORM); redRowStride = 1 * srcWidth * sizeof(GLfloat); @@ -193,7 +193,7 @@ _mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS) mesa_format tempFormat; GLubyte *tempImageSlices[1]; - ASSERT(dstFormat == MESA_FORMAT_RG_RGTC2_UNORM || + assert(dstFormat == MESA_FORMAT_RG_RGTC2_UNORM || dstFormat == MESA_FORMAT_LA_LATC2_UNORM); if (baseInternalFormat == GL_RG) @@ -258,7 +258,7 @@ _mesa_texstore_signed_rg_rgtc2(TEXSTORE_PARAMS) mesa_format tempFormat; GLfloat *tempImageSlices[1]; - ASSERT(dstFormat == MESA_FORMAT_RG_RGTC2_SNORM || + assert(dstFormat == MESA_FORMAT_RG_RGTC2_SNORM || dstFormat == MESA_FORMAT_LA_LATC2_SNORM); if (baseInternalFormat == GL_RG) diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index bfb53dce48d..41d00d4e91d 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -133,7 +133,7 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) GLubyte *dst; const GLubyte *tempImage = NULL; - ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1 || + assert(dstFormat == MESA_FORMAT_RGB_DXT1 || dstFormat == MESA_FORMAT_SRGB_DXT1); if (srcFormat != GL_RGB || @@ -190,7 +190,7 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) GLubyte *dst; const GLubyte *tempImage = NULL; - ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1 || + assert(dstFormat == MESA_FORMAT_RGBA_DXT1 || dstFormat == MESA_FORMAT_SRGBA_DXT1); if (srcFormat != GL_RGBA || @@ -247,7 +247,7 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) GLubyte *dst; const GLubyte *tempImage = NULL; - ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3 || + assert(dstFormat == MESA_FORMAT_RGBA_DXT3 || dstFormat == MESA_FORMAT_SRGBA_DXT3); if (srcFormat != GL_RGBA || @@ -303,7 +303,7 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS) GLubyte *dst; const GLubyte *tempImage = NULL; - ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5 || + assert(dstFormat == MESA_FORMAT_RGBA_DXT5 || dstFormat == MESA_FORMAT_SRGBA_DXT5); if (srcFormat != GL_RGBA || diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index ec16af9d2a1..3c4baca7026 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -430,12 +430,12 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_RGB9_E5: /* GL_EXT_texture_shared_exponent -- just one format to support */ - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_R9G9B9E5_FLOAT]); + assert(ctx->TextureFormatSupported[MESA_FORMAT_R9G9B9E5_FLOAT]); return MESA_FORMAT_R9G9B9E5_FLOAT; case GL_R11F_G11F_B10F: /* GL_EXT_texture_packed_float -- just one format to support */ - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_R11G11B10_FLOAT]); + assert(ctx->TextureFormatSupported[MESA_FORMAT_R11G11B10_FLOAT]); return MESA_FORMAT_R11G11B10_FLOAT; case GL_DEPTH_STENCIL_EXT: @@ -445,10 +445,10 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, break; case GL_DEPTH_COMPONENT32F: - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z_FLOAT32]); + assert(ctx->TextureFormatSupported[MESA_FORMAT_Z_FLOAT32]); return MESA_FORMAT_Z_FLOAT32; case GL_DEPTH32F_STENCIL8: - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_S8X24_UINT]); + assert(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_S8X24_UINT]); return MESA_FORMAT_Z32_FLOAT_S8X24_UINT; case GL_RED_SNORM: diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 29c325bf222..f73edc3fff5 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -650,8 +650,8 @@ set_tex_image(struct gl_texture_object *tObj, { const GLuint face = _mesa_tex_target_to_face(target); - ASSERT(tObj); - ASSERT(texImage); + assert(tObj); + assert(texImage); if (target == GL_TEXTURE_RECTANGLE_NV || target == GL_TEXTURE_EXTERNAL_OES) assert(level == 0); @@ -696,7 +696,7 @@ _mesa_delete_texture_image(struct gl_context *ctx, /* Free texImage->Data and/or any other driver-specific texture * image storage. */ - ASSERT(ctx->Driver.FreeTextureImageBuffer); + assert(ctx->Driver.FreeTextureImageBuffer); ctx->Driver.FreeTextureImageBuffer( ctx, texImage ); free(texImage); } @@ -807,9 +807,9 @@ _mesa_select_tex_image(const struct gl_texture_object *texObj, { const GLuint face = _mesa_tex_target_to_face(target); - ASSERT(texObj); - ASSERT(level >= 0); - ASSERT(level < MAX_TEXTURE_LEVELS); + assert(texObj); + assert(level >= 0); + assert(level < MAX_TEXTURE_LEVELS); return texObj->Image[face][level]; } @@ -1239,7 +1239,7 @@ make_null_texture(GLint width, GLint height, GLint depth, GLenum format) static void clear_teximage_fields(struct gl_texture_image *img) { - ASSERT(img); + assert(img); img->_BaseFormat = 0; img->InternalFormat = 0; img->Border = 0; @@ -1284,14 +1284,14 @@ init_teximage_fields_ms(struct gl_context *ctx, GLuint numSamples, GLboolean fixedSampleLocations) { GLenum target; - ASSERT(img); - ASSERT(width >= 0); - ASSERT(height >= 0); - ASSERT(depth >= 0); + assert(img); + assert(width >= 0); + assert(height >= 0); + assert(depth >= 0); target = img->TexObject->Target; img->_BaseFormat = _mesa_base_tex_format( ctx, internalFormat ); - ASSERT(img->_BaseFormat != -1); + assert(img->_BaseFormat != -1); img->InternalFormat = internalFormat; img->Border = border; img->Width = width; @@ -2184,7 +2184,7 @@ texture_error_check( struct gl_context *ctx, /* additional checks for ycbcr textures */ if (internalFormat == GL_YCBCR_MESA) { - ASSERT(ctx->Extensions.MESA_ycbcr_texture); + assert(ctx->Extensions.MESA_ycbcr_texture); if (type != GL_UNSIGNED_SHORT_8_8_MESA && type != GL_UNSIGNED_SHORT_8_8_REV_MESA) { char message[100]; @@ -2933,7 +2933,7 @@ check_rtt_cb(GLuint key, void *data, void *userData) att->TextureLevel == level && att->CubeMapFace == face) { _mesa_update_texture_renderbuffer(ctx, ctx->DrawBuffer, att); - ASSERT(att->Renderbuffer->TexImage); + assert(att->Renderbuffer->TexImage); /* Mark fb status as indeterminate to force re-validation */ fb->_Status = 0; } @@ -2977,7 +2977,7 @@ check_gen_mipmap(struct gl_context *ctx, GLenum target, if (texObj->GenerateMipmap && level == texObj->BaseLevel && level < texObj->MaxLevel) { - ASSERT(ctx->Driver.GenerateMipmap); + assert(ctx->Driver.GenerateMipmap); ctx->Driver.GenerateMipmap(ctx, target, texObj); } } @@ -3054,7 +3054,7 @@ _mesa_choose_texture_format(struct gl_context *ctx, prevImage->Width > 0 && prevImage->InternalFormat == internalFormat) { /* use the same format */ - ASSERT(prevImage->TexFormat != MESA_FORMAT_NONE); + assert(prevImage->TexFormat != MESA_FORMAT_NONE); return prevImage->TexFormat; } } @@ -3093,7 +3093,7 @@ _mesa_choose_texture_format(struct gl_context *ctx, /* choose format from scratch */ f = ctx->Driver.ChooseTextureFormat(ctx, target, internalFormat, format, type); - ASSERT(f != MESA_FORMAT_NONE); + assert(f != MESA_FORMAT_NONE); return f; } diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 59090db4ecf..d5aa620e1f6 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -265,7 +265,7 @@ _mesa_initialize_texture_object( struct gl_context *ctx, struct gl_texture_object *obj, GLuint name, GLenum target ) { - ASSERT(target == 0 || + assert(target == 0 || target == GL_TEXTURE_1D || target == GL_TEXTURE_2D || target == GL_TEXTURE_3D || @@ -541,11 +541,11 @@ _mesa_reference_texobj_(struct gl_texture_object **ptr, GLboolean deleteFlag = GL_FALSE; struct gl_texture_object *oldTex = *ptr; - ASSERT(valid_texture_object(oldTex)); + assert(valid_texture_object(oldTex)); (void) valid_texture_object; /* silence warning in release builds */ mtx_lock(&oldTex->Mutex); - ASSERT(oldTex->RefCount > 0); + assert(oldTex->RefCount > 0); oldTex->RefCount--; deleteFlag = (oldTex->RefCount == 0); @@ -568,7 +568,7 @@ _mesa_reference_texobj_(struct gl_texture_object **ptr, if (tex) { /* reference new texture */ - ASSERT(valid_texture_object(tex)); + assert(valid_texture_object(tex)); mtx_lock(&tex->Mutex); if (tex->RefCount == 0) { /* this texture's being deleted (look just above) */ @@ -730,7 +730,7 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, return; } - ASSERT(maxLevels > 0); + assert(maxLevels > 0); t->_MaxLevel = MIN3(t->MaxLevel, /* 'p' in the GL spec */ @@ -1724,7 +1724,7 @@ _mesa_BindTexture( GLenum target, GLuint texName ) _mesa_reference_texobj(&texUnit->CurrentTex[targetIndex], newTexObj); ctx->Texture.NumCurrentTexUsed = MAX2(ctx->Texture.NumCurrentTexUsed, ctx->Texture.CurrentUnit + 1); - ASSERT(texUnit->CurrentTex[targetIndex]); + assert(texUnit->CurrentTex[targetIndex]); if (texName != 0) texUnit->_BoundTextures |= (1 << targetIndex); @@ -1773,7 +1773,7 @@ _mesa_bind_texture_unit(struct gl_context *ctx, _mesa_reference_texobj(&texUnit->CurrentTex[texObj->TargetIndex], texObj); - ASSERT(texUnit->CurrentTex[texObj->TargetIndex]); + assert(texUnit->CurrentTex[texObj->TargetIndex]); ctx->Texture.NumCurrentTexUsed = MAX2(ctx->Texture.NumCurrentTexUsed, unit + 1); texUnit->_BoundTextures |= (1 << texObj->TargetIndex); diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index c4a5841c56c..1ef72866029 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -217,8 +217,8 @@ comp_to_swizzle(GLenum comp) static void set_swizzle_component(GLuint *swizzle, GLuint comp, GLuint swz) { - ASSERT(comp < 4); - ASSERT(swz <= SWIZZLE_NIL); + assert(comp < 4); + assert(swz <= SWIZZLE_NIL); { GLuint mask = 0x7 << (3 * comp); GLuint s = (*swizzle & ~mask) | (swz << (3 * comp)); @@ -537,7 +537,7 @@ set_tex_parameteri(struct gl_context *ctx, "glTex%sParameter(swizzle 0x%x)", suffix, params[0]); return GL_FALSE; } - ASSERT(comp < 4); + assert(comp < 4); flush(ctx); texObj->Swizzle[comp] = params[0]; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 99c7c81788a..d458b82e345 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -68,8 +68,8 @@ _mesa_copy_texture_state( const struct gl_context *src, struct gl_context *dst ) { GLuint u, tex; - ASSERT(src); - ASSERT(dst); + assert(src); + assert(dst); dst->Texture.CurrentUnit = src->Texture.CurrentUnit; dst->Texture._GenFlags = src->Texture._GenFlags; @@ -292,7 +292,7 @@ _mesa_ActiveTexture(GLenum texture) k = _mesa_max_tex_unit(ctx); - ASSERT(k <= Elements(ctx->Texture.Unit)); + assert(k <= Elements(ctx->Texture.Unit)); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) _mesa_debug(ctx, "glActiveTexture %s\n", @@ -363,7 +363,7 @@ update_texture_matrices( struct gl_context *ctx ) ctx->Texture._TexMatEnabled = 0x0; for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) { - ASSERT(u < Elements(ctx->TextureMatrixStack)); + assert(u < Elements(ctx->TextureMatrixStack)); if (_math_matrix_is_dirty(ctx->TextureMatrixStack[u].Top)) { _math_matrix_analyse( ctx->TextureMatrixStack[u].Top ); @@ -501,7 +501,7 @@ update_texgen(struct gl_context *ctx) ctx->Texture._GenFlags |= texUnit->_GenFlags; } - ASSERT(unit < Elements(ctx->TextureMatrixStack)); + assert(unit < Elements(ctx->TextureMatrixStack)); if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit); } diff --git a/src/mesa/main/texstate.h b/src/mesa/main/texstate.h index abc07eafb4e..ce7b5d7f2d1 100644 --- a/src/mesa/main/texstate.h +++ b/src/mesa/main/texstate.h @@ -41,7 +41,7 @@ static inline struct gl_texture_unit * _mesa_get_tex_unit(struct gl_context *ctx, GLuint unit) { - ASSERT(unit < Elements(ctx->Texture.Unit)); + assert(unit < Elements(ctx->Texture.Unit)); return &(ctx->Texture.Unit[unit]); } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 7039cdf8174..7ad9d2b68e1 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -154,9 +154,9 @@ _mesa_texstore_z32(TEXSTORE_PARAMS) const GLuint depthScale = 0xffffffff; GLenum dstType; (void) dims; - ASSERT(dstFormat == MESA_FORMAT_Z_UNORM32 || + assert(dstFormat == MESA_FORMAT_Z_UNORM32 || dstFormat == MESA_FORMAT_Z_FLOAT32); - ASSERT(_mesa_get_format_bytes(dstFormat) == sizeof(GLuint)); + assert(_mesa_get_format_bytes(dstFormat) == sizeof(GLuint)); if (dstFormat == MESA_FORMAT_Z_UNORM32) dstType = GL_UNSIGNED_INT; @@ -191,7 +191,7 @@ _mesa_texstore_x8_z24(TEXSTORE_PARAMS) const GLuint depthScale = 0xffffff; (void) dims; - ASSERT(dstFormat == MESA_FORMAT_Z24_UNORM_X8_UINT); + assert(dstFormat == MESA_FORMAT_Z24_UNORM_X8_UINT); { /* general path */ @@ -221,7 +221,7 @@ _mesa_texstore_z24_x8(TEXSTORE_PARAMS) const GLuint depthScale = 0xffffff; (void) dims; - ASSERT(dstFormat == MESA_FORMAT_X8_UINT_Z24_UNORM); + assert(dstFormat == MESA_FORMAT_X8_UINT_Z24_UNORM); { /* general path */ @@ -254,8 +254,8 @@ _mesa_texstore_z16(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffff; (void) dims; - ASSERT(dstFormat == MESA_FORMAT_Z_UNORM16); - ASSERT(_mesa_get_format_bytes(dstFormat) == sizeof(GLushort)); + assert(dstFormat == MESA_FORMAT_Z_UNORM16); + assert(_mesa_get_format_bytes(dstFormat) == sizeof(GLushort)); { /* general path */ @@ -287,14 +287,14 @@ _mesa_texstore_ycbcr(TEXSTORE_PARAMS) (void) ctx; (void) dims; (void) baseInternalFormat; - ASSERT((dstFormat == MESA_FORMAT_YCBCR) || + assert((dstFormat == MESA_FORMAT_YCBCR) || (dstFormat == MESA_FORMAT_YCBCR_REV)); - ASSERT(_mesa_get_format_bytes(dstFormat) == 2); - ASSERT(ctx->Extensions.MESA_ycbcr_texture); - ASSERT(srcFormat == GL_YCBCR_MESA); - ASSERT((srcType == GL_UNSIGNED_SHORT_8_8_MESA) || + assert(_mesa_get_format_bytes(dstFormat) == 2); + assert(ctx->Extensions.MESA_ycbcr_texture); + assert(srcFormat == GL_YCBCR_MESA); + assert((srcType == GL_UNSIGNED_SHORT_8_8_MESA) || (srcType == GL_UNSIGNED_SHORT_8_8_REV_MESA)); - ASSERT(baseInternalFormat == GL_YCBCR_MESA); + assert(baseInternalFormat == GL_YCBCR_MESA); /* always just memcpy since no pixel transfer ops apply */ memcpy_texture(ctx, dims, @@ -335,11 +335,11 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS) GLuint *depth = malloc(srcWidth * sizeof(GLuint)); GLubyte *stencil = malloc(srcWidth * sizeof(GLubyte)); - ASSERT(dstFormat == MESA_FORMAT_S8_UINT_Z24_UNORM); - ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || + assert(dstFormat == MESA_FORMAT_S8_UINT_Z24_UNORM); + assert(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT || srcFormat == GL_STENCIL_INDEX); - ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT || + assert(srcFormat != GL_DEPTH_STENCIL_EXT || srcType == GL_UNSIGNED_INT_24_8_EXT || srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV); @@ -414,11 +414,11 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) GLuint *depth; GLubyte *stencil; - ASSERT(dstFormat == MESA_FORMAT_Z24_UNORM_S8_UINT); - ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || + assert(dstFormat == MESA_FORMAT_Z24_UNORM_S8_UINT); + assert(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT || srcFormat == GL_STENCIL_INDEX); - ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT || + assert(srcFormat != GL_DEPTH_STENCIL_EXT || srcType == GL_UNSIGNED_INT_24_8_EXT || srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV); @@ -491,8 +491,8 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_s8(TEXSTORE_PARAMS) { - ASSERT(dstFormat == MESA_FORMAT_S_UINT8); - ASSERT(srcFormat == GL_STENCIL_INDEX); + assert(dstFormat == MESA_FORMAT_S_UINT8); + assert(srcFormat == GL_STENCIL_INDEX); { const GLint srcRowStride @@ -543,11 +543,11 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS) = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType) / sizeof(uint64_t); - ASSERT(dstFormat == MESA_FORMAT_Z32_FLOAT_S8X24_UINT); - ASSERT(srcFormat == GL_DEPTH_STENCIL || + assert(dstFormat == MESA_FORMAT_Z32_FLOAT_S8X24_UINT); + assert(srcFormat == GL_DEPTH_STENCIL || srcFormat == GL_DEPTH_COMPONENT || srcFormat == GL_STENCIL_INDEX); - ASSERT(srcFormat != GL_DEPTH_STENCIL || + assert(srcFormat != GL_DEPTH_STENCIL || srcType == GL_UNSIGNED_INT_24_8 || srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV); @@ -606,7 +606,7 @@ texstore_depth_stencil(TEXSTORE_PARAMS) initialized = GL_TRUE; } - ASSERT(table[dstFormat]); + assert(table[dstFormat]); return table[dstFormat](ctx, dims, baseInternalFormat, dstFormat, dstRowStride, dstSlices, srcWidth, srcHeight, srcDepth, @@ -666,7 +666,7 @@ texstore_compressed(TEXSTORE_PARAMS) initialized = GL_TRUE; } - ASSERT(table[dstFormat]); + assert(table[dstFormat]); return table[dstFormat](ctx, dims, baseInternalFormat, dstFormat, dstRowStride, dstSlices, srcWidth, srcHeight, srcDepth, @@ -1225,10 +1225,10 @@ _mesa_store_compressed_teximage(struct gl_context *ctx, GLuint dims, * have to worry about the usual image unpacking or image transfer * operations. */ - ASSERT(texImage); - ASSERT(texImage->Width > 0); - ASSERT(texImage->Height > 0); - ASSERT(texImage->Depth > 0); + assert(texImage); + assert(texImage->Width > 0); + assert(texImage->Height > 0); + assert(texImage->Depth > 0); /* allocate storage for texture data */ if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage)) { diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index a73746335fe..1e23e8fc2ff 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -93,7 +93,7 @@ reference_transform_feedback_object(struct gl_transform_feedback_object **ptr, /* Unreference the old object */ struct gl_transform_feedback_object *oldObj = *ptr; - ASSERT(oldObj->RefCount > 0); + assert(oldObj->RefCount > 0); oldObj->RefCount--; if (oldObj->RefCount == 0) { @@ -104,7 +104,7 @@ reference_transform_feedback_object(struct gl_transform_feedback_object **ptr, *ptr = NULL; } - ASSERT(!*ptr); + assert(!*ptr); if (obj) { /* reference new object */ @@ -143,7 +143,7 @@ void _mesa_init_transform_feedback(struct gl_context *ctx) { /* core mesa expects this, even a dummy one, to be available */ - ASSERT(ctx->Driver.NewTransformFeedback); + assert(ctx->Driver.NewTransformFeedback); ctx->TransformFeedback.DefaultObject = ctx->Driver.NewTransformFeedback(ctx, 0); @@ -185,7 +185,7 @@ void _mesa_free_transform_feedback(struct gl_context *ctx) { /* core mesa expects this, even a dummy one, to be available */ - ASSERT(ctx->Driver.NewTransformFeedback); + assert(ctx->Driver.NewTransformFeedback); _mesa_reference_buffer_object(ctx, &ctx->TransformFeedback.CurrentBuffer, diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 978ec7b535b..6df50de6aa0 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -356,7 +356,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 +714,7 @@ _mesa_EnableVertexAttribArray(GLuint index) vao = ctx->Array.VAO; - ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib)); + assert(VERT_ATTRIB_GENERIC(index) < Elements(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) < Elements(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) < Elements(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) < Elements(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) < Elements(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 < Elements(ctx->Array.VAO->VertexAttrib)); /* The ARB_vertex_attrib_binding spec says: * @@ -1802,7 +1802,7 @@ _mesa_VertexAttribBinding(GLuint attribIndex, GLuint bindingIndex) return; } - ASSERT(VERT_ATTRIB_GENERIC(attribIndex) < + assert(VERT_ATTRIB_GENERIC(attribIndex) < Elements(ctx->Array.VAO->VertexAttrib)); vertex_attrib_binding(ctx, VERT_ATTRIB_GENERIC(attribIndex), diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c index f56b4cfc7f1..632c82ea258 100644 --- a/src/mesa/math/m_debug_xform.c +++ b/src/mesa/math/m_debug_xform.c @@ -187,7 +187,7 @@ static int test_transform_function( transform_func func, int psize, mat->type = mtypes[mtype]; m = mat->m; - ASSERT( ((long)m & 15) == 0 ); + assert( ((long)m & 15) == 0 ); init_matrix( m ); @@ -206,7 +206,7 @@ static int test_transform_function( transform_func func, int psize, case VAR: break; default: - ASSERT(0); + assert(0); return 0; } } diff --git a/src/mesa/math/m_trans_tmp.h b/src/mesa/math/m_trans_tmp.h index 0e9f666472f..0a8bfc53848 100644 --- a/src/mesa/math/m_trans_tmp.h +++ b/src/mesa/math/m_trans_tmp.h @@ -198,19 +198,19 @@ static void DEST_1UI( GLuint *t, static void INIT(void) { #ifdef DEST_1UI - ASSERT(SZ == 1); + assert(SZ == 1); TAB(_1ui)[SRC_IDX] = DEST_1UI; #endif #ifdef DEST_1UB - ASSERT(SZ == 1); + assert(SZ == 1); TAB(_1ub)[SRC_IDX] = DEST_1UB; #endif #ifdef DEST_1F - ASSERT(SZ == 1); + assert(SZ == 1); TAB(_1f)[SRC_IDX] = DEST_1F; #endif #ifdef DEST_3FN - ASSERT(SZ == 3); + assert(SZ == 3); TAB(_3fn)[SRC_IDX] = DEST_3FN; #endif #ifdef DEST_4UB diff --git a/src/mesa/program/arbprogparse.c b/src/mesa/program/arbprogparse.c index 53a6f37cb7a..3ddaeca8a71 100644 --- a/src/mesa/program/arbprogparse.c +++ b/src/mesa/program/arbprogparse.c @@ -73,7 +73,7 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target, struct asm_parser_state state; GLuint i; - ASSERT(target == GL_FRAGMENT_PROGRAM_ARB); + assert(target == GL_FRAGMENT_PROGRAM_ARB); memset(&prog, 0, sizeof(prog)); memset(&state, 0, sizeof(state)); @@ -166,7 +166,7 @@ _mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target, struct gl_program prog; struct asm_parser_state state; - ASSERT(target == GL_VERTEX_PROGRAM_ARB); + assert(target == GL_VERTEX_PROGRAM_ARB); memset(&prog, 0, sizeof(prog)); memset(&state, 0, sizeof(state)); diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c index b2fbc808aad..8f83c311ece 100644 --- a/src/mesa/program/prog_execute.c +++ b/src/mesa/program/prog_execute.c @@ -190,10 +190,10 @@ fetch_vector4(const struct prog_src_register *source, COPY_4V(result, src); } else { - ASSERT(GET_SWZ(source->Swizzle, 0) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 1) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 2) <= 3); - ASSERT(GET_SWZ(source->Swizzle, 3) <= 3); + assert(GET_SWZ(source->Swizzle, 0) <= 3); + assert(GET_SWZ(source->Swizzle, 1) <= 3); + assert(GET_SWZ(source->Swizzle, 2) <= 3); + assert(GET_SWZ(source->Swizzle, 3) <= 3); result[0] = src[GET_SWZ(source->Swizzle, 0)]; result[1] = src[GET_SWZ(source->Swizzle, 1)]; result[2] = src[GET_SWZ(source->Swizzle, 2)]; @@ -207,7 +207,7 @@ fetch_vector4(const struct prog_src_register *source, result[3] = FABSF(result[3]); } if (source->Negate) { - ASSERT(source->Negate == NEGATE_XYZW); + assert(source->Negate == NEGATE_XYZW); result[0] = -result[0]; result[1] = -result[1]; result[2] = -result[2]; @@ -265,7 +265,7 @@ fetch_vector4_deriv(struct gl_context * ctx, result[3] = FABSF(result[3]); } if (source->Negate) { - ASSERT(source->Negate == NEGATE_XYZW); + assert(source->Negate == NEGATE_XYZW); result[0] = -result[0]; result[1] = -result[1]; result[2] = -result[2]; @@ -556,12 +556,12 @@ _mesa_execute_program(struct gl_context * ctx, break; case OPCODE_BGNLOOP: /* no-op */ - ASSERT(program->Instructions[inst->BranchTarget].Opcode + assert(program->Instructions[inst->BranchTarget].Opcode == OPCODE_ENDLOOP); break; case OPCODE_ENDLOOP: /* subtract 1 here since pc is incremented by for(pc) loop */ - ASSERT(program->Instructions[inst->BranchTarget].Opcode + assert(program->Instructions[inst->BranchTarget].Opcode == OPCODE_BGNLOOP); pc = inst->BranchTarget - 1; /* go to matching BNGLOOP */ break; @@ -570,7 +570,7 @@ _mesa_execute_program(struct gl_context * ctx, case OPCODE_ENDSUB: /* end subroutine */ break; case OPCODE_BRK: /* break out of loop (conditional) */ - ASSERT(program->Instructions[inst->BranchTarget].Opcode + assert(program->Instructions[inst->BranchTarget].Opcode == OPCODE_ENDLOOP); if (eval_condition(machine, inst)) { /* break out of loop */ @@ -579,7 +579,7 @@ _mesa_execute_program(struct gl_context * ctx, } break; case OPCODE_CONT: /* continue loop (conditional) */ - ASSERT(program->Instructions[inst->BranchTarget].Opcode + assert(program->Instructions[inst->BranchTarget].Opcode == OPCODE_ENDLOOP); if (eval_condition(machine, inst)) { /* continue at ENDLOOP */ @@ -768,7 +768,7 @@ _mesa_execute_program(struct gl_context * ctx, case OPCODE_IF: { GLboolean cond; - ASSERT(program->Instructions[inst->BranchTarget].Opcode + assert(program->Instructions[inst->BranchTarget].Opcode == OPCODE_ELSE || program->Instructions[inst->BranchTarget].Opcode == OPCODE_ENDIF); @@ -797,7 +797,7 @@ _mesa_execute_program(struct gl_context * ctx, break; case OPCODE_ELSE: /* goto ENDIF */ - ASSERT(program->Instructions[inst->BranchTarget].Opcode + assert(program->Instructions[inst->BranchTarget].Opcode == OPCODE_ENDIF); assert(inst->BranchTarget >= 0); pc = inst->BranchTarget; @@ -1260,7 +1260,7 @@ _mesa_execute_program(struct gl_context * ctx, else if (swz == SWIZZLE_ONE) result[i] = 1.0; else { - ASSERT(swz <= 3); + assert(swz <= 3); result[i] = src[swz]; } if (source->Negate & (1 << i)) @@ -1357,7 +1357,7 @@ _mesa_execute_program(struct gl_context * ctx, fetch_vector4(&inst->SrcReg[0], machine, texcoord); /* Not so sure about this test - if texcoord[3] is - * zero, we'd probably be fine except for an ASSERT in + * zero, we'd probably be fine except for an assert in * IROUND_POS() which gets triggered by the inf values created. */ if (texcoord[3] != 0.0) { diff --git a/src/mesa/program/prog_instruction.c b/src/mesa/program/prog_instruction.c index 254c0128fcd..6a9bcb7b579 100644 --- a/src/mesa/program/prog_instruction.c +++ b/src/mesa/program/prog_instruction.c @@ -200,9 +200,9 @@ static const struct instruction_info InstInfo[MAX_OPCODE] = { GLuint _mesa_num_inst_src_regs(gl_inst_opcode opcode) { - ASSERT(opcode < MAX_OPCODE); - ASSERT(opcode == InstInfo[opcode].Opcode); - ASSERT(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode); + assert(opcode < MAX_OPCODE); + assert(opcode == InstInfo[opcode].Opcode); + assert(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode); return InstInfo[opcode].NumSrcRegs; } @@ -213,9 +213,9 @@ _mesa_num_inst_src_regs(gl_inst_opcode opcode) GLuint _mesa_num_inst_dst_regs(gl_inst_opcode opcode) { - ASSERT(opcode < MAX_OPCODE); - ASSERT(opcode == InstInfo[opcode].Opcode); - ASSERT(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode); + assert(opcode < MAX_OPCODE); + assert(opcode == InstInfo[opcode].Opcode); + assert(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode); return InstInfo[opcode].NumDstRegs; } diff --git a/src/mesa/program/prog_optimize.c b/src/mesa/program/prog_optimize.c index 65d427cb420..6d4485acb65 100644 --- a/src/mesa/program/prog_optimize.c +++ b/src/mesa/program/prog_optimize.c @@ -57,7 +57,7 @@ get_src_arg_mask(const struct prog_instruction *inst, GLuint read_mask, channel_mask; GLuint comp; - ASSERT(arg < _mesa_num_inst_src_regs(inst->Opcode)); + assert(arg < _mesa_num_inst_src_regs(inst->Opcode)); /* Form the dst register, find the written channels */ if (inst->CondUpdate) { @@ -133,7 +133,7 @@ get_dst_mask_for_mov(const struct prog_instruction *mov, GLuint src_mask) GLuint comp; GLuint updated_mask = 0x0; - ASSERT(mov->Opcode == OPCODE_MOV); + assert(mov->Opcode == OPCODE_MOV); for (comp = 0; comp < 4; ++comp) { GLuint src_comp; @@ -225,13 +225,13 @@ replace_regs(struct gl_program *prog, gl_register_file file, const GLint map[]) for (j = 0; j < numSrc; j++) { if (inst->SrcReg[j].File == file) { GLuint index = inst->SrcReg[j].Index; - ASSERT(map[index] >= 0); + assert(map[index] >= 0); inst->SrcReg[j].Index = map[index]; } } if (inst->DstReg.File == file) { const GLuint index = inst->DstReg.Index; - ASSERT(map[index] >= 0); + assert(map[index] >= 0); inst->DstReg.Index = map[index]; } } @@ -272,7 +272,7 @@ _mesa_remove_dead_code_global(struct gl_program *prog) if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) { const GLuint index = inst->SrcReg[j].Index; GLuint read_mask; - ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS); + assert(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS); read_mask = get_src_arg_mask(inst, j, NO_MASK); if (inst->SrcReg[j].RelAddr) { @@ -295,7 +295,7 @@ _mesa_remove_dead_code_global(struct gl_program *prog) /* check dst reg */ if (inst->DstReg.File == PROGRAM_TEMPORARY) { const GLuint index = inst->DstReg.Index; - ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS); + assert(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS); if (inst->DstReg.RelAddr) { if (dbg) @@ -676,7 +676,7 @@ _mesa_merge_mov_into_inst(struct prog_instruction *inst, for (dst_comp = 0; dst_comp < 4; ++dst_comp) { if (mov->DstReg.WriteMask & (1 << dst_comp)) { const GLuint src_comp = GET_SWZ(mov->SrcReg[0].Swizzle, dst_comp); - ASSERT(src_comp < 4); + assert(src_comp < 4); dst_to_src_comp[dst_comp] = src_comp; } } @@ -692,9 +692,9 @@ _mesa_merge_mov_into_inst(struct prog_instruction *inst, if ((mov->DstReg.WriteMask & (1 << dst_comp)) == 0) continue; src_comp = dst_to_src_comp[dst_comp]; - ASSERT(src_comp < 4); + assert(src_comp < 4); arg_comp = GET_SWZ(arg_swz, src_comp); - ASSERT(arg_comp < 4); + assert(arg_comp < 4); inst->SrcReg[arg].Swizzle |= arg_comp << (3*dst_comp); } } @@ -871,7 +871,7 @@ insert_interval_by_end(struct interval_list *list, const struct interval *inv) { GLuint i; for (i = 0; i + 1 < list->Num; i++) { - ASSERT(list->Intervals[i].End <= list->Intervals[i + 1].End); + assert(list->Intervals[i].End <= list->Intervals[i + 1].End); } } #endif @@ -887,8 +887,8 @@ remove_interval(struct interval_list *list, const struct interval *inv) for (k = 0; k < list->Num; k++) { if (list->Intervals[k].Reg == inv->Reg) { /* found, remove it */ - ASSERT(list->Intervals[k].Start == inv->Start); - ASSERT(list->Intervals[k].End == inv->End); + assert(list->Intervals[k].Start == inv->Start); + assert(list->Intervals[k].End == inv->End); while (k < list->Num - 1) { list->Intervals[k] = list->Intervals[k + 1]; k++; @@ -924,7 +924,7 @@ sort_interval_list_by_start(struct interval_list *list) { GLuint i; for (i = 0; i + 1 < list->Num; i++) { - ASSERT(list->Intervals[i].Start <= list->Intervals[i + 1].Start); + assert(list->Intervals[i].Start <= list->Intervals[i + 1].Start); } } #endif @@ -966,9 +966,9 @@ update_interval(GLint intBegin[], GLint intEnd[], begin = loopStack[0].Start; } - ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS); + assert(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS); if (intBegin[index] == -1) { - ASSERT(intEnd[index] == -1); + assert(intEnd[index] == -1); intBegin[index] = begin; intEnd[index] = end; } @@ -1176,7 +1176,7 @@ _mesa_reallocate_registers(struct gl_program *prog) else { /* Interval 'inv' has expired */ const GLint regNew = registerMap[inv->Reg]; - ASSERT(regNew >= 0); + assert(regNew >= 0); if (dbg) printf(" expire interval for reg %u\n", inv->Reg); @@ -1188,7 +1188,7 @@ _mesa_reallocate_registers(struct gl_program *prog) /* return register regNew to the free pool */ if (dbg) printf(" free reg %d\n", regNew); - ASSERT(usedRegs[regNew] == GL_TRUE); + assert(usedRegs[regNew] == GL_TRUE); usedRegs[regNew] = GL_FALSE; } } diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c index 0ef46415d9f..5939f6f72ec 100644 --- a/src/mesa/program/prog_parameter.c +++ b/src/mesa/program/prog_parameter.c @@ -241,8 +241,8 @@ _mesa_add_typed_unnamed_constant(struct gl_program_parameter_list *paramList, GLenum datatype, GLuint *swizzleOut) { GLint pos; - ASSERT(size >= 1); - ASSERT(size <= 4); + assert(size >= 1); + assert(size <= 4); if (swizzleOut && _mesa_lookup_parameter_constant(paramList, values, @@ -528,7 +528,7 @@ _mesa_clone_parameter_list(const struct gl_program_parameter_list *list) GLuint size = MIN2(p->Size, 4); GLint j = _mesa_add_parameter(clone, p->Type, p->Name, size, p->DataType, list->ParameterValues[i], NULL); - ASSERT(j >= 0); + assert(j >= 0); pCopy = clone->Parameters + j; /* copy state indexes */ if (p->Type == PROGRAM_STATE_VAR) { diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c index 7f5daf8c676..80708f4e5fb 100644 --- a/src/mesa/program/prog_statevars.c +++ b/src/mesa/program/prog_statevars.c @@ -58,9 +58,9 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], /* state[1] is either 0=front or 1=back side */ const GLuint face = (GLuint) state[1]; const struct gl_material *mat = &ctx->Light.Material; - ASSERT(face == 0 || face == 1); + assert(face == 0 || face == 1); /* we rely on tokens numbered so that _BACK_ == _FRONT_+ 1 */ - ASSERT(MAT_ATTRIB_FRONT_AMBIENT + 1 == MAT_ATTRIB_BACK_AMBIENT); + assert(MAT_ATTRIB_FRONT_AMBIENT + 1 == MAT_ATTRIB_BACK_AMBIENT); /* XXX we could get rid of this switch entirely with a little * work in arbprogparse.c's parse_state_single_item(). */ @@ -170,7 +170,7 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], const GLuint ln = (GLuint) state[1]; const GLuint face = (GLuint) state[2]; GLint i; - ASSERT(face == 0 || face == 1); + assert(face == 0 || face == 1); switch (state[3]) { case STATE_AMBIENT: for (i = 0; i < 3; i++) { @@ -295,8 +295,8 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], const gl_state_index modifier = state[4]; const GLfloat *m; GLuint row, i; - ASSERT(firstRow < 4); - ASSERT(lastRow < 4); + assert(firstRow < 4); + assert(lastRow < 4); if (mat == STATE_MODELVIEW_MATRIX) { matrix = ctx->ModelviewMatrixStack.Top; } @@ -307,11 +307,11 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], matrix = &ctx->_ModelProjectMatrix; } else if (mat == STATE_TEXTURE_MATRIX) { - ASSERT(index < Elements(ctx->TextureMatrixStack)); + assert(index < Elements(ctx->TextureMatrixStack)); matrix = ctx->TextureMatrixStack[index].Top; } else if (mat == STATE_PROGRAM_MATRIX) { - ASSERT(index < Elements(ctx->ProgramMatrixStack)); + assert(index < Elements(ctx->ProgramMatrixStack)); matrix = ctx->ProgramMatrixStack[index].Top; } else { diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c index 6e17fe65f7e..61a9e97c9f8 100644 --- a/src/mesa/program/program.c +++ b/src/mesa/program/program.c @@ -56,21 +56,21 @@ _mesa_init_program(struct gl_context *ctx) * If this assertion fails, we need to increase the field * size for register indexes (see INST_INDEX_BITS). */ - ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents / 4 + assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents / 4 <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents / 4 + assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents / 4 <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxTemps <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTemps <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams <= (1 << INST_INDEX_BITS)); + assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxTemps <= (1 << INST_INDEX_BITS)); + assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams <= (1 << INST_INDEX_BITS)); + assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTemps <= (1 << INST_INDEX_BITS)); + assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents <= 4 * MAX_UNIFORMS); - ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents <= 4 * MAX_UNIFORMS); + assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents <= 4 * MAX_UNIFORMS); + assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents <= 4 * MAX_UNIFORMS); - ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxAddressOffset <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAddressOffset <= (1 << INST_INDEX_BITS)); + assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxAddressOffset <= (1 << INST_INDEX_BITS)); + assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAddressOffset <= (1 << INST_INDEX_BITS)); /* If this fails, increase prog_instruction::TexSrcUnit size */ STATIC_ASSERT(MAX_TEXTURE_UNITS <= (1 << 5)); @@ -364,8 +364,8 @@ void _mesa_delete_program(struct gl_context *ctx, struct gl_program *prog) { (void) ctx; - ASSERT(prog); - ASSERT(prog->RefCount==0); + assert(prog); + assert(prog->RefCount==0); if (prog == &_mesa_DummyProgram) return; @@ -414,12 +414,12 @@ _mesa_reference_program_(struct gl_context *ctx, if (*ptr && prog) { /* sanity check */ if ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB) - ASSERT(prog->Target == GL_VERTEX_PROGRAM_ARB); + assert(prog->Target == GL_VERTEX_PROGRAM_ARB); else if ((*ptr)->Target == GL_FRAGMENT_PROGRAM_ARB) - ASSERT(prog->Target == GL_FRAGMENT_PROGRAM_ARB || + assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB || prog->Target == GL_FRAGMENT_PROGRAM_NV); else if ((*ptr)->Target == MESA_GEOMETRY_PROGRAM) - ASSERT(prog->Target == MESA_GEOMETRY_PROGRAM); + assert(prog->Target == MESA_GEOMETRY_PROGRAM); } #endif @@ -434,14 +434,14 @@ _mesa_reference_program_(struct gl_context *ctx, ((*ptr)->Target == MESA_GEOMETRY_PROGRAM ? "GP" : "FP")), (*ptr)->RefCount - 1); #endif - ASSERT((*ptr)->RefCount > 0); + assert((*ptr)->RefCount > 0); (*ptr)->RefCount--; deleteFlag = ((*ptr)->RefCount == 0); /*mtx_lock(&(*ptr)->Mutex);*/ if (deleteFlag) { - ASSERT(ctx); + assert(ctx); ctx->Driver.DeleteProgram(ctx, *ptr); } @@ -733,7 +733,7 @@ _mesa_combine_programs(struct gl_context *ctx, GLbitfield64 inputsB; GLuint i; - ASSERT(progA->Target == progB->Target); + assert(progA->Target == progB->Target); newInst = _mesa_alloc_instructions(newLength); if (!newInst) @@ -867,14 +867,14 @@ _mesa_find_used_registers(const struct gl_program *prog, const GLuint n = _mesa_num_inst_src_regs(inst->Opcode); if (inst->DstReg.File == file) { - ASSERT(inst->DstReg.Index < usedSize); + assert(inst->DstReg.Index < usedSize); if(inst->DstReg.Index < usedSize) used[inst->DstReg.Index] = GL_TRUE; } for (j = 0; j < n; j++) { if (inst->SrcReg[j].File == file) { - ASSERT(inst->SrcReg[j].Index < (GLint) usedSize); + assert(inst->SrcReg[j].Index < (GLint) usedSize); if (inst->SrcReg[j].Index < (GLint) usedSize) used[inst->SrcReg[j].Index] = GL_TRUE; } diff --git a/src/mesa/program/program.h b/src/mesa/program/program.h index ef698242ffa..0b0d1ac6fee 100644 --- a/src/mesa/program/program.h +++ b/src/mesa/program/program.h @@ -210,7 +210,7 @@ _mesa_program_enum_to_shader_stage(GLenum v) case GL_COMPUTE_PROGRAM_NV: return MESA_SHADER_COMPUTE; default: - ASSERT(0); + assert(0); return ~0; } } diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y index 1664740b431..268ce05edee 100644 --- a/src/mesa/program/program_parse.y +++ b/src/mesa/program/program_parse.y @@ -2333,11 +2333,11 @@ set_dst_reg(struct prog_dst_register *r, gl_register_file file, GLint index) { const GLint maxIndex = 1 << INST_INDEX_BITS; const GLint minIndex = 0; - ASSERT(index >= minIndex); + assert(index >= minIndex); (void) minIndex; - ASSERT(index <= maxIndex); + assert(index <= maxIndex); (void) maxIndex; - ASSERT(file == PROGRAM_TEMPORARY || + assert(file == PROGRAM_TEMPORARY || file == PROGRAM_ADDRESS || file == PROGRAM_OUTPUT); memset(r, 0, sizeof(*r)); @@ -2375,10 +2375,10 @@ set_src_reg_swz(struct asm_src_register *r, gl_register_file file, GLint index, { const GLint maxIndex = (1 << INST_INDEX_BITS) - 1; const GLint minIndex = -(1 << INST_INDEX_BITS); - ASSERT(file < PROGRAM_FILE_MAX); - ASSERT(index >= minIndex); + assert(file < PROGRAM_FILE_MAX); + assert(index >= minIndex); (void) minIndex; - ASSERT(index <= maxIndex); + assert(index <= maxIndex); (void) maxIndex; memset(r, 0, sizeof(*r)); r->Base.File = file; diff --git a/src/mesa/program/programopt.c b/src/mesa/program/programopt.c index fdaa4a465cb..e82c68a5305 100644 --- a/src/mesa/program/programopt.c +++ b/src/mesa/program/programopt.c @@ -335,7 +335,7 @@ _mesa_append_fog_code(struct gl_context *ctx, inst++; } else { - ASSERT(fog_mode == GL_EXP || fog_mode == GL_EXP2); + assert(fog_mode == GL_EXP || fog_mode == GL_EXP2); /* fogPRefOpt.z = d/ln(2), fogPRefOpt.w = d/sqrt(ln(2) */ /* EXP: MUL fogFactorTemp.x, fogPRefOpt.z, fragment.fogcoord.x; */ /* EXP2: MUL fogFactorTemp.x, fogPRefOpt.w, fragment.fogcoord.x; */ diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index f24805cf5dd..1dbc4b90585 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -104,9 +104,9 @@ st_bufferobj_subdata(struct gl_context *ctx, struct st_buffer_object *st_obj = st_buffer_object(obj); /* we may be called from VBO code, so double-check params here */ - ASSERT(offset >= 0); - ASSERT(size >= 0); - ASSERT(offset + size <= obj->Size); + assert(offset >= 0); + assert(size >= 0); + assert(offset + size <= obj->Size); if (!size) return; @@ -148,9 +148,9 @@ st_bufferobj_get_subdata(struct gl_context *ctx, struct st_buffer_object *st_obj = st_buffer_object(obj); /* we may be called from VBO code, so double-check params here */ - ASSERT(offset >= 0); - ASSERT(size >= 0); - ASSERT(offset + size <= obj->Size); + assert(offset >= 0); + assert(size >= 0); + assert(offset + size <= obj->Size); if (!size) return; diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 0b3477161b7..50a810c97a4 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -3515,7 +3515,7 @@ get_src_arg_mask(st_dst_reg dst, st_src_reg src) */ for (comp = 0; comp < 4; ++comp) { const unsigned coord = GET_SWZ(src.swizzle, comp); - ASSERT(coord < 4); + assert(coord < 4); if (dst.writemask & (1 << comp) && coord <= SWIZZLE_W) read_mask |= 1 << coord; } diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index 6aea9d54571..d73c498599b 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -477,7 +477,7 @@ _swrast_choose_aa_line_function(struct gl_context *ctx) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - ASSERT(ctx->Line.SmoothFlag); + assert(ctx->Line.SmoothFlag); if (ctx->Texture._EnabledCoordUnits != 0 || _swrast_use_fragment_program(ctx) diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c index 21928274894..1d076cc7d51 100644 --- a/src/mesa/swrast/s_aatriangle.c +++ b/src/mesa/swrast/s_aatriangle.c @@ -102,7 +102,7 @@ do { \ static inline GLfloat solve_plane(GLfloat x, GLfloat y, const GLfloat plane[4]) { - ASSERT(plane[2] != 0.0F); + assert(plane[2] != 0.0F); return (plane[3] + plane[0] * x + plane[1] * y) / -plane[2]; } @@ -201,7 +201,7 @@ compute_coveragef(const GLfloat v0[3], const GLfloat v1[3], GLint stop = 4, i; GLfloat insideCount = 16.0F; - ASSERT(dx0 * dy1 - dx1 * dy0 >= 0.0); /* area >= 0.0 */ + assert(dx0 * dy1 - dx1 * dy0 >= 0.0); /* area >= 0.0 */ for (i = 0; i < stop; i++) { const GLfloat sx = x + samples[i][0]; @@ -282,7 +282,7 @@ _swrast_set_aa_triangle_function(struct gl_context *ctx) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - ASSERT(ctx->Polygon.SmoothFlag); + assert(ctx->Polygon.SmoothFlag); if (ctx->Texture._EnabledCoordUnits != 0 || _swrast_use_fragment_program(ctx) @@ -294,5 +294,5 @@ _swrast_set_aa_triangle_function(struct gl_context *ctx) SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri; } - ASSERT(SWRAST_CONTEXT(ctx)->Triangle); + assert(SWRAST_CONTEXT(ctx)->Triangle); } diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index fd374a524f0..230dab81633 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -284,7 +284,7 @@ /* (cx,cy) = center of fragment */ const GLfloat cx = ix + 0.5F, cy = iy + 0.5F; SWspanarrays *array = span.array; - ASSERT(ix >= 0); + assert(ix >= 0); array->coverage[ix] = coverage; #ifdef DO_Z array->z[ix] = (GLuint) solve_plane(cx, cy, zPlane); diff --git a/src/mesa/swrast/s_alpha.c b/src/mesa/swrast/s_alpha.c index fba143a5205..b1a7ff132a0 100644 --- a/src/mesa/swrast/s_alpha.c +++ b/src/mesa/swrast/s_alpha.c @@ -130,7 +130,7 @@ _swrast_alpha_test(const struct gl_context *ctx, SWspan *span) } else { /* Interpolate alpha values */ - ASSERT(span->interpMask & SPAN_RGBA); + assert(span->interpMask & SPAN_RGBA); if (span->array->ChanType == GL_UNSIGNED_BYTE) { const GLfixed alphaStep = span->alphaStep; GLfixed alpha = span->alpha; diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c index 1e91e2bee42..0bf03771f5b 100644 --- a/src/mesa/swrast/s_atifragshader.c +++ b/src/mesa/swrast/s_atifragshader.c @@ -571,7 +571,7 @@ _swrast_exec_fragment_shader(struct gl_context * ctx, SWspan *span) GLuint i; /* incoming colors should be floats */ - ASSERT(span->array->ChanType == GL_FLOAT); + assert(span->array->ChanType == GL_FLOAT); for (i = 0; i < span->end; i++) { if (span->array->mask[i]) { diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index e364ec129a7..324daea3681 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -55,7 +55,7 @@ _swrast_Bitmap( struct gl_context *ctx, GLint px, GLint py, GLuint count = 0; SWspan span; - ASSERT(ctx->RenderMode == GL_RENDER); + assert(ctx->RenderMode == GL_RENDER); if (!_mesa_check_conditional_render(ctx)) return; /* don't draw */ @@ -154,8 +154,8 @@ _swrast_Bitmap( struct gl_context *ctx, GLint px, GLint py, GLint row, col; SWspan span; - ASSERT(ctx->RenderMode == GL_RENDER); - ASSERT(bitmap); + assert(ctx->RenderMode == GL_RENDER); + assert(bitmap); swrast_render_start(ctx); diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index 1037b623613..7cb11940725 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -75,10 +75,10 @@ blend_noop(struct gl_context *ctx, GLuint n, const GLubyte mask[], { GLint bytes; - ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].SrcRGB == GL_ZERO); - ASSERT(ctx->Color.Blend[0].DstRGB == GL_ONE); + assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].SrcRGB == GL_ZERO); + assert(ctx->Color.Blend[0].DstRGB == GL_ONE); (void) ctx; /* just memcpy */ @@ -101,10 +101,10 @@ static void _BLENDAPI blend_replace(struct gl_context *ctx, GLuint n, const GLubyte mask[], GLvoid *src, const GLvoid *dst, GLenum chanType) { - ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].SrcRGB == GL_ONE); - ASSERT(ctx->Color.Blend[0].DstRGB == GL_ZERO); + assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].SrcRGB == GL_ONE); + assert(ctx->Color.Blend[0].DstRGB == GL_ZERO); (void) ctx; (void) n; (void) mask; @@ -125,13 +125,13 @@ blend_transparency_ubyte(struct gl_context *ctx, GLuint n, const GLubyte mask[], const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst; GLuint i; - ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA); - ASSERT(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA); - ASSERT(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(chanType == GL_UNSIGNED_BYTE); + assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA); + assert(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA); + assert(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA); + assert(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA); + assert(chanType == GL_UNSIGNED_BYTE); (void) ctx; @@ -148,10 +148,10 @@ blend_transparency_ubyte(struct gl_context *ctx, GLuint n, const GLubyte mask[], const GLint g = DIV255((rgba[i][GCOMP] - dest[i][GCOMP]) * t) + dest[i][GCOMP]; const GLint b = DIV255((rgba[i][BCOMP] - dest[i][BCOMP]) * t) + dest[i][BCOMP]; const GLint a = DIV255((rgba[i][ACOMP] - dest[i][ACOMP]) * t) + dest[i][ACOMP]; - ASSERT(r <= 255); - ASSERT(g <= 255); - ASSERT(b <= 255); - ASSERT(a <= 255); + assert(r <= 255); + assert(g <= 255); + assert(b <= 255); + assert(a <= 255); rgba[i][RCOMP] = (GLubyte) r; rgba[i][GCOMP] = (GLubyte) g; rgba[i][BCOMP] = (GLubyte) b; @@ -170,13 +170,13 @@ blend_transparency_ushort(struct gl_context *ctx, GLuint n, const GLubyte mask[] const GLushort (*dest)[4] = (const GLushort (*)[4]) dst; GLuint i; - ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA); - ASSERT(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA); - ASSERT(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(chanType == GL_UNSIGNED_SHORT); + assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA); + assert(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA); + assert(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA); + assert(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA); + assert(chanType == GL_UNSIGNED_SHORT); (void) ctx; @@ -208,13 +208,13 @@ blend_transparency_float(struct gl_context *ctx, GLuint n, const GLubyte mask[], const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst; GLuint i; - ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA); - ASSERT(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA); - ASSERT(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA); - ASSERT(chanType == GL_FLOAT); + assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA); + assert(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA); + assert(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA); + assert(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA); + assert(chanType == GL_FLOAT); (void) ctx; @@ -248,10 +248,10 @@ blend_add(struct gl_context *ctx, GLuint n, const GLubyte mask[], { GLuint i; - ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); - ASSERT(ctx->Color.Blend[0].SrcRGB == GL_ONE); - ASSERT(ctx->Color.Blend[0].DstRGB == GL_ONE); + assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD); + assert(ctx->Color.Blend[0].SrcRGB == GL_ONE); + assert(ctx->Color.Blend[0].DstRGB == GL_ONE); (void) ctx; if (chanType == GL_UNSIGNED_BYTE) { @@ -289,7 +289,7 @@ blend_add(struct gl_context *ctx, GLuint n, const GLubyte mask[], else { GLfloat (*rgba)[4] = (GLfloat (*)[4]) src; const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst; - ASSERT(chanType == GL_FLOAT); + assert(chanType == GL_FLOAT); for (i=0;i<n;i++) { if (mask[i]) { /* don't RGB clamp to max */ @@ -313,8 +313,8 @@ blend_min(struct gl_context *ctx, GLuint n, const GLubyte mask[], GLvoid *src, const GLvoid *dst, GLenum chanType) { GLuint i; - ASSERT(ctx->Color.Blend[0].EquationRGB == GL_MIN); - ASSERT(ctx->Color.Blend[0].EquationA == GL_MIN); + assert(ctx->Color.Blend[0].EquationRGB == GL_MIN); + assert(ctx->Color.Blend[0].EquationA == GL_MIN); (void) ctx; if (chanType == GL_UNSIGNED_BYTE) { @@ -344,7 +344,7 @@ blend_min(struct gl_context *ctx, GLuint n, const GLubyte mask[], else { GLfloat (*rgba)[4] = (GLfloat (*)[4]) src; const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst; - ASSERT(chanType == GL_FLOAT); + assert(chanType == GL_FLOAT); for (i=0;i<n;i++) { if (mask[i]) { rgba[i][RCOMP] = MIN2( rgba[i][RCOMP], dest[i][RCOMP] ); @@ -366,8 +366,8 @@ blend_max(struct gl_context *ctx, GLuint n, const GLubyte mask[], GLvoid *src, const GLvoid *dst, GLenum chanType) { GLuint i; - ASSERT(ctx->Color.Blend[0].EquationRGB == GL_MAX); - ASSERT(ctx->Color.Blend[0].EquationA == GL_MAX); + assert(ctx->Color.Blend[0].EquationRGB == GL_MAX); + assert(ctx->Color.Blend[0].EquationA == GL_MAX); (void) ctx; if (chanType == GL_UNSIGNED_BYTE) { @@ -397,7 +397,7 @@ blend_max(struct gl_context *ctx, GLuint n, const GLubyte mask[], else { GLfloat (*rgba)[4] = (GLfloat (*)[4]) src; const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst; - ASSERT(chanType == GL_FLOAT); + assert(chanType == GL_FLOAT); for (i=0;i<n;i++) { if (mask[i]) { rgba[i][RCOMP] = MAX2( rgba[i][RCOMP], dest[i][RCOMP] ); @@ -450,7 +450,7 @@ blend_modulate(struct gl_context *ctx, GLuint n, const GLubyte mask[], else { GLfloat (*rgba)[4] = (GLfloat (*)[4]) src; const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst; - ASSERT(chanType == GL_FLOAT); + assert(chanType == GL_FLOAT); for (i=0;i<n;i++) { if (mask[i]) { rgba[i][RCOMP] = rgba[i][RCOMP] * dest[i][RCOMP]; @@ -998,9 +998,9 @@ _swrast_blend_span(struct gl_context *ctx, struct gl_renderbuffer *rb, SWspan *s SWcontext *swrast = SWRAST_CONTEXT(ctx); void *rbPixels; - ASSERT(span->end <= SWRAST_MAX_WIDTH); - ASSERT(span->arrayMask & SPAN_RGBA); - ASSERT(!ctx->Color.ColorLogicOpEnabled); + assert(span->end <= SWRAST_MAX_WIDTH); + assert(span->arrayMask & SPAN_RGBA); + assert(!ctx->Color.ColorLogicOpEnabled); rbPixels = _swrast_get_dest_rgba(ctx, rb, span); diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c index 16e5b8c1cb1..3e838a41d44 100644 --- a/src/mesa/swrast/s_blit.c +++ b/src/mesa/swrast/s_blit.c @@ -52,8 +52,8 @@ NAME(GLint srcWidth, GLint dstWidth, \ if (flip) { \ for (dstCol = 0; dstCol < dstWidth; dstCol++) { \ GLint srcCol = (dstCol * srcWidth) / dstWidth; \ - ASSERT(srcCol >= 0); \ - ASSERT(srcCol < srcWidth); \ + assert(srcCol >= 0); \ + assert(srcCol < srcWidth); \ srcCol = srcWidth - 1 - srcCol; /* flip */ \ if (SIZE == 1) { \ dst[dstCol] = src[srcCol]; \ @@ -73,8 +73,8 @@ NAME(GLint srcWidth, GLint dstWidth, \ else { \ for (dstCol = 0; dstCol < dstWidth; dstCol++) { \ GLint srcCol = (dstCol * srcWidth) / dstWidth; \ - ASSERT(srcCol >= 0); \ - ASSERT(srcCol < srcWidth); \ + assert(srcCol >= 0); \ + assert(srcCol < srcWidth); \ if (SIZE == 1) { \ dst[dstCol] = src[srcCol]; \ } \ @@ -299,8 +299,8 @@ blit_nearest(struct gl_context *ctx, GLint srcRow = IROUND(srcRowF); GLubyte *dstRowStart = dstMap + dstRowStride * dstRow; - ASSERT(srcRow >= 0); - ASSERT(srcRow < srcHeight); + assert(srcRow >= 0); + assert(srcRow < srcHeight); if (invertY) { srcRow = srcHeight - 1 - srcRow; @@ -412,8 +412,8 @@ resample_linear_row_ub(GLint srcWidth, GLint dstWidth, GLfloat colWeight = srcCol - srcCol0; /* fractional part of srcCol */ GLfloat red, green, blue, alpha; - ASSERT(srcCol0 < srcWidth); - ASSERT(srcCol1 <= srcWidth); + assert(srcCol0 < srcWidth); + assert(srcCol1 <= srcWidth); if (srcCol1 == srcWidth) { /* last column fudge */ @@ -467,8 +467,8 @@ resample_linear_row_float(GLint srcWidth, GLint dstWidth, GLfloat colWeight = srcCol - srcCol0; /* fractional part of srcCol */ GLfloat red, green, blue, alpha; - ASSERT(srcCol0 < srcWidth); - ASSERT(srcCol1 <= srcWidth); + assert(srcCol0 < srcWidth); + assert(srcCol1 <= srcWidth); if (srcCol1 == srcWidth) { /* last column fudge */ @@ -801,7 +801,7 @@ _swrast_BlitFramebuffer(struct gl_context *ctx, } } else { - ASSERT(filter == GL_LINEAR); + assert(filter == GL_LINEAR); if (mask & GL_COLOR_BUFFER_BIT) { /* depth/stencil not allowed */ blit_linear(ctx, readFb, drawFb, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1); diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index ad11aa2c1e0..cc7d9b37dc6 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -351,7 +351,7 @@ _swrast_validate_triangle( struct gl_context *ctx, _swrast_validate_derived( ctx ); swrast->choose_triangle( ctx ); - ASSERT(swrast->Triangle); + assert(swrast->Triangle); if (swrast->SpecularVertexAdd) { /* separate specular color, but no texture */ @@ -373,7 +373,7 @@ _swrast_validate_line( struct gl_context *ctx, const SWvertex *v0, const SWverte _swrast_validate_derived( ctx ); swrast->choose_line( ctx ); - ASSERT(swrast->Line); + assert(swrast->Line); if (swrast->SpecularVertexAdd) { swrast->SpecLine = swrast->Line; diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index e21c69dbcfa..17140ad2d8b 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -158,7 +158,7 @@ copy_rgba_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, p = NULL; } - ASSERT(width < SWRAST_MAX_WIDTH); + assert(width < SWRAST_MAX_WIDTH); for (row = 0; row < height; row++, sy += stepy, dy += stepy) { GLvoid *rgba = span.array->attribs[VARYING_SLOT_COL0]; @@ -468,7 +468,7 @@ swrast_fast_copy_pixels(struct gl_context *ctx, dstRb = dstFb->Attachment[BUFFER_DEPTH].Renderbuffer; } else { - ASSERT(type == GL_DEPTH_STENCIL_EXT); + assert(type == GL_DEPTH_STENCIL_EXT); /* XXX correct? */ srcRb = srcFb->Attachment[BUFFER_DEPTH].Renderbuffer; dstRb = dstFb->Attachment[BUFFER_DEPTH].Renderbuffer; diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index c99251904a5..bf427266cef 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -373,7 +373,7 @@ draw_depth_pixels( struct gl_context *ctx, GLint x, GLint y, while (skipPixels < width) { const GLint spanWidth = MIN2(width - skipPixels, SWRAST_MAX_WIDTH); GLint row; - ASSERT(span.end <= SWRAST_MAX_WIDTH); + assert(span.end <= SWRAST_MAX_WIDTH); for (row = 0; row < height; row++) { const GLvoid *zSrc = _mesa_image_address2d(unpack, pixels, width, height, @@ -595,8 +595,8 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer; - ASSERT(depthRb); - ASSERT(stencilRb); + assert(depthRb); + assert(stencilRb); if (depthRb == stencilRb && (depthRb->Format == MESA_FORMAT_S8_UINT_Z24_UNORM || diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index 34b7c2d2897..6b9e698f7bc 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -134,8 +134,8 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span ) const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx); GLfloat rFog, gFog, bFog; - ASSERT(swrast->_FogEnabled); - ASSERT(span->arrayMask & SPAN_RGBA); + assert(swrast->_FogEnabled); + assert(span->arrayMask & SPAN_RGBA); /* compute (scaled) fog color */ if (span->array->ChanType == GL_UNSIGNED_BYTE) { @@ -174,7 +174,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span ) } else { GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); + assert(span->array->ChanType == GL_FLOAT); FOG_LOOP(GLfloat, LINEAR_FOG); } } @@ -193,7 +193,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span ) } else { GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); + assert(span->array->ChanType == GL_FLOAT); FOG_LOOP(GLfloat, EXP_FOG); } } @@ -212,7 +212,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span ) } else { GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); + assert(span->array->ChanType == GL_FLOAT); FOG_LOOP(GLfloat, EXP2_FOG); } } @@ -237,7 +237,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span ) } else { GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0]; - ASSERT(span->array->ChanType == GL_FLOAT); + assert(span->array->ChanType == GL_FLOAT); FOG_LOOP(GLfloat, BLEND_FOG); } } diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 1d7c33619dc..12bcda311b9 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -273,7 +273,7 @@ _swrast_exec_fragment_program( struct gl_context *ctx, SWspan *span ) /* incoming colors should be floats */ if (program->Base.InputsRead & VARYING_BIT_COL0) { - ASSERT(span->array->ChanType == GL_FLOAT); + assert(span->array->ChanType == GL_FLOAT); } run_program(ctx, span, 0, span->end); diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index b63296aa44e..3e626b9e06e 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -67,7 +67,7 @@ draw_wide_line( struct gl_context *ctx, SWspan *span, GLboolean xMajor ) ctx->Const.MaxLineWidth); GLint start; - ASSERT(span->end < SWRAST_MAX_WIDTH); + assert(span->end < SWRAST_MAX_WIDTH); if (width & 1) start = width / 2; @@ -233,7 +233,7 @@ _swrast_choose_line( struct gl_context *ctx ) if (ctx->Line.SmoothFlag) { /* antialiased lines */ _swrast_choose_aa_line_function(ctx); - ASSERT(swrast->Line); + assert(swrast->Line); } else if (ctx->Texture._EnabledCoordUnits || _swrast_use_fragment_program(ctx) @@ -252,8 +252,8 @@ _swrast_choose_line( struct gl_context *ctx ) #endif } else { - ASSERT(!ctx->Depth.Test); - ASSERT(ctx->Line.Width == 1.0); + assert(!ctx->Depth.Test); + assert(ctx->Line.Width == 1.0); /* simple lines */ USE(simple_no_z_rgba_line); } @@ -262,7 +262,7 @@ _swrast_choose_line( struct gl_context *ctx ) USE(_swrast_feedback_line); } else { - ASSERT(ctx->RenderMode == GL_SELECT); + assert(ctx->RenderMode == GL_SELECT); USE(_swrast_select_line); } } diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index 7b1eac36aa6..352c884283e 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -212,8 +212,8 @@ NAME( struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1 ) #endif } - ASSERT(dx >= 0); - ASSERT(dy >= 0); + assert(dx >= 0); + assert(dy >= 0); numPixels = MAX2(dx, dy); diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c index f68273fd2a5..c7cac2e4016 100644 --- a/src/mesa/swrast/s_logic.c +++ b/src/mesa/swrast/s_logic.c @@ -193,8 +193,8 @@ _swrast_logicop_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb, { void *rbPixels; - ASSERT(span->end < SWRAST_MAX_WIDTH); - ASSERT(span->arrayMask & SPAN_RGBA); + assert(span->end < SWRAST_MAX_WIDTH); + assert(span->arrayMask & SPAN_RGBA); rbPixels = _swrast_get_dest_rgba(ctx, rb, span); diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c index c3aa4189100..c95587b204c 100644 --- a/src/mesa/swrast/s_masking.c +++ b/src/mesa/swrast/s_masking.c @@ -46,8 +46,8 @@ _swrast_mask_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb, const GLuint n = span->end; void *rbPixels; - ASSERT(n < SWRAST_MAX_WIDTH); - ASSERT(span->arrayMask & SPAN_RGBA); + assert(n < SWRAST_MAX_WIDTH); + assert(span->arrayMask & SPAN_RGBA); rbPixels = _swrast_get_dest_rgba(ctx, rb, span); diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index b9bec237e40..52a7222129f 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -140,7 +140,7 @@ sprite_point(struct gl_context *ctx, const SWvertex *vert) if (attr >= VARYING_SLOT_TEX0 && attr <= VARYING_SLOT_TEX7) { /* a texcoord attribute */ const GLuint u = attr - VARYING_SLOT_TEX0; - ASSERT(u < Elements(ctx->Point.CoordReplace)); + assert(u < Elements(ctx->Point.CoordReplace)); if (ctx->Point.CoordReplace[u]) { tCoords[numTcoords++] = attr; @@ -504,7 +504,7 @@ pixel_point(struct gl_context *ctx, const SWvertex *vert) span->array->z[count] = (GLint) (vert->attrib[VARYING_SLOT_POS][2] + 0.5F); span->end = count + 1; - ASSERT(span->end <= SWRAST_MAX_WIDTH); + assert(span->end <= SWRAST_MAX_WIDTH); } diff --git a/src/mesa/swrast/s_renderbuffer.c b/src/mesa/swrast/s_renderbuffer.c index dfd3a6057ea..d8c4ed38638 100644 --- a/src/mesa/swrast/s_renderbuffer.c +++ b/src/mesa/swrast/s_renderbuffer.c @@ -153,7 +153,7 @@ soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb, } else { /* the internalFormat should have been error checked long ago */ - ASSERT(rb->_BaseFormat); + assert(rb->_BaseFormat); } return GL_TRUE; diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 321959df933..2340fddf65d 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -205,7 +205,7 @@ interpolate_active_attribs(struct gl_context *ctx, SWspan *span, v3 += dv3dx; w += dwdx; } - ASSERT((span->arrayAttribs & BITFIELD64_BIT(attr)) == 0); + assert((span->arrayAttribs & BITFIELD64_BIT(attr)) == 0); span->arrayAttribs |= BITFIELD64_BIT(attr); } ATTRIB_LOOP_END @@ -223,7 +223,7 @@ interpolate_int_colors(struct gl_context *ctx, SWspan *span) const GLuint n = span->end; GLuint i; - ASSERT(!(span->arrayMask & SPAN_RGBA)); + assert(!(span->arrayMask & SPAN_RGBA)); #endif switch (span->array->ChanType) { @@ -336,7 +336,7 @@ interpolate_float_colors(SWspan *span) } else { /* interpolate red/green/blue/alpha to get float colors */ - ASSERT(span->interpMask & SPAN_RGBA); + assert(span->interpMask & SPAN_RGBA); if (span->interpMask & SPAN_FLAT) { GLfloat r = FixedToFloat(span->red); GLfloat g = FixedToFloat(span->green); @@ -383,7 +383,7 @@ _swrast_span_interpolate_z( const struct gl_context *ctx, SWspan *span ) const GLuint n = span->end; GLuint i; - ASSERT(!(span->arrayMask & SPAN_Z)); + assert(!(span->arrayMask & SPAN_Z)); if (ctx->DrawBuffer->Visual.depthBits <= 16) { GLfixed zval = span->z; @@ -658,7 +658,7 @@ stipple_polygon_span(struct gl_context *ctx, SWspan *span) { GLubyte *mask = span->array->mask; - ASSERT(ctx->Polygon.StippleFlag); + assert(ctx->Polygon.StippleFlag); if (span->arrayMask & SPAN_XY) { /* arrays of x/y pixel coords */ @@ -748,7 +748,7 @@ clip_span( struct gl_context *ctx, SWspan *span ) /* Clip to right */ if (x + n > xmax) { - ASSERT(x < xmax); + assert(x < xmax); n = span->end = xmax - x; } @@ -757,8 +757,8 @@ clip_span( struct gl_context *ctx, SWspan *span ) const GLint leftClip = xmin - x; GLuint i; - ASSERT(leftClip > 0); - ASSERT(x + n > xmin); + assert(leftClip > 0); + assert(x + n > xmin); /* Clip 'leftClip' pixels from the left side. * The span->leftClip field will be applied when we interpolate @@ -813,10 +813,10 @@ clip_span( struct gl_context *ctx, SWspan *span ) span->writeAll = GL_FALSE; } - ASSERT(span->x >= xmin); - ASSERT(span->x + span->end <= xmax); - ASSERT(span->y >= ymin); - ASSERT(span->y < ymax); + assert(span->x >= xmin); + assert(span->x + span->end <= xmax); + assert(span->y >= ymin); + assert(span->y < ymax); return GL_TRUE; /* some pixels visible */ } @@ -837,9 +837,9 @@ add_specular(struct gl_context *ctx, SWspan *span) GLfloat (*col1)[4] = span->array->attribs[VARYING_SLOT_COL1]; GLuint i; - ASSERT(!_swrast_use_fragment_program(ctx)); - ASSERT(span->arrayMask & SPAN_RGBA); - ASSERT(swrast->_ActiveAttribMask & VARYING_BIT_COL1); + assert(!_swrast_use_fragment_program(ctx)); + assert(span->arrayMask & SPAN_RGBA); + assert(swrast->_ActiveAttribMask & VARYING_BIT_COL1); (void) swrast; /* silence warning */ if (span->array->ChanType == GL_FLOAT) { @@ -859,8 +859,8 @@ add_specular(struct gl_context *ctx, SWspan *span) interpolate_active_attribs(ctx, span, VARYING_BIT_COL1); } - ASSERT(span->arrayAttribs & VARYING_BIT_COL0); - ASSERT(span->arrayAttribs & VARYING_BIT_COL1); + assert(span->arrayAttribs & VARYING_BIT_COL0); + assert(span->arrayAttribs & VARYING_BIT_COL1); for (i = 0; i < span->end; i++) { if (mask[i]) { @@ -887,8 +887,8 @@ apply_aa_coverage(SWspan *span) for (i = 0; i < span->end; i++) { const GLfloat a = rgba[i][ACOMP] * coverage[i]; rgba[i][ACOMP] = (GLubyte) CLAMP(a, 0.0, 255.0); - ASSERT(coverage[i] >= 0.0); - ASSERT(coverage[i] <= 1.0); + assert(coverage[i] >= 0.0); + assert(coverage[i] <= 1.0); } } else if (span->array->ChanType == GL_UNSIGNED_SHORT) { @@ -916,7 +916,7 @@ clamp_colors(SWspan *span) { GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0]; GLuint i; - ASSERT(span->array->ChanType == GL_FLOAT); + assert(span->array->ChanType == GL_FLOAT); for (i = 0; i < span->end; i++) { rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F); rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F); @@ -945,7 +945,7 @@ convert_color_type(SWspan *span, GLenum srcType, GLenum newType, GLuint output) src = span->array->rgba8; } else { - ASSERT(srcType == GL_UNSIGNED_SHORT); + assert(srcType == GL_UNSIGNED_SHORT); src = span->array->rgba16; } @@ -1008,7 +1008,7 @@ shade_texture_span(struct gl_context *ctx, SWspan *span) _swrast_exec_fragment_program(ctx, span); } else { - ASSERT(ctx->ATIFragmentShader._Enabled); + assert(ctx->ATIFragmentShader._Enabled); _swrast_exec_fragment_shader(ctx, span); } } @@ -1147,7 +1147,7 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span) span->interpMask, span->arrayMask); */ - ASSERT(span->primitive == GL_POINT || + assert(span->primitive == GL_POINT || span->primitive == GL_LINE || span->primitive == GL_POLYGON || span->primitive == GL_BITMAP); @@ -1167,7 +1167,7 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span) return; } - ASSERT(span->end <= SWRAST_MAX_WIDTH); + assert(span->end <= SWRAST_MAX_WIDTH); /* Depth bounds test */ if (ctx->Depth.BoundsTest && fb->Visual.depthBits > 0) { @@ -1229,8 +1229,8 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span) } else if (fb->Visual.depthBits > 0) { /* Just regular depth testing */ - ASSERT(ctx->Depth.Test); - ASSERT(span->arrayMask & SPAN_Z); + assert(ctx->Depth.Test); + assert(span->arrayMask & SPAN_Z); if (!_swrast_depth_test_span(ctx, span)) { /* all fragments failed test */ goto end; @@ -1272,7 +1272,7 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span) } #endif - ASSERT(span->arrayMask & SPAN_RGBA); + assert(span->arrayMask & SPAN_RGBA); if (span->primitive == GL_BITMAP || !swrast->SpecularVertexAdd) { /* Add primary and specular (diffuse + specular) colors */ @@ -1353,7 +1353,7 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span) 4 * span->end * sizeof(GLchan)); } - ASSERT(rb->_BaseFormat == GL_RGBA || + assert(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RED || rb->_BaseFormat == GL_RG || @@ -1457,8 +1457,8 @@ _swrast_read_rgba_span( struct gl_context *ctx, struct gl_renderbuffer *rb, length = (GLint) n; } - ASSERT(rb); - ASSERT(rb->_BaseFormat == GL_RGBA || + assert(rb); + assert(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RG || rb->_BaseFormat == GL_RED || diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index eba9da863ba..294b593a20f 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -280,7 +280,7 @@ compute_pass_fail_masks(GLuint n, const GLubyte origMask[], { GLuint i; for (i = 0; i < n; i++) { - ASSERT(newMask[i] == 0 || newMask[i] == 1); + assert(newMask[i] == 0 || newMask[i] == 1); passMask[i] = origMask[i] & newMask[i]; failMask[i] = origMask[i] & (newMask[i] ^ 1); } diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index def5eb19e00..58ff1646583 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -188,7 +188,7 @@ texture_combine( struct gl_context *ctx, GLuint unit, /* ARB_texture_env_crossbar source */ { const GLuint srcUnit = srcRGB - GL_TEXTURE0; - ASSERT(srcUnit < ctx->Const.MaxTextureUnits); + assert(srcUnit < ctx->Const.MaxTextureUnits); if (!ctx->Texture.Unit[srcUnit]._Current) goto end; argRGB[term] = get_texel_array(swrast, srcUnit); @@ -278,7 +278,7 @@ texture_combine( struct gl_context *ctx, GLuint unit, /* ARB_texture_env_crossbar source */ { const GLuint srcUnit = srcA - GL_TEXTURE0; - ASSERT(srcUnit < ctx->Const.MaxTextureUnits); + assert(srcUnit < ctx->Const.MaxTextureUnits); if (!ctx->Texture.Unit[srcUnit]._Current) goto end; argA[term] = get_texel_array(swrast, srcUnit); @@ -628,7 +628,7 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span ) return; } - ASSERT(span->end <= SWRAST_MAX_WIDTH); + assert(span->end <= SWRAST_MAX_WIDTH); /* * Save copy of the incoming fragment colors (the GL_PRIMARY_COLOR) diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c index 9629024b9bc..242f8a43fa1 100644 --- a/src/mesa/swrast/s_texfetch.c +++ b/src/mesa/swrast/s_texfetch.c @@ -598,7 +598,7 @@ set_fetch_functions(const struct gl_sampler_object *samp, texImage->FetchCompressedTexel = _mesa_get_compressed_fetch_func(format); - ASSERT(texImage->FetchTexel); + assert(texImage->FetchTexel); } void diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index fa79fdc5b49..ae42640cf69 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -668,7 +668,7 @@ compute_min_mag_ranges(const struct gl_sampler_object *samp, GLfloat minMagThresh; /* we shouldn't be here if minfilter == magfilter */ - ASSERT(samp->MinFilter != samp->MagFilter); + assert(samp->MinFilter != samp->MagFilter); /* This bit comes from the OpenGL spec: */ if (samp->MagFilter == GL_LINEAR @@ -690,12 +690,12 @@ compute_min_mag_ranges(const struct gl_sampler_object *samp, printf("lambda delta = %g\n", lambda[0] - lambda[n-1]); if (lambda[0] >= lambda[n-1]) { /* decreasing */ for (i = 0; i < n - 1; i++) { - ASSERT((GLint) (lambda[i] * 10) >= (GLint) (lambda[i+1] * 10)); + assert((GLint) (lambda[i] * 10) >= (GLint) (lambda[i+1] * 10)); } } else { /* increasing */ for (i = 0; i < n - 1; i++) { - ASSERT((GLint) (lambda[i] * 10) <= (GLint) (lambda[i+1] * 10)); + assert((GLint) (lambda[i] * 10) <= (GLint) (lambda[i+1] * 10)); } } } @@ -749,13 +749,13 @@ compute_min_mag_ranges(const struct gl_sampler_object *samp, for (i = 0; i < n; i++) { if (lambda[i] > minMagThresh) { /* minification */ - ASSERT(i >= *minStart); - ASSERT(i < *minEnd); + assert(i >= *minStart); + assert(i < *minEnd); } else { /* magnification */ - ASSERT(i >= *magStart); - ASSERT(i < *magEnd); + assert(i >= *magStart); + assert(i < *magEnd); } } } @@ -920,7 +920,7 @@ sample_1d_nearest_mipmap_nearest(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = nearest_mipmap_level(tObj, lambda[i]); sample_1d_nearest(ctx, samp, tObj->Image[0][level], texcoord[i], rgba[i]); @@ -936,7 +936,7 @@ sample_1d_linear_mipmap_nearest(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = nearest_mipmap_level(tObj, lambda[i]); sample_1d_linear(ctx, samp, tObj->Image[0][level], texcoord[i], rgba[i]); @@ -952,7 +952,7 @@ sample_1d_nearest_mipmap_linear(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = linear_mipmap_level(tObj, lambda[i]); if (level >= tObj->_MaxLevel) { @@ -978,7 +978,7 @@ sample_1d_linear_mipmap_linear(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = linear_mipmap_level(tObj, lambda[i]); if (level >= tObj->_MaxLevel) { @@ -1042,7 +1042,7 @@ sample_lambda_1d( struct gl_context *ctx, GLuint magStart, magEnd; /* texels with magnification */ GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); compute_min_mag_ranges(samp, n, lambda, &minStart, &minEnd, &magStart, &magEnd); @@ -1226,10 +1226,10 @@ sample_2d_linear_repeat(struct gl_context *ctx, (void) ctx; - ASSERT(samp->WrapS == GL_REPEAT); - ASSERT(samp->WrapT == GL_REPEAT); - ASSERT(img->Border == 0); - ASSERT(swImg->_IsPowerOfTwo); + assert(samp->WrapS == GL_REPEAT); + assert(samp->WrapT == GL_REPEAT); + assert(img->Border == 0); + assert(swImg->_IsPowerOfTwo); linear_repeat_texel_location(width, texcoord[0], &i0, &i1, &wi); linear_repeat_texel_location(height, texcoord[1], &j0, &j1, &wj); @@ -1266,7 +1266,7 @@ sample_2d_linear_mipmap_nearest(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = nearest_mipmap_level(tObj, lambda[i]); sample_2d_linear(ctx, samp, tObj->Image[0][level], texcoord[i], rgba[i]); @@ -1282,7 +1282,7 @@ sample_2d_nearest_mipmap_linear(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = linear_mipmap_level(tObj, lambda[i]); if (level >= tObj->_MaxLevel) { @@ -1308,7 +1308,7 @@ sample_2d_linear_mipmap_linear( struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4] ) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = linear_mipmap_level(tObj, lambda[i]); if (level >= tObj->_MaxLevel) { @@ -1334,9 +1334,9 @@ sample_2d_linear_mipmap_linear_repeat(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); - ASSERT(samp->WrapS == GL_REPEAT); - ASSERT(samp->WrapT == GL_REPEAT); + assert(lambda != NULL); + assert(samp->WrapS == GL_REPEAT); + assert(samp->WrapT == GL_REPEAT); for (i = 0; i < n; i++) { GLint level = linear_mipmap_level(tObj, lambda[i]); if (level >= tObj->_MaxLevel) { @@ -1426,11 +1426,11 @@ opt_sample_rgb_2d(struct gl_context *ctx, GLuint k; (void) ctx; (void) lambda; - ASSERT(samp->WrapS==GL_REPEAT); - ASSERT(samp->WrapT==GL_REPEAT); - ASSERT(img->Border==0); - ASSERT(img->TexFormat == MESA_FORMAT_BGR_UNORM8); - ASSERT(swImg->_IsPowerOfTwo); + assert(samp->WrapS==GL_REPEAT); + assert(samp->WrapT==GL_REPEAT); + assert(img->Border==0); + assert(img->TexFormat == MESA_FORMAT_BGR_UNORM8); + assert(swImg->_IsPowerOfTwo); (void) swImg; for (k=0; k<n; k++) { @@ -1471,11 +1471,11 @@ opt_sample_rgba_2d(struct gl_context *ctx, GLuint i; (void) ctx; (void) lambda; - ASSERT(samp->WrapS==GL_REPEAT); - ASSERT(samp->WrapT==GL_REPEAT); - ASSERT(img->Border==0); - ASSERT(img->TexFormat == MESA_FORMAT_A8B8G8R8_UNORM); - ASSERT(swImg->_IsPowerOfTwo); + assert(samp->WrapS==GL_REPEAT); + assert(samp->WrapT==GL_REPEAT); + assert(img->Border==0); + assert(img->TexFormat == MESA_FORMAT_A8B8G8R8_UNORM); + assert(swImg->_IsPowerOfTwo); (void) swImg; for (i = 0; i < n; i++) { @@ -1511,7 +1511,7 @@ sample_lambda_2d(struct gl_context *ctx, swImg->RowStride) && swImg->_IsPowerOfTwo; - ASSERT(lambda != NULL); + assert(lambda != NULL); compute_min_mag_ranges(samp, n, lambda, &minStart, &minEnd, &magStart, &magEnd); @@ -1674,7 +1674,7 @@ sample_2d_ewa(struct gl_context *ctx, GLfloat 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 */ GLfloat d = -B*B+4.0f*C*A; @@ -2164,7 +2164,7 @@ sample_3d_linear_mipmap_nearest(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = nearest_mipmap_level(tObj, lambda[i]); sample_3d_linear(ctx, samp, tObj->Image[0][level], texcoord[i], rgba[i]); @@ -2180,7 +2180,7 @@ sample_3d_nearest_mipmap_linear(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = linear_mipmap_level(tObj, lambda[i]); if (level >= tObj->_MaxLevel) { @@ -2206,7 +2206,7 @@ sample_3d_linear_mipmap_linear(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = linear_mipmap_level(tObj, lambda[i]); if (level >= tObj->_MaxLevel) { @@ -2270,7 +2270,7 @@ sample_lambda_3d(struct gl_context *ctx, GLuint magStart, magEnd; /* texels with magnification */ GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); compute_min_mag_ranges(samp, n, lambda, &minStart, &minEnd, &magStart, &magEnd); @@ -2471,7 +2471,7 @@ sample_cube_nearest_mipmap_nearest(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { const struct gl_texture_image **images; GLfloat newCoord[4]; @@ -2506,7 +2506,7 @@ sample_cube_linear_mipmap_nearest(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { const struct gl_texture_image **images; GLfloat newCoord[4]; @@ -2531,7 +2531,7 @@ sample_cube_nearest_mipmap_linear(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { const struct gl_texture_image **images; GLfloat newCoord[4]; @@ -2566,7 +2566,7 @@ sample_cube_linear_mipmap_linear(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { const struct gl_texture_image **images; GLfloat newCoord[4]; @@ -2604,7 +2604,7 @@ sample_lambda_cube(struct gl_context *ctx, GLuint minStart, minEnd; /* texels with minification */ GLuint magStart, magEnd; /* texels with magnification */ - ASSERT(lambda != NULL); + assert(lambda != NULL); compute_min_mag_ranges(samp, n, lambda, &minStart, &minEnd, &magStart, &magEnd); @@ -2687,10 +2687,10 @@ sample_nearest_rect(struct gl_context *ctx, (void) ctx; (void) lambda; - ASSERT(samp->WrapS == GL_CLAMP || + assert(samp->WrapS == GL_CLAMP || samp->WrapS == GL_CLAMP_TO_EDGE || samp->WrapS == GL_CLAMP_TO_BORDER); - ASSERT(samp->WrapT == GL_CLAMP || + assert(samp->WrapT == GL_CLAMP || samp->WrapT == GL_CLAMP_TO_EDGE || samp->WrapT == GL_CLAMP_TO_BORDER); @@ -2722,10 +2722,10 @@ sample_linear_rect(struct gl_context *ctx, (void) ctx; (void) lambda; - ASSERT(samp->WrapS == GL_CLAMP || + assert(samp->WrapS == GL_CLAMP || samp->WrapS == GL_CLAMP_TO_EDGE || samp->WrapS == GL_CLAMP_TO_BORDER); - ASSERT(samp->WrapT == GL_CLAMP || + assert(samp->WrapT == GL_CLAMP || samp->WrapT == GL_CLAMP_TO_EDGE || samp->WrapT == GL_CLAMP_TO_BORDER); @@ -2947,7 +2947,7 @@ sample_2d_array_linear_mipmap_nearest(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = nearest_mipmap_level(tObj, lambda[i]); sample_2d_array_linear(ctx, samp, tObj->Image[0][level], @@ -2964,7 +2964,7 @@ sample_2d_array_nearest_mipmap_linear(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = linear_mipmap_level(tObj, lambda[i]); if (level >= tObj->_MaxLevel) { @@ -2992,7 +2992,7 @@ sample_2d_array_linear_mipmap_linear(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = linear_mipmap_level(tObj, lambda[i]); if (level >= tObj->_MaxLevel) { @@ -3059,7 +3059,7 @@ sample_lambda_2d_array(struct gl_context *ctx, GLuint magStart, magEnd; /* texels with magnification */ GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); compute_min_mag_ranges(samp, n, lambda, &minStart, &minEnd, &magStart, &magEnd); @@ -3242,7 +3242,7 @@ sample_1d_array_linear_mipmap_nearest(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = nearest_mipmap_level(tObj, lambda[i]); sample_1d_array_linear(ctx, samp, tObj->Image[0][level], @@ -3259,7 +3259,7 @@ sample_1d_array_nearest_mipmap_linear(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = linear_mipmap_level(tObj, lambda[i]); if (level >= tObj->_MaxLevel) { @@ -3285,7 +3285,7 @@ sample_1d_array_linear_mipmap_linear(struct gl_context *ctx, const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); for (i = 0; i < n; i++) { GLint level = linear_mipmap_level(tObj, lambda[i]); if (level >= tObj->_MaxLevel) { @@ -3349,7 +3349,7 @@ sample_lambda_1d_array(struct gl_context *ctx, GLuint magStart, magEnd; /* texels with magnification */ GLuint i; - ASSERT(lambda != NULL); + assert(lambda != NULL); compute_min_mag_ranges(samp, n, lambda, &minStart, &minEnd, &magStart, &magEnd); @@ -3555,10 +3555,10 @@ sample_depth_texture( struct gl_context *ctx, GLenum function; GLfloat result; - ASSERT(img->_BaseFormat == GL_DEPTH_COMPONENT || + assert(img->_BaseFormat == GL_DEPTH_COMPONENT || img->_BaseFormat == GL_DEPTH_STENCIL_EXT); - ASSERT(tObj->Target == GL_TEXTURE_1D || + assert(tObj->Target == GL_TEXTURE_1D || tObj->Target == GL_TEXTURE_2D || tObj->Target == GL_TEXTURE_RECTANGLE_NV || tObj->Target == GL_TEXTURE_1D_ARRAY_EXT || @@ -3595,7 +3595,7 @@ sample_depth_texture( struct gl_context *ctx, } else { GLuint i; - ASSERT(samp->MagFilter == GL_LINEAR); + assert(samp->MagFilter == GL_LINEAR); for (i = 0; i < n; i++) { GLfloat depth00, depth01, depth10, depth11, depthRef; GLint i0, i1, j0, j1; @@ -3730,7 +3730,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return &sample_linear_1d; } else { - ASSERT(sampler->MinFilter == GL_NEAREST); + assert(sampler->MinFilter == GL_NEAREST); return &sample_nearest_1d; } case GL_TEXTURE_2D: @@ -3755,7 +3755,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, swrast_texture_image_const(img); texture_sample_func func; - ASSERT(sampler->MinFilter == GL_NEAREST); + assert(sampler->MinFilter == GL_NEAREST); func = &sample_nearest_2d; if (sampler->WrapS == GL_REPEAT && sampler->WrapT == GL_REPEAT && @@ -3777,7 +3777,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return &sample_linear_3d; } else { - ASSERT(sampler->MinFilter == GL_NEAREST); + assert(sampler->MinFilter == GL_NEAREST); return &sample_nearest_3d; } case GL_TEXTURE_CUBE_MAP: @@ -3788,7 +3788,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return &sample_linear_cube; } else { - ASSERT(sampler->MinFilter == GL_NEAREST); + assert(sampler->MinFilter == GL_NEAREST); return &sample_nearest_cube; } case GL_TEXTURE_RECTANGLE_NV: @@ -3802,7 +3802,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return &sample_linear_rect; } else { - ASSERT(sampler->MinFilter == GL_NEAREST); + assert(sampler->MinFilter == GL_NEAREST); return &sample_nearest_rect; } case GL_TEXTURE_1D_ARRAY_EXT: @@ -3816,7 +3816,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return &sample_linear_1d_array; } else { - ASSERT(sampler->MinFilter == GL_NEAREST); + assert(sampler->MinFilter == GL_NEAREST); return &sample_nearest_1d_array; } case GL_TEXTURE_2D_ARRAY_EXT: @@ -3830,7 +3830,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return &sample_linear_2d_array; } else { - ASSERT(sampler->MinFilter == GL_NEAREST); + assert(sampler->MinFilter == GL_NEAREST); return &sample_nearest_2d_array; } default: diff --git a/src/mesa/swrast/s_texrender.c b/src/mesa/swrast/s_texrender.c index d67e48ad36c..29bb270d602 100644 --- a/src/mesa/swrast/s_texrender.c +++ b/src/mesa/swrast/s_texrender.c @@ -18,7 +18,7 @@ static void delete_texture_wrapper(struct gl_context *ctx, struct gl_renderbuffer *rb) { - ASSERT(rb->RefCount == 0); + assert(rb->RefCount == 0); free(rb); } diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 1d8e31c2e19..af039c3593a 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -78,8 +78,8 @@ _swrast_culltriangle( struct gl_context *ctx, #define NAME flat_rgba_triangle #define INTERP_Z 1 #define SETUP_CODE \ - ASSERT(ctx->Texture._EnabledCoordUnits == 0);\ - ASSERT(ctx->Light.ShadeModel==GL_FLAT); \ + assert(ctx->Texture._EnabledCoordUnits == 0);\ + assert(ctx->Light.ShadeModel==GL_FLAT); \ span.interpMask |= SPAN_RGBA; \ span.red = ChanToFixed(v2->color[0]); \ span.green = ChanToFixed(v2->color[1]); \ @@ -104,8 +104,8 @@ _swrast_culltriangle( struct gl_context *ctx, #define SETUP_CODE \ { \ /* texturing must be off */ \ - ASSERT(ctx->Texture._EnabledCoordUnits == 0); \ - ASSERT(ctx->Light.ShadeModel==GL_SMOOTH); \ + assert(ctx->Texture._EnabledCoordUnits == 0); \ + assert(ctx->Light.ShadeModel==GL_SMOOTH); \ } #define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span); #include "s_tritemp.h" @@ -137,7 +137,7 @@ _swrast_culltriangle( struct gl_context *ctx, const GLubyte *texture = (const GLubyte *) swImg->ImageSlices[0]; \ const GLint smask = texImg->Width - 1; \ const GLint tmask = texImg->Height - 1; \ - ASSERT(texImg->TexFormat == MESA_FORMAT_BGR_UNORM8); \ + assert(texImg->TexFormat == MESA_FORMAT_BGR_UNORM8); \ if (!rb || !texture) { \ return; \ } @@ -195,7 +195,7 @@ _swrast_culltriangle( struct gl_context *ctx, const GLubyte *texture = (const GLubyte *) swImg->ImageSlices[0]; \ const GLint smask = texImg->Width - 1; \ const GLint tmask = texImg->Height - 1; \ - ASSERT(texImg->TexFormat == MESA_FORMAT_BGR_UNORM8); \ + assert(texImg->TexFormat == MESA_FORMAT_BGR_UNORM8); \ if (!rb || !texture) { \ return; \ } @@ -513,7 +513,7 @@ affine_span(struct gl_context *ctx, SWspan *span, break; } span->interpMask &= ~SPAN_RGBA; - ASSERT(span->arrayMask & SPAN_RGBA); + assert(span->arrayMask & SPAN_RGBA); _swrast_write_rgba_span(ctx, span); @@ -783,7 +783,7 @@ fast_persp_span(struct gl_context *ctx, SWspan *span, break; } - ASSERT(span->arrayMask & SPAN_RGBA); + assert(span->arrayMask & SPAN_RGBA); _swrast_write_rgba_span(ctx, span); #undef SPAN_NEAREST @@ -885,9 +885,9 @@ fast_persp_span(struct gl_context *ctx, SWspan *span, struct gl_renderbuffer *rb = \ ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; \ struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; \ - ASSERT(ctx->Depth.Test); \ - ASSERT(!ctx->Depth.Mask); \ - ASSERT(ctx->Depth.Func == GL_LESS); \ + assert(ctx->Depth.Test); \ + assert(!ctx->Depth.Mask); \ + assert(ctx->Depth.Func == GL_LESS); \ assert(rb->Format == MESA_FORMAT_Z_UNORM16); \ if (!q) { \ return; \ @@ -1015,7 +1015,7 @@ _swrast_choose_triangle( struct gl_context *ctx ) if (ctx->Polygon.SmoothFlag) { _swrast_set_aa_triangle_function(ctx); - ASSERT(swrast->Triangle); + assert(swrast->Triangle); return; } @@ -1134,8 +1134,8 @@ _swrast_choose_triangle( struct gl_context *ctx ) } } else { - ASSERT(!swrast->_FogEnabled); - ASSERT(!_mesa_need_secondary_color(ctx)); + assert(!swrast->_FogEnabled); + assert(!_mesa_need_secondary_color(ctx)); if (ctx->Light.ShadeModel==GL_SMOOTH) { /* smooth shaded, no texturing, stippled or some raster ops */ #if CHAN_BITS != 8 diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index 8a278dff65a..f0281e4568b 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -380,7 +380,7 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0, # endif /* INTERP_ALPHA */ } else { - ASSERT(ctx->Light.ShadeModel == GL_FLAT); + assert(ctx->Light.ShadeModel == GL_FLAT); span.interpMask |= SPAN_FLAT; span.attrStepX[VARYING_SLOT_COL0][0] = span.attrStepY[VARYING_SLOT_COL0][0] = 0.0F; span.attrStepX[VARYING_SLOT_COL0][1] = span.attrStepY[VARYING_SLOT_COL0][1] = 0.0F; @@ -662,7 +662,7 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0, # endif } else { - ASSERT(ctx->Light.ShadeModel == GL_FLAT); + assert(ctx->Light.ShadeModel == GL_FLAT); rLeft = ChanToFixed(v2->color[RCOMP]); gLeft = ChanToFixed(v2->color[GCOMP]); bLeft = ChanToFixed(v2->color[BCOMP]); diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 352c61ad297..ab22652c726 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -53,8 +53,8 @@ compute_zoomed_bounds(struct gl_context *ctx, GLint imageX, GLint imageY, const struct gl_framebuffer *fb = ctx->DrawBuffer; GLint c0, c1, r0, r1; - ASSERT(spanX >= imageX); - ASSERT(spanY >= imageY); + assert(spanX >= imageX); + assert(spanY >= imageY); /* * Compute destination columns: [c0, c1) @@ -149,12 +149,12 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, } zoomedWidth = x1 - x0; - ASSERT(zoomedWidth > 0); - ASSERT(zoomedWidth <= SWRAST_MAX_WIDTH); + assert(zoomedWidth > 0); + assert(zoomedWidth <= SWRAST_MAX_WIDTH); /* no pixel arrays! must be horizontal spans. */ - ASSERT((span->arrayMask & SPAN_XY) == 0); - ASSERT(span->primitive == GL_BITMAP); + assert((span->arrayMask & SPAN_XY) == 0); + assert(span->primitive == GL_BITMAP); INIT_SPAN(zoomed, GL_BITMAP); zoomed.x = x0; @@ -184,7 +184,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, zoomed.interpMask = span->interpMask & ~SPAN_RGBA; zoomed.arrayMask |= SPAN_RGBA; zoomed.arrayAttribs |= VARYING_BIT_COL0; /* we'll produce these values */ - ASSERT(span->arrayMask & SPAN_RGBA); + assert(span->arrayMask & SPAN_RGBA); } else if (format == GL_DEPTH_COMPONENT) { /* Copy color info */ @@ -199,7 +199,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, /* we'll generate an array of depth values */ zoomed.interpMask = span->interpMask & ~SPAN_Z; zoomed.arrayMask |= SPAN_Z; - ASSERT(span->arrayMask & SPAN_Z); + assert(span->arrayMask & SPAN_Z); } else { _mesa_problem(ctx, "Bad format in zoom_span"); @@ -213,8 +213,8 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint i; for (i = 0; i < zoomedWidth; i++) { GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); + assert(j >= 0); + assert(j < (GLint) span->end); COPY_4UBV(zoomed.array->rgba8[i], rgba[j]); } } @@ -223,8 +223,8 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint i; for (i = 0; i < zoomedWidth; i++) { GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); + assert(j >= 0); + assert(j < (GLint) span->end); COPY_4V(zoomed.array->rgba16[i], rgba[j]); } } @@ -233,8 +233,8 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint i; for (i = 0; i < zoomedWidth; i++) { GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); + assert(j >= 0); + assert(j < (GLint) span->end); COPY_4V(zoomed.array->attribs[VARYING_SLOT_COL0][i], rgba[j]); } } @@ -245,8 +245,8 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint i; for (i = 0; i < zoomedWidth; i++) { GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); + assert(j >= 0); + assert(j < (GLint) span->end); zoomed.array->rgba8[i][0] = rgb[j][0]; zoomed.array->rgba8[i][1] = rgb[j][1]; zoomed.array->rgba8[i][2] = rgb[j][2]; @@ -258,8 +258,8 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint i; for (i = 0; i < zoomedWidth; i++) { GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); + assert(j >= 0); + assert(j < (GLint) span->end); zoomed.array->rgba16[i][0] = rgb[j][0]; zoomed.array->rgba16[i][1] = rgb[j][1]; zoomed.array->rgba16[i][2] = rgb[j][2]; @@ -271,8 +271,8 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint i; for (i = 0; i < zoomedWidth; i++) { GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); + assert(j >= 0); + assert(j < (GLint) span->end); zoomed.array->attribs[VARYING_SLOT_COL0][i][0] = rgb[j][0]; zoomed.array->attribs[VARYING_SLOT_COL0][i][1] = rgb[j][1]; zoomed.array->attribs[VARYING_SLOT_COL0][i][2] = rgb[j][2]; @@ -285,8 +285,8 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint i; for (i = 0; i < zoomedWidth; i++) { GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); + assert(j >= 0); + assert(j < (GLint) span->end); zoomed.array->z[i] = zValues[j]; } /* Now, fall into the RGB path below */ @@ -372,8 +372,8 @@ _swrast_write_zoomed_stencil_span(struct gl_context *ctx, GLint imgX, GLint imgY } zoomedWidth = x1 - x0; - ASSERT(zoomedWidth > 0); - ASSERT(zoomedWidth <= SWRAST_MAX_WIDTH); + assert(zoomedWidth > 0); + assert(zoomedWidth <= SWRAST_MAX_WIDTH); zoomedVals = malloc(zoomedWidth * sizeof(GLubyte)); if (!zoomedVals) @@ -382,8 +382,8 @@ _swrast_write_zoomed_stencil_span(struct gl_context *ctx, GLint imgX, GLint imgY /* zoom the span horizontally */ for (i = 0; i < zoomedWidth; i++) { GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX; - ASSERT(j >= 0); - ASSERT(j < width); + assert(j >= 0); + assert(j < width); zoomedVals[i] = stencil[j]; } @@ -417,8 +417,8 @@ _swrast_write_zoomed_z_span(struct gl_context *ctx, GLint imgX, GLint imgY, } zoomedWidth = x1 - x0; - ASSERT(zoomedWidth > 0); - ASSERT(zoomedWidth <= SWRAST_MAX_WIDTH); + assert(zoomedWidth > 0); + assert(zoomedWidth <= SWRAST_MAX_WIDTH); zoomedVals = malloc(zoomedWidth * sizeof(GLuint)); if (!zoomedVals) @@ -427,8 +427,8 @@ _swrast_write_zoomed_z_span(struct gl_context *ctx, GLint imgX, GLint imgY, /* zoom the span horizontally */ for (i = 0; i < zoomedWidth; i++) { GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX; - ASSERT(j >= 0); - ASSERT(j < width); + assert(j >= 0); + assert(j < width); zoomedVals[i] = zVals[j]; } diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index eb5bae41da2..bc705d7a350 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -130,7 +130,7 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state ) GLuint i; if (new_state & (_NEW_HINT | _NEW_PROGRAM)) { - ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog); + assert(tnl->AllowVertexFog || tnl->AllowPixelFog); tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST)) || !tnl->AllowPixelFog) && !fp; } diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h index 7dafb83cf17..12181f085bc 100644 --- a/src/mesa/tnl/t_vb_cliptmp.h +++ b/src/mesa/tnl/t_vb_cliptmp.h @@ -155,7 +155,7 @@ TAG(clip_line)( struct gl_context *ctx, GLuint v0, GLuint v1, GLubyte mask ) newvert++; } else { - ASSERT(t0 == 0.0); + assert(t0 == 0.0); } /* Note: we need to use vertex v0_orig when computing the new @@ -174,7 +174,7 @@ TAG(clip_line)( struct gl_context *ctx, GLuint v0, GLuint v1, GLubyte mask ) newvert++; } else { - ASSERT(t1 == 0.0); + assert(t1 == 0.0); } tnl->Driver.Render.ClippedLine( ctx, v0, v1 ); @@ -239,7 +239,7 @@ TAG(clip_tri)( struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte if (ctx->Light.ShadeModel == GL_FLAT) { if (pv != inlist[0]) { - ASSERT( inlist[0] >= VB->Count ); + assert( inlist[0] >= VB->Count ); tnl->Driver.Render.CopyPV( ctx, inlist[0], pv ); } } @@ -302,7 +302,7 @@ TAG(clip_quad)( struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint if (ctx->Light.ShadeModel == GL_FLAT) { if (pv != inlist[0]) { - ASSERT( inlist[0] >= VB->Count ); + assert( inlist[0] >= VB->Count ); tnl->Driver.Render.CopyPV( ctx, inlist[0], pv ); } } diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index f6884a464ea..7e76ed40338 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -123,7 +123,7 @@ validate_shine_table( struct gl_context *ctx, GLuint side, GLfloat shininess ) struct tnl_shine_tab *list = tnl->_ShineTabList; struct tnl_shine_tab *s; - ASSERT(side < 2); + assert(side < 2); foreach(s, list) if ( s->shininess == shininess ) diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index d08abe7c25d..464a4cddd56 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -392,7 +392,7 @@ run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage ) store->results[VARYING_SLOT_FOGC].data[i][3] = 1.0; } #ifdef NAN_CHECK - ASSERT(machine->Outputs[0][3] != 0.0F); + assert(machine->Outputs[0][3] != 0.0F); #endif #if 0 printf("HPOS: %f %f %f %f\n", diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c index aff5b9a6832..a090c48d0f2 100644 --- a/src/mesa/tnl/t_vb_render.c +++ b/src/mesa/tnl/t_vb_render.c @@ -271,22 +271,22 @@ static GLboolean run_render( struct gl_context *ctx, * that window coordinates are guarenteed not to change before * rendering. */ - ASSERT(tnl->Driver.Render.Start); + assert(tnl->Driver.Render.Start); tnl->Driver.Render.Start( ctx ); - ASSERT(tnl->Driver.Render.BuildVertices); - ASSERT(tnl->Driver.Render.PrimitiveNotify); - ASSERT(tnl->Driver.Render.Points); - ASSERT(tnl->Driver.Render.Line); - ASSERT(tnl->Driver.Render.Triangle); - ASSERT(tnl->Driver.Render.Quad); - ASSERT(tnl->Driver.Render.ResetLineStipple); - ASSERT(tnl->Driver.Render.Interp); - ASSERT(tnl->Driver.Render.CopyPV); - ASSERT(tnl->Driver.Render.ClippedLine); - ASSERT(tnl->Driver.Render.ClippedPolygon); - ASSERT(tnl->Driver.Render.Finish); + assert(tnl->Driver.Render.BuildVertices); + assert(tnl->Driver.Render.PrimitiveNotify); + assert(tnl->Driver.Render.Points); + assert(tnl->Driver.Render.Line); + assert(tnl->Driver.Render.Triangle); + assert(tnl->Driver.Render.Quad); + assert(tnl->Driver.Render.ResetLineStipple); + assert(tnl->Driver.Render.Interp); + assert(tnl->Driver.Render.CopyPV); + assert(tnl->Driver.Render.ClippedLine); + assert(tnl->Driver.Render.ClippedPolygon); + assert(tnl->Driver.Render.Finish); tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 ); diff --git a/src/mesa/tnl_dd/t_dd_tritmp.h b/src/mesa/tnl_dd/t_dd_tritmp.h index c1eb2ded539..6fe2c8294a0 100644 --- a/src/mesa/tnl_dd/t_dd_tritmp.h +++ b/src/mesa/tnl_dd/t_dd_tritmp.h @@ -187,7 +187,7 @@ static void TAG(triangle)( struct gl_context *ctx, GLuint e0, GLuint e1, GLuint VERT_SAVE_RGBA( 2 ); if (VB->BackfaceColorPtr->stride) { - ASSERT(VB->BackfaceColorPtr->stride == 4*sizeof(GLfloat)); + assert(VB->BackfaceColorPtr->stride == 4*sizeof(GLfloat)); if (!DO_FLAT) { VERT_SET_RGBA( v[0], vbcolor[e0] ); @@ -205,7 +205,7 @@ static void TAG(triangle)( struct gl_context *ctx, GLuint e0, GLuint e1, GLuint if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) { GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; - ASSERT(VB->BackfaceSecondaryColorPtr->stride == 4*sizeof(GLfloat)); + assert(VB->BackfaceSecondaryColorPtr->stride == 4*sizeof(GLfloat)); if (!DO_FLAT) { VERT_SAVE_SPEC( 0 ); @@ -435,7 +435,7 @@ static void TAG(quadr)( struct gl_context *ctx, if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) { GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; - ASSERT(VB->BackfaceSecondaryColorPtr->stride==4*sizeof(GLfloat)); + assert(VB->BackfaceSecondaryColorPtr->stride==4*sizeof(GLfloat)); if (!DO_FLAT) { VERT_SAVE_SPEC( 0 ); diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index 19712aa58c4..696a6fa1f17 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -108,7 +108,7 @@ static void init_mat_currval(struct gl_context *ctx) &vbo->currval[VBO_ATTRIB_MAT_FRONT_AMBIENT]; GLuint i; - ASSERT(NR_MAT_ATTRIBS == MAT_ATTRIB_MAX); + assert(NR_MAT_ATTRIBS == MAT_ATTRIB_MAX); memset(arrays, 0, sizeof(*arrays) * NR_MAT_ATTRIBS); diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h index e2245130575..8d22602b5f4 100644 --- a/src/mesa/vbo/vbo_context.h +++ b/src/mesa/vbo/vbo_context.h @@ -124,7 +124,7 @@ vbo_draw_method(struct vbo_context *vbo, gl_draw_method method) ctx->Array._DrawArrays = vbo->save.inputs; break; default: - ASSERT(0); + assert(0); } ctx->NewDriverState |= ctx->DriverFlags.NewArray; @@ -146,7 +146,7 @@ vbo_attrtype_to_integer_flag(GLenum format) case GL_UNSIGNED_INT: return GL_TRUE; default: - ASSERT(0); + assert(0); return GL_FALSE; } } @@ -170,7 +170,7 @@ vbo_get_default_vals_as_float(GLenum format) case GL_UNSIGNED_INT: return (const GLfloat*)default_int; default: - ASSERT(0); + assert(0); return NULL; } } diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 5f8250e78c7..7a734874701 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -1036,7 +1036,7 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec ) &exec->vtx.bufferobj, ctx->Shared->NullBufferObj); - ASSERT(!exec->vtx.buffer_map); + assert(!exec->vtx.buffer_map); exec->vtx.buffer_map = _mesa_align_malloc(VBO_VERT_BUFFER_SIZE, 64); exec->vtx.buffer_ptr = exec->vtx.buffer_map; @@ -1044,16 +1044,16 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec ) _mesa_noop_vtxfmt_init(&exec->vtxfmt_noop); for (i = 0 ; i < VBO_ATTRIB_MAX ; i++) { - ASSERT(i < Elements(exec->vtx.attrsz)); + assert(i < Elements(exec->vtx.attrsz)); exec->vtx.attrsz[i] = 0; - ASSERT(i < Elements(exec->vtx.attrtype)); + assert(i < Elements(exec->vtx.attrtype)); exec->vtx.attrtype[i] = GL_FLOAT; - ASSERT(i < Elements(exec->vtx.active_sz)); + assert(i < Elements(exec->vtx.active_sz)); exec->vtx.active_sz[i] = 0; } for (i = 0 ; i < VERT_ATTRIB_MAX; i++) { - ASSERT(i < Elements(exec->vtx.inputs)); - ASSERT(i < Elements(exec->vtx.arrays)); + assert(i < Elements(exec->vtx.inputs)); + assert(i < Elements(exec->vtx.arrays)); exec->vtx.inputs[i] = &exec->vtx.arrays[i]; } @@ -1099,7 +1099,7 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ) /* True VBOs should already be unmapped */ if (exec->vtx.buffer_map) { - ASSERT(exec->vtx.bufferobj->Name == 0 || + assert(exec->vtx.bufferobj->Name == 0 || exec->vtx.bufferobj->Name == IMM_BUFFER_NAME); if (exec->vtx.bufferobj->Name == 0) { _mesa_align_free(exec->vtx.buffer_map); diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 362cc10405c..6d43514d0a6 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -172,7 +172,7 @@ vbo_exec_bind_arrays( struct gl_context *ctx ) exec->vtx.inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr]; } for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) { - ASSERT(VERT_ATTRIB_GENERIC(attr) < Elements(exec->vtx.inputs)); + assert(VERT_ATTRIB_GENERIC(attr) < Elements(exec->vtx.inputs)); exec->vtx.inputs[VERT_ATTRIB_GENERIC(attr)] = &vbo->currval[VBO_ATTRIB_MAT_FRONT_AMBIENT+attr]; } @@ -183,7 +183,7 @@ vbo_exec_bind_arrays( struct gl_context *ctx ) exec->vtx.inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr]; } for (attr = 0; attr < VERT_ATTRIB_GENERIC_MAX; attr++) { - ASSERT(VERT_ATTRIB_GENERIC(attr) < Elements(exec->vtx.inputs)); + assert(VERT_ATTRIB_GENERIC(attr) < Elements(exec->vtx.inputs)); exec->vtx.inputs[VERT_ATTRIB_GENERIC(attr)] = &vbo->currval[VBO_ATTRIB_GENERIC0+attr]; } @@ -213,8 +213,8 @@ vbo_exec_bind_arrays( struct gl_context *ctx ) (GLbyte *)exec->vtx.vertex; /* override the default array set above */ - ASSERT(attr < Elements(exec->vtx.inputs)); - ASSERT(attr < Elements(exec->vtx.arrays)); /* arrays[] */ + assert(attr < Elements(exec->vtx.inputs)); + assert(attr < Elements(exec->vtx.arrays)); /* arrays[] */ exec->vtx.inputs[attr] = &arrays[attr]; if (_mesa_is_bufferobj(exec->vtx.bufferobj)) { diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index beef342bed8..e0fa985c807 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -1564,14 +1564,14 @@ _save_current_init(struct gl_context *ctx) for (i = VBO_ATTRIB_POS; i <= VBO_ATTRIB_GENERIC15; i++) { const GLuint j = i - VBO_ATTRIB_POS; - ASSERT(j < VERT_ATTRIB_MAX); + assert(j < VERT_ATTRIB_MAX); save->currentsz[i] = &ctx->ListState.ActiveAttribSize[j]; save->current[i] = ctx->ListState.CurrentAttrib[j]; } for (i = VBO_ATTRIB_FIRST_MATERIAL; i <= VBO_ATTRIB_LAST_MATERIAL; i++) { const GLuint j = i - VBO_ATTRIB_FIRST_MATERIAL; - ASSERT(j < MAT_ATTRIB_MAX); + assert(j < MAT_ATTRIB_MAX); save->currentsz[i] = &ctx->ListState.ActiveMaterialSize[j]; save->current[i] = ctx->ListState.CurrentMaterial[j]; } |