From 025aa9efcd8213ce530818cfd8be1b6d9e945b2c Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Thu, 2 Dec 2004 14:50:13 +0000 Subject: [PATCH] silence warnings --- src/mesa/drivers/dri/r200/r200_tcl.c | 21 +++++++++++++-------- src/mesa/drivers/dri/radeon/radeon_swtcl.c | 7 +++++-- src/mesa/drivers/dri/radeon/radeon_tcl.c | 13 +++++++++---- src/mesa/drivers/x11/xm_tri.c | 4 ---- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index 122bcb9b787..e4f6caa472d 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -177,11 +177,11 @@ while (0) * discrete and there are no intervening state changes. (Somewhat * duplicates changes to DrawArrays code) */ -static void EMIT_PRIM( GLcontext *ctx, - GLenum prim, - GLuint hwprim, - GLuint start, - GLuint count) +static void r200EmitPrim( GLcontext *ctx, + GLenum prim, + GLuint hwprim, + GLuint start, + GLuint count) { r200ContextPtr rmesa = R200_CONTEXT( ctx ); r200TclPrimitive( ctx, prim, hwprim ); @@ -201,7 +201,9 @@ static void EMIT_PRIM( GLcontext *ctx, count - start ); } - +#define EMIT_PRIM(ctx, prim, hwprim, start, count) do { \ + r200EmitPrim( ctx, prim, hwprim, start, count ); \ + (void) rmesa; } while (0) /* Try & join small primitives */ @@ -221,9 +223,12 @@ static void EMIT_PRIM( GLcontext *ctx, #define EMIT_ELT(dest, offset, x) do { \ int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \ GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \ - (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); } while (0) + (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); \ + (void)rmesa; } while (0) #else -#define EMIT_ELT(dest, offset, x) (dest)[offset] = (GLushort) (x) +#define EMIT_ELT(dest, offset, x) do { \ + (dest)[offset] = (GLushort) (x); \ + (void)rmesa; } while (0) #endif #define EMIT_TWO_ELTS(dest, offset, x, y) *(GLuint *)((dest)+offset) = ((y)<<16)|(x); diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c index e8620441945..35720fd6589 100644 --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c @@ -564,9 +564,12 @@ static void *radeon_alloc_elts( radeonContextPtr rmesa, int nr ) #define EMIT_ELT(offset, x) do { \ int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \ GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \ - (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); } while (0) + (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); \ + (void)rmesa; } while (0) #else -#define EMIT_ELT(offset, x) (dest)[offset] = (GLushort) (x) +#define EMIT_ELT(offset, x) do { \ + (dest)[offset] = (GLushort) (x); \ + (void)rmesa; } while (0) #endif #define EMIT_TWO_ELTS(offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x); #define INCR_ELTS( nr ) dest += nr diff --git a/src/mesa/drivers/dri/radeon/radeon_tcl.c b/src/mesa/drivers/dri/radeon/radeon_tcl.c index 6c121974eba..760c9a03410 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_tcl.c @@ -169,7 +169,7 @@ static GLushort *radeonAllocElts( radeonContextPtr rmesa, GLuint nr ) * discrete and there are no intervening state changes. (Somewhat * duplicates changes to DrawArrays code) */ -static void EMIT_PRIM( GLcontext *ctx, +static void radeonEmitPrim( GLcontext *ctx, GLenum prim, GLuint hwprim, GLuint start, @@ -194,7 +194,9 @@ static void EMIT_PRIM( GLcontext *ctx, count - start ); } - +#define EMIT_PRIM( ctx, prim, hwprim, start, count ) do { \ + radeonEmitPrim( ctx, prim, hwprim, start, count ); \ + (void) rmesa; } while (0) /* Try & join small primitives */ @@ -214,9 +216,12 @@ static void EMIT_PRIM( GLcontext *ctx, #define EMIT_ELT(dest, offset, x) do { \ int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \ GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \ - (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); } while (0) + (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); \ + (void)rmesa; } while (0) #else -#define EMIT_ELT(dest, offset, x) (dest)[offset] = (GLushort) (x) +#define EMIT_ELT(dest, offset, x) do { \ + (dest)[offset] = (GLushort) (x); \ + (void)rmesa; } while (0) #endif #define EMIT_TWO_ELTS(dest, offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x); diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index 01585b05b4d..35d9d071f91 100644 --- a/src/mesa/drivers/x11/xm_tri.c +++ b/src/mesa/drivers/x11/xm_tri.c @@ -1351,7 +1351,6 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) USE(smooth_DITHER8_z_triangle); else USE(smooth_DITHER_z_triangle); - break; case PF_Lookup: if (depth == 8) USE(smooth_LOOKUP8_z_triangle); @@ -1389,7 +1388,6 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) USE(flat_DITHER8_z_triangle); else USE(flat_DITHER_z_triangle); - break; case PF_Lookup: if (depth == 8) USE(flat_LOOKUP8_z_triangle); @@ -1424,7 +1422,6 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) USE(smooth_DITHER8_triangle); else USE(smooth_DITHER_triangle); - break; case PF_Lookup: if (depth == 8) USE(smooth_LOOKUP8_triangle); @@ -1460,7 +1457,6 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) USE(flat_DITHER8_triangle); else USE(flat_DITHER_triangle); - break; case PF_Lookup: if (depth == 8) USE(flat_LOOKUP8_triangle); -- 2.30.2