From 462183fe4cb6df6d90632d9e2cee881c8d26b1cb Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Mon, 26 Apr 2004 10:10:22 +0000 Subject: bring over build fixes from stable branch --- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 4 ++-- src/mesa/drivers/dri/tdfx/tdfx_span.c | 21 +++++++++++---------- src/mesa/drivers/dri/tdfx/tdfx_texman.c | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) (limited to 'src/mesa/drivers/dri/tdfx') diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 48cff3f02c..679c2d7560 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -118,7 +118,7 @@ static GLboolean tdfxInitDriver( __DRIscreenPrivate *sPriv ) { if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) { - fprintf( stderr, "%s( %p )\n", __FUNCTION__, sPriv ); + fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)sPriv ); } /* Check the DRI externsion version */ @@ -195,7 +195,7 @@ tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv ) GLframebuffer *mesaBuffer; if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) { - fprintf( stderr, "%s( %p )\n", __FUNCTION__, driDrawPriv ); + fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)driDrawPriv ); } mesaBuffer = (GLframebuffer *) driDrawPriv->driverPrivate; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.c b/src/mesa/drivers/dri/tdfx/tdfx_span.c index 43fcb90fd2..0d2bc811e0 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_span.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_span.c @@ -572,14 +572,6 @@ GetFbParams(tdfxContextPtr fxMesa, * * Recall that x and y are screen coordinates. */ -#define GET_FB_DATA(ReadParamsp, type, x, y) \ - (((x) < (ReadParamsp)->firstWrappedX) \ - ? (((type *)((ReadParamsp)->lfbPtr)) \ - [(y) * ((ReadParamsp)->LFBStrideInElts) \ - + (x)]) \ - : (((type *)((ReadParamsp)->lfbWrapPtr)) \ - [((y)) * ((ReadParamsp)->LFBStrideInElts) \ - + ((x) - (ReadParamsp)->firstWrappedX)])) #define GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) \ (((type *)((ReadParamsp)->lfbPtr)) \ [(y) * ((ReadParamsp)->LFBStrideInElts) \ @@ -588,12 +580,21 @@ GetFbParams(tdfxContextPtr fxMesa, (((type *)((ReadParamsp)->lfbWrapPtr)) \ [((y)) * ((ReadParamsp)->LFBStrideInElts) \ + ((x) - (ReadParamsp)->firstWrappedX)]) -#define PUT_FB_DATA(ReadParamsp, type, x, y, value) \ - (GET_FB_DATA(ReadParamsp, type, x, y) = (type)(value)) +#define GET_FB_DATA(ReadParamsp, type, x, y) \ + (((x) < (ReadParamsp)->firstWrappedX) \ + ? GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) \ + : GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y)) #define PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value) \ (GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) = (type)(value)) #define PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value) \ (GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y) = (type)(value)) +#define PUT_FB_DATA(ReadParamsp, type, x, y, value) \ + do { \ + if ((x) < (ReadParamsp)->firstWrappedX) \ + PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value); \ + else \ + PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value); \ + } while (0) static void tdfxDDWriteDepthSpan(GLcontext * ctx, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texman.c b/src/mesa/drivers/dri/tdfx/tdfx_texman.c index 9bfd5de5f9..6f303aee66 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_texman.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_texman.c @@ -880,7 +880,7 @@ tdfxTMMoveOutTM_NoLock( tdfxContextPtr fxMesa, struct gl_texture_object *tObj ) tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj); if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: %s(%p (%d))\n", __FUNCTION__, tObj, tObj->Name); + fprintf(stderr, "fxmesa: %s(%p (%d))\n", __FUNCTION__, (void *)tObj, tObj->Name); } /* -- cgit v1.2.3