summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/buffers.c7
-rw-r--r--src/mesa/main/buffers.h2
-rw-r--r--src/mesa/main/depthstencil.c6
-rw-r--r--src/mesa/main/fbobject.c9
-rw-r--r--src/mesa/main/framebuffer.c2
-rw-r--r--src/mesa/main/matrix.c4
-rw-r--r--src/mesa/shader/nvfragparse.c4
7 files changed, 22 insertions, 12 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 0d5d838ca0..28fbc34ff7 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -193,10 +193,10 @@ static GLbitfield
supported_buffer_bitmask(const GLcontext *ctx, GLuint framebufferID)
{
GLbitfield mask = 0x0;
- GLint i;
if (framebufferID > 0) {
/* A user-created renderbuffer */
+ GLuint i;
ASSERT(ctx->Extensions.EXT_framebuffer_object);
for (i = 0; i < ctx->Const.MaxColorAttachments; i++) {
mask |= (BUFFER_BIT_COLOR0 << i);
@@ -204,6 +204,7 @@ supported_buffer_bitmask(const GLcontext *ctx, GLuint framebufferID)
}
else {
/* A window system renderbuffer */
+ GLint i;
mask = BUFFER_BIT_FRONT_LEFT; /* always have this */
if (ctx->Visual.stereoMode) {
mask |= BUFFER_BIT_FRONT_RIGHT;
@@ -485,11 +486,11 @@ set_color_output(GLcontext *ctx, GLuint output, GLenum buffer,
* BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT).
*/
void
-_mesa_drawbuffers(GLcontext *ctx, GLsizei n, const GLenum *buffers,
+_mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
const GLbitfield *destMask)
{
GLbitfield mask[MAX_DRAW_BUFFERS];
- GLint output;
+ GLuint output;
if (!destMask) {
/* compute destMask values now */
diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h
index 77e9f81560..b61bdad433 100644
--- a/src/mesa/main/buffers.h
+++ b/src/mesa/main/buffers.h
@@ -53,7 +53,7 @@ extern void GLAPIENTRY
_mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers);
extern void
-_mesa_drawbuffers(GLcontext *ctx, GLsizei n, const GLenum *buffers,
+_mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
const GLbitfield *destMask);
extern void GLAPIENTRY
diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c
index 09524bba02..d4990bb795 100644
--- a/src/mesa/main/depthstencil.c
+++ b/src/mesa/main/depthstencil.c
@@ -48,6 +48,10 @@
static void *
nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y)
{
+ (void) ctx;
+ (void) rb;
+ (void) x;
+ (void) y;
return NULL;
}
@@ -82,6 +86,8 @@ alloc_wrapper_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
struct gl_renderbuffer *dsrb = rb->Wrapped;
GLboolean retVal;
+ (void) internalFormat;
+
ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT);
retVal = dsrb->AllocStorage(ctx, dsrb, dsrb->InternalFormat, width, height);
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 191b81c39c..d3d2f84401 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -410,6 +410,7 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
GLenum intFormat = GL_NONE;
GLuint w = 0, h = 0;
GLint i;
+ GLuint j;
assert(fb->Name != 0);
@@ -498,14 +499,14 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
}
/* Check that all DrawBuffers are present */
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- if (fb->ColorDrawBuffer[i] != GL_NONE) {
+ for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) {
+ if (fb->ColorDrawBuffer[j] != GL_NONE) {
const struct gl_renderbuffer_attachment *att
- = _mesa_get_attachment(ctx, fb, fb->ColorDrawBuffer[i]);
+ = _mesa_get_attachment(ctx, fb, fb->ColorDrawBuffer[j]);
assert(att);
if (att->Type == GL_NONE) {
fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT;
- fbo_incomplete("missing drawbuffer", i);
+ fbo_incomplete("missing drawbuffer", j);
return;
}
}
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index a6607387fe..7ce84131e6 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -141,6 +141,7 @@ struct gl_framebuffer *
_mesa_new_framebuffer(GLcontext *ctx, GLuint name)
{
struct gl_framebuffer *fb;
+ (void) ctx;
assert(name != 0);
fb = CALLOC_STRUCT(gl_framebuffer);
if (fb) {
@@ -581,6 +582,7 @@ update_color_draw_buffers(GLcontext *ctx, struct gl_framebuffer *fb)
static void
update_color_read_buffer(GLcontext *ctx, struct gl_framebuffer *fb)
{
+ (void) ctx;
if (fb->_ColorReadBufferIndex == -1) {
fb->_ColorReadBuffer = NULL; /* legal! */
}
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index ecd3732c93..5ff250a0c7 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -576,8 +576,8 @@ _mesa_set_viewport( GLcontext *ctx, GLint x, GLint y,
}
/* clamp width and height to the implementation dependent range */
- width = CLAMP(width, 1, ctx->Const.MaxViewportWidth);
- height = CLAMP(height, 1, ctx->Const.MaxViewportHeight);
+ width = CLAMP(width, 1, (GLsizei) ctx->Const.MaxViewportWidth);
+ height = CLAMP(height, 1, (GLsizei) ctx->Const.MaxViewportHeight);
ctx->Viewport.X = x;
ctx->Viewport.Width = width;
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index c359cf3560..e5a34205fb 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -248,7 +248,7 @@ MatchInstruction(const GLubyte *token)
return result;
}
}
- result.opcode = (enum prog_opcode) -1;
+ result.opcode = MAX_OPCODE; /* i.e. invalid instruction */
return result;
}
@@ -1320,7 +1320,7 @@ Parse_InstructionSequence(struct parse_state *parseState,
/* try to find matching instuction */
instMatch = MatchInstruction(token);
- if (instMatch.opcode < 0) {
+ if (instMatch.opcode >= MAX_OPCODE) {
/* bad instruction name */
RETURN_ERROR2("Unexpected token: ", token);
}