From b30898f4ab533085d97a33638ad0a1cf9ddb1d67 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Sat, 13 Feb 2010 17:31:58 -0700 Subject: mesa: Fix compiler warnings Add explicit casts, fix constant types, fix variable types. Fixes about 340 warnings in MSFT Visual Studio. --- src/mesa/swrast_setup/ss_context.c | 2 +- src/mesa/swrast_setup/ss_tritmp.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mesa/swrast_setup') diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index 61172f9979..23d3cb3807 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -122,7 +122,7 @@ setup_vertex_format(GLcontext *ctx) swsetup->last_index_bitset)) { DECLARE_RENDERINPUTS(index_bitset); struct tnl_attr_map map[_TNL_ATTRIB_MAX]; - int i, e = 0; + unsigned int i, e = 0; swsetup->intColors = intColors; diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index d9bf54dd46..b9b78e16b0 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -132,9 +132,9 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) saved_index[1] = v[1]->attrib[FRAG_ATTRIB_CI][0]; saved_index[2] = v[2]->attrib[FRAG_ATTRIB_CI][0]; - SS_IND(v[0]->attrib[FRAG_ATTRIB_CI][0], (GLuint) vbindex[e0]); - SS_IND(v[1]->attrib[FRAG_ATTRIB_CI][0], (GLuint) vbindex[e1]); - SS_IND(v[2]->attrib[FRAG_ATTRIB_CI][0], (GLuint) vbindex[e2]); + SS_IND(v[0]->attrib[FRAG_ATTRIB_CI][0], vbindex[e0]); + SS_IND(v[1]->attrib[FRAG_ATTRIB_CI][0], vbindex[e1]); + SS_IND(v[2]->attrib[FRAG_ATTRIB_CI][0], vbindex[e2]); } } } @@ -159,9 +159,9 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) offset += MAX2(dzdx, dzdy) * ctx->Polygon.OffsetFactor; } /* new Z values */ - oz0 = CLAMP(v[0]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0, max); - oz1 = CLAMP(v[1]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0, max); - oz2 = CLAMP(v[2]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0, max); + oz0 = CLAMP(v[0]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0F, max); + oz1 = CLAMP(v[1]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0F, max); + oz2 = CLAMP(v[2]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0F, max); } } -- cgit v1.2.3