summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/clear.c
diff options
context:
space:
mode:
authorKarl Schultz <[email protected]>2010-02-13 17:31:58 -0700
committerKarl Schultz <[email protected]>2010-02-13 17:34:04 -0700
commitb30898f4ab533085d97a33638ad0a1cf9ddb1d67 (patch)
tree7c27558e2905da625b75060628967d3d52fe6728 /src/mesa/main/clear.c
parent5fd2b46a20321d8600d6256bff17ec3ebc9cb510 (diff)
mesa: Fix compiler warnings
Add explicit casts, fix constant types, fix variable types. Fixes about 340 warnings in MSFT Visual Studio.
Diffstat (limited to 'src/mesa/main/clear.c')
-rw-r--r--src/mesa/main/clear.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index 4a3c1116586..8085bedf1c1 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -236,7 +236,7 @@ make_color_buffer_mask(GLcontext *ctx, GLint drawbuffer)
mask |= BUFFER_BIT_BACK_RIGHT;
break;
default:
- if (drawbuffer < 0 || drawbuffer >= ctx->Const.MaxDrawBuffers) {
+ if (drawbuffer < 0 || drawbuffer >= (GLint)ctx->Const.MaxDrawBuffers) {
mask = INVALID_MASK;
}
else if (att[BUFFER_COLOR0 + drawbuffer].Renderbuffer) {
@@ -306,11 +306,11 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
* floating point state var. This will not always work. We'll
* need a new ctx->Driver.ClearBuffer() hook....
*/
- GLfloat clearSave[4];
+ GLclampf clearSave[4];
/* save color */
COPY_4V(clearSave, ctx->Color.ClearColor);
/* set color */
- COPY_4V(ctx->Color.ClearColor, value);
+ COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
if (ctx->Driver.ClearColor)
ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
/* clear buffer(s) */
@@ -365,11 +365,11 @@ _mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
* floating point state var. This will not always work. We'll
* need a new ctx->Driver.ClearBuffer() hook....
*/
- GLfloat clearSave[4];
+ GLclampf clearSave[4];
/* save color */
COPY_4V(clearSave, ctx->Color.ClearColor);
/* set color */
- COPY_4V(ctx->Color.ClearColor, value);
+ COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
if (ctx->Driver.ClearColor)
ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
/* clear buffer(s) */
@@ -423,7 +423,7 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
* XXX in the future we may have a new ctx->Driver.ClearBuffer()
* hook instead.
*/
- const GLfloat clearSave = ctx->Depth.Clear;
+ const GLclampd clearSave = ctx->Depth.Clear;
ctx->Depth.Clear = *value;
if (ctx->Driver.ClearDepth)
ctx->Driver.ClearDepth(ctx, *value);
@@ -443,11 +443,11 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
return;
}
else if (mask) {
- GLfloat clearSave[4];
+ GLclampf clearSave[4];
/* save color */
COPY_4V(clearSave, ctx->Color.ClearColor);
/* set color */
- COPY_4V(ctx->Color.ClearColor, value);
+ COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
if (ctx->Driver.ClearColor)
ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
/* clear buffer(s) */
@@ -503,7 +503,7 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
{
/* save current clear values */
- const GLfloat clearDepthSave = ctx->Depth.Clear;
+ const GLclampd clearDepthSave = ctx->Depth.Clear;
const GLuint clearStencilSave = ctx->Stencil.Clear;
/* set new clear values */