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] );
}
}
{
HW_WRITE_LOCK()
{
- GLint i;
+ GLuint i;
LOCAL_STENCIL_VARS;
if (DBG) fprintf(stderr, "WriteStencilPixels\n");
{
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();
}
{
HW_READ_LOCK()
{
- GLint i;
+ GLuint i;
LOCAL_STENCIL_VARS;
if (DBG) fprintf(stderr, "ReadStencilPixels\n");