diff options
author | Karl Schultz <kschultz@freedesktop.org> | 2001-09-18 23:06:14 +0000 |
---|---|---|
committer | Karl Schultz <kschultz@freedesktop.org> | 2001-09-18 23:06:14 +0000 |
commit | 7b9fe820a3fba3849864682fbb1cb512362934ab (patch) | |
tree | 62fb4872296b4cb7ba0eae47fd47da994d01ada9 /src/mesa/main | |
parent | c98541f54bad9c706092b1eae81739f78660b000 (diff) |
more compiler warning fixes
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/rastpos.c | 58 | ||||
-rw-r--r-- | src/mesa/main/state.c | 6 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 14 | ||||
-rw-r--r-- | src/mesa/main/texstate.c | 18 |
4 files changed, 50 insertions, 46 deletions
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 841e539a6a..716bef2302 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -1,4 +1,4 @@ -/* $Id: rastpos.c,v 1.30 2001/07/28 19:28:49 keithw Exp $ */ +/* $Id: rastpos.c,v 1.31 2001/09/18 23:06:14 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -134,7 +134,7 @@ shade_rastpos(GLcontext *ctx, _mesa_validate_all_lighting_tables( ctx ); COPY_3V(diffuseColor, base[0]); - diffuseColor[3] = CLAMP( ctx->Light.Material[0].Diffuse[3], 0.0, 1.0 ); + diffuseColor[3] = CLAMP( ctx->Light.Material[0].Diffuse[3], 0.0F, 1.0F ); ASSIGN_4V(specularColor, 0.0, 0.0, 0.0, 0.0); foreach (light, &ctx->Light.EnabledList) { @@ -154,7 +154,7 @@ shade_rastpos(GLcontext *ctx, GLfloat d; SUB_3V(VP, light->_Position, vertex); - d = LEN_3FV( VP ); + d = (GLfloat) LEN_3FV( VP ); if ( d > 1e-6) { GLfloat invd = 1.0F / d; @@ -383,7 +383,7 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) void _mesa_RasterPos2d(GLdouble x, GLdouble y) { - _mesa_RasterPos4f(x, y, 0.0F, 1.0F); + _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } void @@ -395,7 +395,7 @@ _mesa_RasterPos2f(GLfloat x, GLfloat y) void _mesa_RasterPos2i(GLint x, GLint y) { - _mesa_RasterPos4f(x, y, 0.0F, 1.0F); + _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } void @@ -407,7 +407,7 @@ _mesa_RasterPos2s(GLshort x, GLshort y) void _mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) { - _mesa_RasterPos4f(x, y, z, 1.0F); + _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } void @@ -419,7 +419,7 @@ _mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) void _mesa_RasterPos3i(GLint x, GLint y, GLint z) { - _mesa_RasterPos4f(x, y, z, 1.0F); + _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } void @@ -431,7 +431,7 @@ _mesa_RasterPos3s(GLshort x, GLshort y, GLshort z) void _mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - _mesa_RasterPos4f(x, y, z, w); + _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } void @@ -444,7 +444,7 @@ _mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) void _mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w) { - _mesa_RasterPos4f(x, y, z, w); + _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } void @@ -456,7 +456,7 @@ _mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) void _mesa_RasterPos2dv(const GLdouble *v) { - _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); + _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } void @@ -468,7 +468,7 @@ _mesa_RasterPos2fv(const GLfloat *v) void _mesa_RasterPos2iv(const GLint *v) { - _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); + _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } void @@ -480,7 +480,7 @@ _mesa_RasterPos2sv(const GLshort *v) void _mesa_RasterPos3dv(const GLdouble *v) { - _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); + _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } void @@ -492,7 +492,7 @@ _mesa_RasterPos3fv(const GLfloat *v) void _mesa_RasterPos3iv(const GLint *v) { - _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); + _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } void @@ -504,7 +504,8 @@ _mesa_RasterPos3sv(const GLshort *v) void _mesa_RasterPos4dv(const GLdouble *v) { - _mesa_RasterPos4f(v[0], v[1], v[2], v[3]); + _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3]); } void @@ -516,7 +517,8 @@ _mesa_RasterPos4fv(const GLfloat *v) void _mesa_RasterPos4iv(const GLint *v) { - _mesa_RasterPos4f(v[0], v[1], v[2], v[3]); + _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3]); } void @@ -586,7 +588,7 @@ _mesa_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) void _mesa_WindowPos2dMESA(GLdouble x, GLdouble y) { - _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F); + _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } void @@ -598,7 +600,7 @@ _mesa_WindowPos2fMESA(GLfloat x, GLfloat y) void _mesa_WindowPos2iMESA(GLint x, GLint y) { - _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F); + _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } void @@ -610,7 +612,7 @@ _mesa_WindowPos2sMESA(GLshort x, GLshort y) void _mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) { - _mesa_WindowPos4fMESA(x, y, z, 1.0F); + _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } void @@ -622,7 +624,7 @@ _mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) void _mesa_WindowPos3iMESA(GLint x, GLint y, GLint z) { - _mesa_WindowPos4fMESA(x, y, z, 1.0F); + _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } void @@ -634,13 +636,13 @@ _mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z) void _mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - _mesa_WindowPos4fMESA(x, y, z, w); + _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } void _mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) { - _mesa_WindowPos4fMESA(x, y, z, w); + _mesa_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } void @@ -652,7 +654,7 @@ _mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) void _mesa_WindowPos2dvMESA(const GLdouble *v) { - _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F); + _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } void @@ -664,7 +666,7 @@ _mesa_WindowPos2fvMESA(const GLfloat *v) void _mesa_WindowPos2ivMESA(const GLint *v) { - _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F); + _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } void @@ -676,7 +678,7 @@ _mesa_WindowPos2svMESA(const GLshort *v) void _mesa_WindowPos3dvMESA(const GLdouble *v) { - _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F); + _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } void @@ -688,7 +690,7 @@ _mesa_WindowPos3fvMESA(const GLfloat *v) void _mesa_WindowPos3ivMESA(const GLint *v) { - _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F); + _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } void @@ -700,7 +702,8 @@ _mesa_WindowPos3svMESA(const GLshort *v) void _mesa_WindowPos4dvMESA(const GLdouble *v) { - _mesa_WindowPos4fMESA(v[0], v[1], v[2], v[3]); + _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3]); } void @@ -712,7 +715,8 @@ _mesa_WindowPos4fvMESA(const GLfloat *v) void _mesa_WindowPos4ivMESA(const GLint *v) { - _mesa_WindowPos4fMESA(v[0], v[1], v[2], v[3]); + _mesa_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3]); } void diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 2e1a72469d..c1d5a0dace 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -1,4 +1,4 @@ -/* $Id: state.c,v 1.68 2001/06/18 17:26:08 brianp Exp $ */ +/* $Id: state.c,v 1.69 2001/09/18 23:06:14 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -531,9 +531,9 @@ update_modelview_scale( GLcontext *ctx ) GLfloat f = m[2] * m[2] + m[6] * m[6] + m[10] * m[10]; if (f < 1e-12) f = 1.0; if (ctx->_NeedEyeCoords) - ctx->_ModelViewInvScale = 1.0/GL_SQRT(f); + ctx->_ModelViewInvScale = (GLfloat) (1.0/GL_SQRT(f)); else - ctx->_ModelViewInvScale = GL_SQRT(f); + ctx->_ModelViewInvScale = (GLfloat) GL_SQRT(f); } } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 4206062b13..7838577db3 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1,4 +1,4 @@ -/* $Id: teximage.c,v 1.103 2001/07/26 20:02:10 brianp Exp $ */ +/* $Id: teximage.c,v 1.104 2001/09/18 23:06:14 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -924,17 +924,17 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, } if (compressed) { - if (xoffset != -destTex->Border) { + if (xoffset != -((GLint)destTex->Border)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage1/2/3D(xoffset != -border"); return GL_TRUE; } - if (dimensions > 1 && yoffset != -destTex->Border) { + if (dimensions > 1 && yoffset != -((GLint)destTex->Border)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage2/3D(yoffset != -border"); return GL_TRUE; } - if (dimensions > 2 && zoffset != -destTex->Border) { + if (dimensions > 2 && zoffset != -((GLint)destTex->Border)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage3D(zoffset != -border"); return GL_TRUE; @@ -1164,17 +1164,17 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, compressed = is_compressed_format(ctx, teximage->IntFormat); if (compressed) { - if (xoffset != -teximage->Border) { + if (xoffset != -((GLint)teximage->Border)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexSubImage1/2/3D(xoffset != -border"); return GL_TRUE; } - if (dimensions > 1 && yoffset != -teximage->Border) { + if (dimensions > 1 && yoffset != -((GLint)teximage->Border)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexSubImage2/3D(yoffset != -border"); return GL_TRUE; } - if (dimensions > 2 && zoffset != -teximage->Border) { + if (dimensions > 2 && zoffset != -((GLint)teximage->Border)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexSubImage3D(zoffset != -border"); return GL_TRUE; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index d65c8ddfc4..0205d30fdd 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,4 +1,4 @@ -/* $Id: texstate.c,v 1.56 2001/08/20 16:43:02 brianp Exp $ */ +/* $Id: texstate.c,v 1.57 2001/09/18 23:06:14 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -1733,10 +1733,10 @@ void _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) { GLfloat p[4]; - p[0] = params[0]; - p[1] = params[1]; - p[2] = params[2]; - p[3] = params[3]; + p[0] = (GLfloat) params[0]; + p[1] = (GLfloat) params[1]; + p[2] = (GLfloat) params[2]; + p[3] = (GLfloat) params[3]; _mesa_TexGenfv(coord, pname, p); } @@ -1753,10 +1753,10 @@ void _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) { GLfloat p[4]; - p[0] = params[0]; - p[1] = params[1]; - p[2] = params[2]; - p[3] = params[3]; + p[0] = (GLfloat) params[0]; + p[1] = (GLfloat) params[1]; + p[2] = (GLfloat) params[2]; + p[3] = (GLfloat) params[3]; _mesa_TexGenfv( coord, pname, p ); } |