_mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller);
return NULL;
}
- if ((GLuint) (offset + size) > bufObj->Size) {
+ if (offset + size > bufObj->Size) {
_mesa_error(ctx, GL_INVALID_VALUE,
"%s(size + offset > buffer size)", caller);
return NULL;
(void) ctx; (void) target;
/* this should have been caught in _mesa_BufferSubData() */
- ASSERT((GLuint) (size + offset) <= bufObj->Size);
+ ASSERT(size + offset <= bufObj->Size);
if (bufObj->Data) {
_mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size );
struct atifs_instruction *inst;
struct atifs_setupinst *texinst;
GLint optype;
- GLint i, j, pass;
+ GLuint i;
+ GLint j, pass;
GLint dstreg;
GLfloat src[2][3][4];
GLfloat zeros[4] = { 0.0, 0.0, 0.0, 0.0 };
/* setup the source registers for color and alpha ops */
for (optype = 0; optype < 2; optype++) {
- for (i = 0; i < inst->ArgCount[optype]; i++) {
+ for (i = 0; i < inst->ArgCount[optype]; i++) {
GLint index = inst->SrcReg[optype][i].Index;
if (index >= GL_REG_0_ATI && index <= GL_REG_5_ATI)
else {
ASSERT(span.array->ChanType == GL_FLOAT);
for (i = 0; i < width; i++) {
- COPY_4V(span.array->rgba[i], ctx->Color.ClearColor);
+ CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][0], ctx->Color.ClearColor[0]);
+ CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][1], ctx->Color.ClearColor[1]);
+ CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][2], ctx->Color.ClearColor[2]);
+ CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][3], ctx->Color.ClearColor[3]);
}
}
GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
GLuint face;
for (face = 0; face < numFaces; face++) {
- GLuint lvl;
+ GLint lvl;
for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
struct gl_texture_image *texImg = texObj->Image[face][lvl];
if (texImg && !texImg->Data) {
GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
GLuint face;
for (face = 0; face < numFaces; face++) {
- GLuint lvl;
+ GLint lvl;
for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
struct gl_texture_image *texImg = texObj->Image[face][lvl];
if (texImg && texImg->Data) {
_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 */
}
n -= dx;
stencil += dx;
}
- if (x + n > rb->Width) {
+ if (x + n > (GLint) rb->Width) {
GLint dx = x + n - rb->Width;
n -= dx;
}
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 */
}
n -= dx;
stencil += dx;
}
- if (x + n > rb->Width) {
+ if (x + n > (GLint) rb->Width) {
GLint dx = x + n - rb->Width;
n -= dx;
}
}
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);
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
COPY_4UBV(zoomed.array->color.sz1.rgba[i], rgba[j]);
}
}
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
COPY_4V(zoomed.array->color.sz2.rgba[i], rgba[j]);
}
}
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
COPY_4V(zoomed.array->color.sz4.rgba[i], rgba[j]);
}
}
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
zoomed.array->color.sz1.rgba[i][0] = rgb[j][0];
zoomed.array->color.sz1.rgba[i][1] = rgb[j][1];
zoomed.array->color.sz1.rgba[i][2] = rgb[j][2];
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
zoomed.array->color.sz2.rgba[i][0] = rgb[j][0];
zoomed.array->color.sz2.rgba[i][1] = rgb[j][1];
zoomed.array->color.sz2.rgba[i][2] = rgb[j][2];
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
zoomed.array->color.sz4.rgba[i][0] = rgb[j][0];
zoomed.array->color.sz4.rgba[i][1] = rgb[j][1];
zoomed.array->color.sz4.rgba[i][2] = rgb[j][2];
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
zoomed.array->index[i] = indexes[j];
}
}
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
zoomed.array->z[i] = zValues[j];
}
/* Now, fall into either the RGB or COLOR_INDEX path below */