summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_stencil.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-04-19 00:38:27 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-04-19 00:38:27 +0000
commita670c1280b78e6da3b298b61f623e4c733c6be94 (patch)
tree803a29169de7fe25f7e193dfe6a2de85128c4591 /src/mesa/swrast/s_stencil.c
parentdb07de057f10ab7ab5be84352b674b200a0a9e22 (diff)
casts to fix GLint/GLuint mismatches
Diffstat (limited to 'src/mesa/swrast/s_stencil.c')
-rw-r--r--src/mesa/swrast/s_stencil.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index 04e0997177..5f5575de0d 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -1,4 +1,4 @@
-/* $Id: s_stencil.c,v 1.22 2002/03/19 16:47:05 brianp Exp $ */
+/* $Id: s_stencil.c,v 1.23 2002/04/19 00:38:27 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1017,8 +1017,10 @@ _mesa_read_stencil_span( GLcontext *ctx,
GLint n, GLint x, GLint y, GLstencil stencil[] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (y < 0 || y >= ctx->DrawBuffer->Height ||
- x + n <= 0 || x >= ctx->DrawBuffer->Width) {
+ const GLint bufWidth = (GLint) ctx->DrawBuffer->Width;
+ const GLint bufHeight = (GLint) ctx->DrawBuffer->Width;
+
+ if (y < 0 || y >= bufHeight || x + n <= 0 || x >= bufWidth) {
/* span is completely outside framebuffer */
return; /* undefined values OK */
}
@@ -1029,8 +1031,8 @@ _mesa_read_stencil_span( GLcontext *ctx,
n -= dx;
stencil += dx;
}
- if (x + n > ctx->DrawBuffer->Width) {
- GLint dx = x + n - ctx->DrawBuffer->Width;
+ if (x + n > bufWidth) {
+ GLint dx = x + n - bufWidth;
n -= dx;
}
if (n <= 0) {
@@ -1069,9 +1071,10 @@ _mesa_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y,
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLstencil *ssrc = stencil;
+ const GLint bufWidth = (GLint) ctx->DrawBuffer->Width;
+ const GLint bufHeight = (GLint) ctx->DrawBuffer->Width;
- if (y < 0 || y >= ctx->DrawBuffer->Height ||
- x + n <= 0 || x >= ctx->DrawBuffer->Width) {
+ if (y < 0 || y >= bufHeight || x + n <= 0 || x >= bufWidth) {
/* span is completely outside framebuffer */
return; /* undefined values OK */
}
@@ -1082,8 +1085,8 @@ _mesa_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y,
n -= dx;
ssrc += dx;
}
- if (x + n > ctx->DrawBuffer->Width) {
- GLint dx = x + n - ctx->DrawBuffer->Width;
+ if (x + n > bufWidth) {
+ GLint dx = x + n - bufWidth;
n -= dx;
}
if (n <= 0) {