Commit 7e85b0a0 authored by Brian's avatar Brian

silence C++ warnings

parent 18d1fdeb
......@@ -119,7 +119,7 @@ buffer_object_subdata_range_good( GLcontext * ctx, GLenum target,
_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;
......@@ -297,7 +297,7 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
(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 );
......
......@@ -325,7 +325,8 @@ execute_shader(GLcontext *ctx, const struct ati_fragment_shader *shader,
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 };
......@@ -348,7 +349,7 @@ execute_shader(GLcontext *ctx, const struct ati_fragment_shader *shader,
/* 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)
......
......@@ -80,7 +80,10 @@ clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb)
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]);
}
}
......
......@@ -401,7 +401,7 @@ _swrast_validate_texture_images(GLcontext *ctx)
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) {
......@@ -439,7 +439,7 @@ _swrast_eject_texture_images(GLcontext *ctx)
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) {
......
......@@ -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);
......
......@@ -209,7 +209,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
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]);
}
}
......@@ -219,7 +219,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
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]);
}
}
......@@ -229,7 +229,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
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]);
}
}
......@@ -241,7 +241,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
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];
......@@ -254,7 +254,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
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];
......@@ -267,7 +267,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
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];
......@@ -281,7 +281,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
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];
}
}
......@@ -291,7 +291,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment