summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airliedfreedesktop.org>2004-06-07 13:26:05 +0000
committerDave Airlie <airliedfreedesktop.org>2004-06-07 13:26:05 +0000
commit1312498709d864b8d28b3179cfa7597a92f12bbe (patch)
treeff871ba39d2579d8597d8a5c28f95ef2f025eacb
parentf9b107d876327a115509e2740a75f15912176851 (diff)
fix all those warnings
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_native_vb.c38
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h51
2 files changed, 34 insertions, 55 deletions
diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vb.c b/src/mesa/drivers/dri/mach64/mach64_native_vb.c
index db7bcd3334..7872c206f5 100644
--- a/src/mesa/drivers/dri/mach64/mach64_native_vb.c
+++ b/src/mesa/drivers/dri/mach64/mach64_native_vb.c
@@ -78,18 +78,20 @@ void TAG(translate_vertex)(GLcontext *ctx,
dst->win[3] = LE32_IN_FLOAT( p++ );
case NOTEX_VERTEX_FORMAT:
- dst->specular[2] = *((GLubyte *)p)++;
- dst->specular[1] = *((GLubyte *)p)++;
- dst->specular[0] = *((GLubyte *)p)++;
- dst->fog = *((GLubyte *)p)++;
+ dst->specular[2] = ((GLubyte *)p)[0];
+ dst->specular[1] = ((GLubyte *)p)[1];
+ dst->specular[0] = ((GLubyte *)p)[2];
+ dst->fog = ((GLubyte *)p)[3];
+ p++;
case TINY_VERTEX_FORMAT:
dst->win[2] = UNVIEWPORT_Z( LE32_IN( p++ ) );
- dst->color[2] = *((GLubyte *)p)++;
- dst->color[1] = *((GLubyte *)p)++;
- dst->color[0] = *((GLubyte *)p)++;
- dst->color[3] = *((GLubyte *)p)++;
+ dst->color[2] = ((GLubyte *)p)[0];
+ dst->color[1] = ((GLubyte *)p)[1];
+ dst->color[0] = ((GLubyte *)p)[2];
+ dst->color[3] = ((GLubyte *)p)[3];
+ p++;
{
GLuint xy = LE32_IN( p );
@@ -149,11 +151,11 @@ void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v )
{
GLubyte r, g, b, a;
- b = *((GLubyte *)p)++;
- g = *((GLubyte *)p)++;
- r = *((GLubyte *)p)++;
- a = *((GLubyte *)p)++;
-
+ b = ((GLubyte *)p)[0];
+ g = ((GLubyte *)p)[1];
+ r = ((GLubyte *)p)[2];
+ a = ((GLubyte *)p)[3];
+ p++;
fprintf(stderr, "spec: r %d g %d b %d a %d\n", r, g, b, a);
}
@@ -165,11 +167,11 @@ void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v )
z = LE32_IN( p++ ) / 65536.0;
- b = *((GLubyte *)p)++;
- g = *((GLubyte *)p)++;
- r = *((GLubyte *)p)++;
- a = *((GLubyte *)p)++;
-
+ b = ((GLubyte *)p)[0];
+ g = ((GLubyte *)p)[1];
+ r = ((GLubyte *)p)[2];
+ a = ((GLubyte *)p)[3];
+ p++;
xy = LE32_IN( p );
x = (GLfloat)(GLshort)( xy >> 16 ) / 4.0;
y = (GLfloat)(GLshort)( xy & 0xffff ) / 4.0;
diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
index 623e1eae3b..f64b808ee7 100644
--- a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
+++ b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
@@ -274,14 +274,11 @@ static void TAG(emit)( GLcontext *ctx,
#endif
#if DO_RGBA
- UNCLAMPED_FLOAT_TO_UBYTE(*((GLubyte *)p), col[0][2]);
- *((GLubyte *)p)++;
- UNCLAMPED_FLOAT_TO_UBYTE(*((GLubyte *)p), col[0][1]);
- *((GLubyte *)p)++;
- UNCLAMPED_FLOAT_TO_UBYTE(*((GLubyte *)p), col[0][0]);
- *((GLubyte *)p)++;
- UNCLAMPED_FLOAT_TO_UBYTE(*((GLubyte *)p), col[0][3]);
- *((GLubyte *)p)++;
+ UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[0], col[0][2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[1], col[0][1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[2], col[0][0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[3], col[0][3]);
+ p++;
STRIDE_4F(col, col_stride);
#else
p++;
@@ -473,45 +470,25 @@ static void TAG(interp)( GLcontext *ctx,
#endif /* !DO_TEX0 */
#if DO_SPEC
- INTERP_UB( t, *(GLubyte *)dst, *(GLubyte *)out, *(GLubyte *)in ); /* VERTEX_?_SPEC_B */
- ((GLubyte *)dst)++; ((GLubyte *)out)++; ((GLubyte *)in)++;
-
- INTERP_UB( t, *(GLubyte *)dst, *(GLubyte *)out, *(GLubyte *)in ); /* VERTEX_?_SPEC_G */
- ((GLubyte *)dst)++; ((GLubyte *)out)++; ((GLubyte *)in)++;
-
- INTERP_UB( t, *(GLubyte *)dst, *(GLubyte *)out, *(GLubyte *)in ); /* VERTEX_?_SPEC_R */
-#if DO_FOG
- ((GLubyte *)dst)++; ((GLubyte *)out)++; ((GLubyte *)in)++;
-#else /* !DO_FOG */
- ((GLubyte *)dst) += 2; ((GLubyte *)out) += 2; ((GLubyte *)in) += 2;
-#endif /* !DO_FOG */
-#elif DO_FOG
- ((GLubyte *)dst) += 3; ((GLubyte *)out) += 3; ((GLubyte *)in) += 3;
+ INTERP_UB( t, ((GLubyte *)dst)[0], ((GLubyte *)out)[0], ((GLubyte *)in)[0] ); /* VERTEX_?_SPEC_B */
+ INTERP_UB( t, ((GLubyte *)dst)[1], ((GLubyte *)out)[1], ((GLubyte *)in)[1] ); /* VERTEX_?_SPEC_G */
+ INTERP_UB( t, ((GLubyte *)dst)[2], ((GLubyte *)out)[2], ((GLubyte *)in)[2] ); /* VERTEX_?_SPEC_R */
#endif
#if DO_FOG
- INTERP_UB( t, *(GLubyte *)dst, *(GLubyte *)out, *(GLubyte *)in ); /* VERTEX_?_SPEC_A */
- ((GLubyte *)dst)++; ((GLubyte *)out)++; ((GLubyte *)in)++;
+ INTERP_UB( t, ((GLubyte *)dst)[3], ((GLubyte *)out)[3], ((GLubyte *)in)[3] ); /* VERTEX_?_SPEC_A */
#endif /* DO_FOG */
-#if !DO_SPEC && !DO_FOG
dst++; out++; in++;
-#endif
LE32_OUT( dst, VIEWPORT_Z( dstclip[2] * w ) ); /* VERTEX_?_Z */
dst++; out++; in++;
- INTERP_UB( t, *(GLubyte *)dst, *(GLubyte *)out, *(GLubyte *)in ); /* VERTEX_?_B */
- ((GLubyte *)dst)++; ((GLubyte *)out)++; ((GLubyte *)in)++;
-
- INTERP_UB( t, *(GLubyte *)dst, *(GLubyte *)out, *(GLubyte *)in ); /* VERTEX_?_G */
- ((GLubyte *)dst)++; ((GLubyte *)out)++; ((GLubyte *)in)++;
-
- INTERP_UB( t, *(GLubyte *)dst, *(GLubyte *)out, *(GLubyte *)in ); /* VERTEX_?_R */
- ((GLubyte *)dst)++; ((GLubyte *)out)++; ((GLubyte *)in)++;
-
- INTERP_UB( t, *(GLubyte *)dst, *(GLubyte *)out, *(GLubyte *)in ); /* VERTEX_?_A */
- ((GLubyte *)dst)++; /* ((GLubyte *)out)++; ((GLubyte *)in)++; */
+ INTERP_UB( t, ((GLubyte *)dst)[0], ((GLubyte *)out)[0], ((GLubyte *)in)[0] ); /* VERTEX_?_B */
+ INTERP_UB( t, ((GLubyte *)dst)[1], ((GLubyte *)out)[1], ((GLubyte *)in)[1] ); /* VERTEX_?_G */
+ INTERP_UB( t, ((GLubyte *)dst)[2], ((GLubyte *)out)[2], ((GLubyte *)in)[2] ); /* VERTEX_?_R */
+ INTERP_UB( t, ((GLubyte *)dst)[3], ((GLubyte *)out)[3], ((GLubyte *)in)[3] ); /* VERTEX_?_A */
+ dst++; /*out++; in++;*/
LE32_OUT( dst,
(VIEWPORT_X( dstclip[0] * w ) << 16) | /* VERTEX_?_X */