diff options
author | Matt Turner <[email protected]> | 2015-02-20 20:18:47 -0800 |
---|---|---|
committer | Matt Turner <[email protected]> | 2015-02-23 10:49:47 -0800 |
commit | bfcdb843830bba0190e00e35e3c5c18c4bdb5de1 (patch) | |
tree | d4e8eebb5d58b3b1ac6caa383bfcda258b19c6c1 /src/mesa/swrast | |
parent | 52049f8fd83f2ef31c2a4d645cfb7d7b2ab518a6 (diff) |
mesa: Use assert() instead of ASSERT wrapper.
Acked-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/swrast')
28 files changed, 245 insertions, 245 deletions
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]; } |