Fixed some suspicious pointer casts that caused lots of

compile-time-warnings on x86-64. Not tested on x86-64 yet, but a good
thing in general, so I'm giving up waiting for feedback. See also
https://bugs.freedesktop.org/show_bug.cgi?id=2924.
This commit is contained in:
Felix Kuehling 2005-04-21 21:50:54 +00:00
parent 07d91bbb59
commit a7fcac5e92
5 changed files with 19 additions and 19 deletions

View File

@ -213,7 +213,7 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
savageScreen->agpTextures.map = NULL; savageScreen->agpTextures.map = NULL;
savageScreen->texVirtual[SAVAGE_CARD_HEAP] = savageScreen->texVirtual[SAVAGE_CARD_HEAP] =
(drmAddress)(((unsigned int)sPriv->pFB)+gDRIPriv->textureOffset); (drmAddress)(((GLubyte *)sPriv->pFB)+gDRIPriv->textureOffset);
savageScreen->texVirtual[SAVAGE_AGP_HEAP] = savageScreen->texVirtual[SAVAGE_AGP_HEAP] =
(drmAddress)(savageScreen->agpTextures.map); (drmAddress)(savageScreen->agpTextures.map);
@ -364,8 +364,8 @@ savageCreateContext( const __GLcontextModes *mesaVis,
for(i=0;i<5;i++) for(i=0;i<5;i++)
{ {
imesa->apertureBase[i] = ((GLuint)savageScreen->aperture.map + imesa->apertureBase[i] = (GLubyte *)savageScreen->aperture.map +
0x01000000 * i ); 0x01000000 * i;
} }
imesa->aperturePitch = savageScreen->aperturePitch; imesa->aperturePitch = savageScreen->aperturePitch;

View File

@ -179,7 +179,7 @@ struct savage_context_t {
struct savage_vtxbuf_t *vtxBuf; struct savage_vtxbuf_t *vtxBuf;
/* aperture base */ /* aperture base */
GLuint apertureBase[5]; GLubyte *apertureBase[5];
GLuint aperturePitch; GLuint aperturePitch;
/* Manage hardware state */ /* Manage hardware state */
GLuint dirty; GLuint dirty;
@ -236,8 +236,8 @@ struct savage_context_t {
/* These refer to the current draw (front vs. back) buffer: /* These refer to the current draw (front vs. back) buffer:
*/ */
char *drawMap; /* draw buffer address in virtual mem */ GLubyte *drawMap; /* draw buffer address in virtual mem */
char *readMap; GLubyte *readMap;
int drawX; /* origin of drawable in draw buffer */ int drawX; /* origin of drawable in draw buffer */
int drawY; int drawY;
GLuint numClipRects; /* cliprects for that buffer */ GLuint numClipRects; /* cliprects for that buffer */

View File

@ -39,9 +39,9 @@
GLuint cpp = savageScreen->cpp; \ GLuint cpp = savageScreen->cpp; \
GLuint pitch = imesa->aperturePitch; \ GLuint pitch = imesa->aperturePitch; \
GLuint height = dPriv->h; \ GLuint height = dPriv->h; \
char *buf = (char *)(map + \ GLubyte *buf = map + \
dPriv->x * cpp + \ dPriv->x * cpp + \
dPriv->y * pitch); \ dPriv->y * pitch; \
GLuint p; \ GLuint p; \
(void) p (void) p
@ -52,9 +52,9 @@
GLuint zpp = savageScreen->zpp; \ GLuint zpp = savageScreen->zpp; \
GLuint pitch = imesa->aperturePitch; \ GLuint pitch = imesa->aperturePitch; \
GLuint height = dPriv->h; \ GLuint height = dPriv->h; \
char *buf = (char *)(imesa->apertureBase[TARGET_DEPTH] + \ GLubyte *buf = imesa->apertureBase[TARGET_DEPTH] + \
dPriv->x * zpp + \ dPriv->x * zpp + \
dPriv->y * pitch) dPriv->y * pitch
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS #define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
@ -80,11 +80,11 @@
#define HW_WRITE_LOCK() \ #define HW_WRITE_LOCK() \
savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \ savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
char *map = imesa->drawMap; GLubyte *map = imesa->drawMap;
#define HW_READ_LOCK() \ #define HW_READ_LOCK() \
savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \ savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
char *map = imesa->readMap; GLubyte *map = imesa->readMap;
#define HW_CLIPLOOP() \ #define HW_CLIPLOOP() \
do { \ do { \
@ -233,8 +233,8 @@ static void savageDDSetBuffer(GLcontext *ctx, GLframebuffer *buffer,
assert((bufferBit == DD_FRONT_LEFT_BIT) || (bufferBit == DD_BACK_LEFT_BIT)); assert((bufferBit == DD_FRONT_LEFT_BIT) || (bufferBit == DD_BACK_LEFT_BIT));
map = (bufferBit == DD_FRONT_LEFT_BIT) map = (bufferBit == DD_FRONT_LEFT_BIT)
? (char*)imesa->apertureBase[TARGET_FRONT] ? imesa->apertureBase[TARGET_FRONT]
: (char*)imesa->apertureBase[TARGET_BACK]; : imesa->apertureBase[TARGET_BACK];
imesa->drawMap = map; imesa->drawMap = map;
imesa->readMap = map; imesa->readMap = map;

View File

@ -1710,8 +1710,8 @@ void savageDDInitState( savageContextPtr imesa ) {
imesa->regs.s4.destCtrl.ni.dstWidthInTile = imesa->regs.s4.destCtrl.ni.dstWidthInTile =
(imesa->savageScreen->width+31)>>5; (imesa->savageScreen->width+31)>>5;
} }
imesa->drawMap = (char *)imesa->apertureBase[imesa->toggle]; imesa->drawMap = imesa->apertureBase[imesa->toggle];
imesa->readMap = (char *)imesa->apertureBase[imesa->toggle]; imesa->readMap = imesa->apertureBase[imesa->toggle];
imesa->NotFirstFrame = GL_FALSE; imesa->NotFirstFrame = GL_FALSE;
imesa->regs.s4.zBufOffset.ni.offset=imesa->savageScreen->depthOffset>>11; imesa->regs.s4.zBufOffset.ni.offset=imesa->savageScreen->depthOffset>>11;

View File

@ -768,7 +768,7 @@ static void savageUploadTexImages( savageContextPtr imesa, savageTexObjPtr t )
ofs = t->base.memBlock->ofs; ofs = t->base.memBlock->ofs;
t->setup.physAddr = imesa->savageScreen->textureOffset[heap] + ofs; t->setup.physAddr = imesa->savageScreen->textureOffset[heap] + ofs;
t->bufAddr = (char *)((GLuint) imesa->savageScreen->texVirtual[heap] + ofs); t->bufAddr = (GLubyte *)imesa->savageScreen->texVirtual[heap] + ofs;
imesa->dirty |= SAVAGE_UPLOAD_GLOBAL; /* FIXME: really needed? */ imesa->dirty |= SAVAGE_UPLOAD_GLOBAL; /* FIXME: really needed? */
} }