From 7b9fe820a3fba3849864682fbb1cb512362934ab Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Tue, 18 Sep 2001 23:06:14 +0000 Subject: [PATCH] more compiler warning fixes --- src/mesa/main/rastpos.c | 58 ++++++++++++------------ src/mesa/main/state.c | 6 +-- src/mesa/main/teximage.c | 14 +++--- src/mesa/main/texstate.c | 18 ++++---- src/mesa/math/m_eval.c | 10 ++--- src/mesa/math/m_matrix.c | 80 +++++++++++++++++----------------- src/mesa/math/m_translate.c | 8 ++-- src/mesa/swrast/s_aaline.c | 24 +++++----- src/mesa/swrast/s_aalinetemp.h | 4 +- 9 files changed, 113 insertions(+), 109 deletions(-) diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 841e539a6a9..716bef2302d 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 2e1a72469da..c1d5a0daceb 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 4206062b136..7838577db3d 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 d65c8ddfc4a..0205d30fdd9 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 ); } diff --git a/src/mesa/math/m_eval.c b/src/mesa/math/m_eval.c index ded7247b3f8..dca09b029bd 100644 --- a/src/mesa/math/m_eval.c +++ b/src/mesa/math/m_eval.c @@ -1,4 +1,4 @@ -/* $Id: m_eval.c,v 1.5 2001/03/12 00:48:41 gareth Exp $ */ +/* $Id: m_eval.c,v 1.6 2001/09/18 23:06:14 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -80,7 +80,7 @@ _math_horner_bezier_curve(const GLfloat * cp, GLfloat * out, GLfloat t, if (order >= 2) { bincoeff = (GLfloat) (order - 1); - s = 1.0 - t; + s = 1.0F - t; for (k = 0; k < dim; k++) out[k] = s * cp[k] + bincoeff * t * cp[dim + k]; @@ -134,7 +134,7 @@ _math_horner_bezier_surf(GLfloat * cn, GLfloat * out, GLfloat u, GLfloat v, /* Each control point is the point for parameter u on a */ /* curve defined by the control polygons in u-direction */ bincoeff = (GLfloat) (uorder - 1); - s = 1.0 - u; + s = 1.0F - u; for (k = 0; k < dim; k++) cp[j * dim + k] = s * ucp[k] + bincoeff * u * ucp[uinc + k]; @@ -198,7 +198,7 @@ _math_de_casteljau_surf(GLfloat * cn, GLfloat * out, GLfloat * du, GLuint uorder, GLuint vorder) { GLfloat *dcn = cn + uorder * vorder * dim; - GLfloat us = 1.0 - u, vs = 1.0 - v; + GLfloat us = 1.0F - u, vs = 1.0F - v; GLuint h, i, j, k; GLuint minorder = uorder < vorder ? uorder : vorder; GLuint uinc = vorder * dim; @@ -458,5 +458,5 @@ _math_init_eval(void) /* KW: precompute 1/x for useful x. */ for (i = 1; i < MAX_EVAL_ORDER; i++) - inv_tab[i] = 1.0 / i; + inv_tab[i] = 1.0F / i; } diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index de002adb5d2..91f26f164fd 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -1,4 +1,4 @@ -/* $Id: m_matrix.c,v 1.8 2001/03/12 00:48:41 gareth Exp $ */ +/* $Id: m_matrix.c,v 1.9 2001/09/18 23:06:14 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -242,11 +242,11 @@ static GLboolean invert_matrix_general( GLmatrix *mat ) /* last check */ if (0.0 == r3[3]) return GL_FALSE; - s = 1.0/r3[3]; /* now back substitute row 3 */ + s = 1.0F/r3[3]; /* now back substitute row 3 */ r3[4] *= s; r3[5] *= s; r3[6] *= s; r3[7] *= s; m2 = r2[3]; /* now back substitute row 2 */ - s = 1.0/r2[2]; + s = 1.0F/r2[2]; r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2), r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2); m1 = r1[3]; @@ -257,7 +257,7 @@ static GLboolean invert_matrix_general( GLmatrix *mat ) r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0; m1 = r1[2]; /* now back substitute row 1 */ - s = 1.0/r1[1]; + s = 1.0F/r1[1]; r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1), r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1); m0 = r0[2]; @@ -265,7 +265,7 @@ static GLboolean invert_matrix_general( GLmatrix *mat ) r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0; m0 = r0[1]; /* now back substitute row 0 */ - s = 1.0/r0[0]; + s = 1.0F/r0[0]; r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0), r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0); @@ -319,7 +319,7 @@ static GLboolean invert_matrix_3d_general( GLmatrix *mat ) if (det*det < 1e-25) return GL_FALSE; - det = 1.0 / det; + det = 1.0F / det; MAT(out,0,0) = ( (MAT(in,1,1)*MAT(in,2,2) - MAT(in,2,1)*MAT(in,1,2) )*det); MAT(out,0,1) = (- (MAT(in,0,1)*MAT(in,2,2) - MAT(in,2,1)*MAT(in,0,2) )*det); MAT(out,0,2) = ( (MAT(in,0,1)*MAT(in,1,2) - MAT(in,1,1)*MAT(in,0,2) )*det); @@ -362,7 +362,7 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) if (scale == 0.0) return GL_FALSE; - scale = 1.0 / scale; + scale = 1.0F / scale; /* Transpose and scale the 3 by 3 upper-left submatrix. */ MAT(out,0,0) = scale * MAT(in,0,0); @@ -433,9 +433,9 @@ static GLboolean invert_matrix_3d_no_rot( GLmatrix *mat ) return GL_FALSE; MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); - MAT(out,0,0) = 1.0 / MAT(in,0,0); - MAT(out,1,1) = 1.0 / MAT(in,1,1); - MAT(out,2,2) = 1.0 / MAT(in,2,2); + MAT(out,0,0) = 1.0F / MAT(in,0,0); + MAT(out,1,1) = 1.0F / MAT(in,1,1); + MAT(out,2,2) = 1.0F / MAT(in,2,2); if (mat->flags & MAT_FLAG_TRANSLATION) { MAT(out,0,3) = - (MAT(in,0,3) * MAT(out,0,0)); @@ -456,8 +456,8 @@ static GLboolean invert_matrix_2d_no_rot( GLmatrix *mat ) return GL_FALSE; MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); - MAT(out,0,0) = 1.0 / MAT(in,0,0); - MAT(out,1,1) = 1.0 / MAT(in,1,1); + MAT(out,0,0) = 1.0F / MAT(in,0,0); + MAT(out,1,1) = 1.0F / MAT(in,1,1); if (mat->flags & MAT_FLAG_TRANSLATION) { MAT(out,0,3) = - (MAT(in,0,3) * MAT(out,0,0)); @@ -478,8 +478,8 @@ static GLboolean invert_matrix_perspective( GLmatrix *mat ) MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); - MAT(out,0,0) = 1.0 / MAT(in,0,0); - MAT(out,1,1) = 1.0 / MAT(in,1,1); + MAT(out,0,0) = 1.0F / MAT(in,0,0); + MAT(out,1,1) = 1.0F / MAT(in,1,1); MAT(out,0,3) = MAT(in,0,2); MAT(out,1,3) = MAT(in,1,2); @@ -487,7 +487,7 @@ static GLboolean invert_matrix_perspective( GLmatrix *mat ) MAT(out,2,2) = 0; MAT(out,2,3) = -1; - MAT(out,3,2) = 1.0 / MAT(in,2,3); + MAT(out,3,2) = 1.0F / MAT(in,2,3); MAT(out,3,3) = MAT(in,2,2) * MAT(out,3,2); return GL_TRUE; @@ -538,10 +538,10 @@ _math_matrix_rotate( GLmatrix *mat, GLfloat xx, yy, zz, xy, yz, zx, xs, ys, zs, one_c; GLfloat m[16]; - s = sin( angle * DEG2RAD ); - c = cos( angle * DEG2RAD ); + s = (GLfloat) sin( angle * DEG2RAD ); + c = (GLfloat) cos( angle * DEG2RAD ); - mag = GL_SQRT( x*x + y*y + z*z ); + mag = (GLfloat) GL_SQRT( x*x + y*y + z*z ); if (mag <= 1.0e-4) { /* generate an identity matrix and return */ @@ -654,12 +654,12 @@ _math_matrix_frustum( GLmatrix *mat, GLfloat x, y, a, b, c, d; GLfloat m[16]; - x = (2.0*nearval) / (right-left); - y = (2.0*nearval) / (top-bottom); + x = (2.0F*nearval) / (right-left); + y = (2.0F*nearval) / (top-bottom); a = (right+left) / (right-left); b = (top+bottom) / (top-bottom); c = -(farval+nearval) / ( farval-nearval); - d = -(2.0*farval*nearval) / (farval-nearval); /* error? */ + d = -(2.0F*farval*nearval) / (farval-nearval); /* error? */ #define M(row,col) m[col*4+row] M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F; @@ -681,9 +681,9 @@ _math_matrix_ortho( GLmatrix *mat, GLfloat tx, ty, tz; GLfloat m[16]; - x = 2.0 / (right-left); - y = 2.0 / (top-bottom); - z = -2.0 / (farval-nearval); + x = 2.0F / (right-left); + y = 2.0F / (top-bottom); + z = -2.0F / (farval-nearval); tx = -(right+left) / (right-left); ty = -(top+bottom) / (top-bottom); tz = -(farval+nearval) / (farval-nearval); @@ -1095,20 +1095,20 @@ _math_transposed( GLdouble to[16], const GLdouble from[16] ) void _math_transposefd( GLfloat to[16], const GLdouble from[16] ) { - to[0] = from[0]; - to[1] = from[4]; - to[2] = from[8]; - to[3] = from[12]; - to[4] = from[1]; - to[5] = from[5]; - to[6] = from[9]; - to[7] = from[13]; - to[8] = from[2]; - to[9] = from[6]; - to[10] = from[10]; - to[11] = from[14]; - to[12] = from[3]; - to[13] = from[7]; - to[14] = from[11]; - to[15] = from[15]; + to[0] = (GLfloat) from[0]; + to[1] = (GLfloat) from[4]; + to[2] = (GLfloat) from[8]; + to[3] = (GLfloat) from[12]; + to[4] = (GLfloat) from[1]; + to[5] = (GLfloat) from[5]; + to[6] = (GLfloat) from[9]; + to[7] = (GLfloat) from[13]; + to[8] = (GLfloat) from[2]; + to[9] = (GLfloat) from[6]; + to[10] = (GLfloat) from[10]; + to[11] = (GLfloat) from[14]; + to[12] = (GLfloat) from[3]; + to[13] = (GLfloat) from[7]; + to[14] = (GLfloat) from[11]; + to[15] = (GLfloat) from[15]; } diff --git a/src/mesa/math/m_translate.c b/src/mesa/math/m_translate.c index d12babe5b86..349c2286ea5 100644 --- a/src/mesa/math/m_translate.c +++ b/src/mesa/math/m_translate.c @@ -1,4 +1,4 @@ -/* $Id: m_translate.c,v 1.8 2001/05/09 14:12:34 keithw Exp $ */ +/* $Id: m_translate.c,v 1.9 2001/09/18 23:06:14 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -400,12 +400,12 @@ static trans_4f_func _math_trans_4f_tab[5][MAX_TYPES]; */ #define SRC GLdouble #define SRC_IDX TYPE_IDX(GL_DOUBLE) -#define TRX_3F(f,n) PTR_ELT(f,n) -#define TRX_4F(f,n) PTR_ELT(f,n) +#define TRX_3F(f,n) (GLfloat) PTR_ELT(f,n) +#define TRX_4F(f,n) (GLfloat) PTR_ELT(f,n) #define TRX_UB(ub,f,n) UNCLAMPED_FLOAT_TO_UBYTE(ub, PTR_ELT(f,n)) #define TRX_US(us,f,n) UNCLAMPED_FLOAT_TO_USHORT(us, PTR_ELT(f,n)) #define TRX_UI(f,n) (GLuint) (GLint) PTR_ELT(f,n) -#define TRX_1F(f,n) PTR_ELT(f,n) +#define TRX_1F(f,n) (GLfloat) PTR_ELT(f,n) #define SZ 4 diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index 395ad3f9414..9e7ed8c211c 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -1,4 +1,4 @@ -/* $Id: s_aaline.c,v 1.11 2001/05/21 18:13:43 brianp Exp $ */ +/* $Id: s_aaline.c,v 1.12 2001/09/18 23:06:14 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -204,7 +204,7 @@ compute_lambda(const GLfloat sPlane[4], const GLfloat tPlane[4], if (rho2 == 0.0F) return 0.0; else - return log(rho2) * 1.442695 * 0.5; /* 1.442695 = 1/log(2) */ + return (GLfloat) (log(rho2) * 1.442695 * 0.5);/* 1.442695 = 1/log(2) */ } @@ -248,8 +248,8 @@ make_sample_table(GLint xSamples, GLint ySamples, GLfloat samples[][2]) else { j = i++; } - samples[j][0] = x * dx + 0.5 * dx; - samples[j][1] = y * dy + 0.5 * dy; + samples[j][0] = x * dx + 0.5F * dx; + samples[j][1] = y * dy + 0.5F * dy; } } } @@ -376,24 +376,24 @@ segment(GLcontext *ctx, xLeft = x0 - line->halfWidth; xRight = x1 + line->halfWidth; if (line->dy >= 0.0) { - yBot = y0 - 3.0 * line->halfWidth; + yBot = y0 - 3.0F * line->halfWidth; yTop = y0 + line->halfWidth; } else { yBot = y0 - line->halfWidth; - yTop = y0 + 3.0 * line->halfWidth; + yTop = y0 + 3.0F * line->halfWidth; } } else { xLeft = x1 - line->halfWidth; xRight = x0 + line->halfWidth; if (line->dy <= 0.0) { - yBot = y1 - 3.0 * line->halfWidth; + yBot = y1 - 3.0F * line->halfWidth; yTop = y1 + line->halfWidth; } else { yBot = y1 - line->halfWidth; - yTop = y1 + 3.0 * line->halfWidth; + yTop = y1 + 3.0F * line->halfWidth; } } @@ -422,24 +422,24 @@ segment(GLcontext *ctx, yBot = y0 - line->halfWidth; yTop = y1 + line->halfWidth; if (line->dx >= 0.0) { - xLeft = x0 - 3.0 * line->halfWidth; + xLeft = x0 - 3.0F * line->halfWidth; xRight = x0 + line->halfWidth; } else { xLeft = x0 - line->halfWidth; - xRight = x0 + 3.0 * line->halfWidth; + xRight = x0 + 3.0F * line->halfWidth; } } else { yBot = y1 - line->halfWidth; yTop = y0 + line->halfWidth; if (line->dx <= 0.0) { - xLeft = x1 - 3.0 * line->halfWidth; + xLeft = x1 - 3.0F * line->halfWidth; xRight = x1 + line->halfWidth; } else { xLeft = x1 - line->halfWidth; - xRight = x1 + 3.0 * line->halfWidth; + xRight = x1 + 3.0F * line->halfWidth; } } diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index bcfd22f019f..5808245948a 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -1,4 +1,4 @@ -/* $Id: s_aalinetemp.h,v 1.12 2001/05/21 18:13:43 brianp Exp $ */ +/* $Id: s_aalinetemp.h,v 1.13 2001/09/18 23:06:14 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -159,7 +159,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) line.y1 = v1->win[1]; line.dx = line.x1 - line.x0; line.dy = line.y1 - line.y0; - line.len = sqrt(line.dx * line.dx + line.dy * line.dy); + line.len = (GLfloat) sqrt(line.dx * line.dx + line.dy * line.dy); line.halfWidth = 0.5F * ctx->Line.Width; if (line.len == 0.0)