Fixed some suspicious pointer casts that caused lots of
authorFelix Kuehling <fxkuehl@gmx.de>
Thu, 21 Apr 2005 21:50:54 +0000 (21:50 +0000)
committerFelix Kuehling <fxkuehl@gmx.de>
Thu, 21 Apr 2005 21:50:54 +0000 (21:50 +0000)
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.

src/mesa/drivers/dri/savage/savage_xmesa.c
src/mesa/drivers/dri/savage/savagecontext.h
src/mesa/drivers/dri/savage/savagespan.c
src/mesa/drivers/dri/savage/savagestate.c
src/mesa/drivers/dri/savage/savagetex.c

index 522c6275c48cc0ff2c948c2973f5007384f5d78d..c3bf710e25d9861bef018a2a0995cb5aeb06b809 100644 (file)
@@ -213,7 +213,7 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
        savageScreen->agpTextures.map = NULL;
 
    savageScreen->texVirtual[SAVAGE_CARD_HEAP] = 
-             (drmAddress)(((unsigned int)sPriv->pFB)+gDRIPriv->textureOffset);
+             (drmAddress)(((GLubyte *)sPriv->pFB)+gDRIPriv->textureOffset);
    savageScreen->texVirtual[SAVAGE_AGP_HEAP] = 
                         (drmAddress)(savageScreen->agpTextures.map);
 
@@ -364,8 +364,8 @@ savageCreateContext( const __GLcontextModes *mesaVis,
 
    for(i=0;i<5;i++)
    {
-       imesa->apertureBase[i] = ((GLuint)savageScreen->aperture.map + 
-                                 0x01000000 * i );
+       imesa->apertureBase[i] = (GLubyte *)savageScreen->aperture.map + 
+          0x01000000 * i;
    }
    
    imesa->aperturePitch = savageScreen->aperturePitch;
index 95dedc13603ce9f61820c350b8c7d990a9e193dc..4c0959968518cf9bbc6cacfe3dcd62a9b00707a6 100644 (file)
@@ -179,7 +179,7 @@ struct savage_context_t {
     struct savage_vtxbuf_t *vtxBuf;
 
     /* aperture base */
-    GLuint apertureBase[5];
+    GLubyte *apertureBase[5];
     GLuint aperturePitch;
     /* Manage hardware state */
     GLuint dirty;
@@ -236,8 +236,8 @@ struct savage_context_t {
 
     /* These refer to the current draw (front vs. back) buffer:
      */
-    char *drawMap;             /* draw buffer address in virtual mem */
-    char *readMap;     
+    GLubyte *drawMap;          /* draw buffer address in virtual mem */
+    GLubyte *readMap;  
     int drawX;                 /* origin of drawable in draw buffer */
     int drawY;
     GLuint numClipRects;               /* cliprects for that buffer */
index 8af0384b4457af3e698d05612cf049d24ec338c8..4fad537ba6202394bcfc932b2058228974af489e 100644 (file)
@@ -39,9 +39,9 @@
    GLuint cpp   = savageScreen->cpp;                   \
    GLuint pitch = imesa->aperturePitch;                        \
    GLuint height = dPriv->h;                           \
-   char *buf = (char *)(map +                          \
-                       dPriv->x * cpp +                \
-                       dPriv->y * pitch);              \
+   GLubyte *buf = map +                                        \
+                 dPriv->x * cpp +                      \
+                 dPriv->y * pitch;                     \
    GLuint p;                                           \
    (void) p
 
@@ -52,9 +52,9 @@
    GLuint zpp   = savageScreen->zpp;                   \
    GLuint pitch = imesa->aperturePitch;                        \
    GLuint height = dPriv->h;                           \
-   char *buf = (char *)(imesa->apertureBase[TARGET_DEPTH] +    \
-                       dPriv->x * zpp +                        \
-                       dPriv->y * pitch)
+   GLubyte *buf = imesa->apertureBase[TARGET_DEPTH] +  \
+                 dPriv->x * zpp +                      \
+                 dPriv->y * pitch
 
 #define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
 
 
 #define HW_WRITE_LOCK()                                        \
        savageContextPtr imesa = SAVAGE_CONTEXT(ctx);   \
-       char *map = imesa->drawMap;
+       GLubyte *map = imesa->drawMap;
 
 #define HW_READ_LOCK()                                 \
        savageContextPtr imesa = SAVAGE_CONTEXT(ctx);   \
-       char *map = imesa->readMap;
+       GLubyte *map = imesa->readMap;
 
 #define HW_CLIPLOOP()                                          \
   do {                                                         \
@@ -233,8 +233,8 @@ static void savageDDSetBuffer(GLcontext *ctx, GLframebuffer *buffer,
    assert((bufferBit == DD_FRONT_LEFT_BIT) || (bufferBit == DD_BACK_LEFT_BIT));
 
    map = (bufferBit == DD_FRONT_LEFT_BIT)
-       ? (char*)imesa->apertureBase[TARGET_FRONT]
-       : (char*)imesa->apertureBase[TARGET_BACK];
+       ? imesa->apertureBase[TARGET_FRONT]
+       : imesa->apertureBase[TARGET_BACK];
 
    imesa->drawMap = map;
    imesa->readMap = map;
index 6633c4e47647742c9621901a35c06a10d255ed82..c3df5f4f87d4b22799e5596cbf20ec3f35fac830 100644 (file)
@@ -1710,8 +1710,8 @@ void savageDDInitState( savageContextPtr imesa ) {
         imesa->regs.s4.destCtrl.ni.dstWidthInTile =
             (imesa->savageScreen->width+31)>>5;
     }
-    imesa->drawMap = (char *)imesa->apertureBase[imesa->toggle];
-    imesa->readMap = (char *)imesa->apertureBase[imesa->toggle];
+    imesa->drawMap = imesa->apertureBase[imesa->toggle];
+    imesa->readMap = imesa->apertureBase[imesa->toggle];
     imesa->NotFirstFrame = GL_FALSE;
 
     imesa->regs.s4.zBufOffset.ni.offset=imesa->savageScreen->depthOffset>>11;
index b681b0293b45be3f635845bb9d90bf780b3aa1d5..6641231371e6d3e2990d1e35be4bf9c0bb468746 100644 (file)
@@ -768,7 +768,7 @@ static void savageUploadTexImages( savageContextPtr imesa, savageTexObjPtr t )
 
       ofs = t->base.memBlock->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? */
    }