Silence minor compiler warnings (-Wextra).

This commit is contained in:
Brian Paul 2006-04-05 03:05:17 +00:00
parent 027bb77e02
commit 28b014ee25
7 changed files with 22 additions and 12 deletions

View File

@ -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 */

View File

@ -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

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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! */
}

View File

@ -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;

View File

@ -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);
}