Added a Spanish translation by David Rubio Miguélezand a Dutch
[mesa.git] / src / mesa / drivers / dri / common / stenciltmp.h
index 365e9811ac3457c78bdf84e253238d2a416fa37c..dfbe665407dbbcc215640d90507c8c318cd6ed5a 100644 (file)
@@ -41,13 +41,13 @@ static void TAG(WriteStencilSpan)( GLcontext *ctx,
 
               if (mask)
               {
-                 for (;i<n1;i++,x1++)
+                 for (;n1>0;i++,x1++,n1--)
                     if (mask[i])
                        WRITE_STENCIL( x1, y, stencil[i] );
               }
               else
               {
-                 for (;i<n1;i++,x1++)
+                 for (;n1>0;i++,x1++,n1--)
                     WRITE_STENCIL( x1, y, stencil[i] );
               }
            }
@@ -66,7 +66,7 @@ static void TAG(WriteStencilPixels)( GLcontext *ctx,
 {
    HW_WRITE_LOCK()
       {
-        GLint i;
+        GLuint i;
         LOCAL_STENCIL_VARS;
 
         if (DBG) fprintf(stderr, "WriteStencilPixels\n");
@@ -107,8 +107,8 @@ static void TAG(ReadStencilSpan)( GLcontext *ctx,
            {
               GLint i = 0;
               CLIPSPAN(x,y,n,x1,n1,i);
-              for (;i<n1;i++)
-                 READ_STENCIL( stencil[i], (x1+i), y );
+              for (;n1>0;i++,n1--)
+                 READ_STENCIL( stencil[i], (x+i), y );
            }
         HW_ENDCLIPLOOP();
       }
@@ -121,7 +121,7 @@ static void TAG(ReadStencilPixels)( GLcontext *ctx, GLuint n,
 {
    HW_READ_LOCK()
       {
-        GLint i;
+        GLuint i;
         LOCAL_STENCIL_VARS;
 
         if (DBG) fprintf(stderr, "ReadStencilPixels\n");