diff options
Diffstat (limited to 'src/mesa/swrast/s_stencil.c')
-rw-r--r-- | src/mesa/swrast/s_stencil.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index dbab6b3c20..a8aa1d4b6d 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -1062,7 +1062,8 @@ void _swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb, GLint n, GLint x, GLint y, GLstencil stencil[]) { - if (y < 0 || y >= rb->Height || x + n <= 0 || x >= rb->Width) { + if (y < 0 || y >= (GLint) rb->Height || + x + n <= 0 || x >= (GLint) rb->Width) { /* span is completely outside framebuffer */ return; /* undefined values OK */ } @@ -1073,7 +1074,7 @@ _swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb, n -= dx; stencil += dx; } - if (x + n > rb->Width) { + if (x + n > (GLint) rb->Width) { GLint dx = x + n - rb->Width; n -= dx; } @@ -1103,7 +1104,8 @@ _swrast_write_stencil_span(GLcontext *ctx, GLint n, GLint x, GLint y, const GLuint stencilMax = (1 << fb->Visual.stencilBits) - 1; const GLuint stencilMask = ctx->Stencil.WriteMask[0]; - if (y < 0 || y >= rb->Height || x + n <= 0 || x >= rb->Width) { + if (y < 0 || y >= (GLint) rb->Height || + x + n <= 0 || x >= (GLint) rb->Width) { /* span is completely outside framebuffer */ return; /* undefined values OK */ } @@ -1113,7 +1115,7 @@ _swrast_write_stencil_span(GLcontext *ctx, GLint n, GLint x, GLint y, n -= dx; stencil += dx; } - if (x + n > rb->Width) { + if (x + n > (GLint) rb->Width) { GLint dx = x + n - rb->Width; n -= dx; } @@ -1191,7 +1193,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) } else { /* no bit masking */ - if (width == rb->Width && rb->DataType == GL_UNSIGNED_BYTE) { + if (width == (GLint) rb->Width && rb->DataType == GL_UNSIGNED_BYTE) { /* optimized case */ /* Note: bottom-to-top raster assumed! */ GLubyte *stencil = (GLubyte *) rb->GetPointer(ctx, rb, x, y); |