From 294ff80f8d3337046015299743f805c32e7b8711 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Fri, 7 Mar 2008 14:28:10 -0300 Subject: [PATCH] Compile warning fixes. Cast void * to unsigned char * to avoid warnings about void pointer used in math for address calculation. Only remaining warning is about miPointerAbsoluteCursor being deprecated. --- src/sis300_accel.c | 2 +- src/sis310_accel.c | 10 ++++++---- src/sis6326_video.c | 4 ++-- src/sis_accel.c | 2 +- src/sis_accel.h | 4 ++-- src/sis_dri.c | 4 ++-- src/sis_driver.c | 6 ++++-- src/sis_setup.c | 6 +++++- src/sis_shadow.c | 10 +++++----- src/sis_video.c | 8 ++++---- 10 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/sis300_accel.c b/src/sis300_accel.c index c28c207..81fe952 100644 --- a/src/sis300_accel.c +++ b/src/sis300_accel.c @@ -1315,7 +1315,7 @@ SiS300AccelInit(ScreenPtr pScreen) usableFbSize = topFB - reservedFbSize; - AvailBufBase = pSiS->FbBase + usableFbSize; + AvailBufBase = (Uchar *)pSiS->FbBase + usableFbSize; for(i = 0; i < pSiS->ColorExpandBufferNumber; i++) { pSiS->ColorExpandBufferAddr[i] = AvailBufBase + i * pSiS->PerColorExpandBufferSize; diff --git a/src/sis310_accel.c b/src/sis310_accel.c index 2406e09..703bfd9 100644 --- a/src/sis310_accel.c +++ b/src/sis310_accel.c @@ -856,8 +856,9 @@ SiSSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patternx, int patterny, { SISPtr pSiS = SISPTR(pScrn); int j = pScrn->bitsPerPixel >> 3; - CARD32 *patadr = (CARD32 *)(pSiS->FbBase + (patterny * pSiS->scrnOffset) + - (patternx * j)); + CARD32 *patadr = (CARD32 *)((Uchar *)pSiS->FbBase + + (patterny * pSiS->scrnOffset) + + (patternx * j)); SiSSetupDSTColorDepth(pSiS->SiS310_AccelDepth); SiSCheckQueue(16 * 3); @@ -1482,7 +1483,8 @@ SiSSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, /* Don't need source for clear and dest */ if(!docopy) return TRUE; - dstPtr = (CARD32*)(pSiS->FbBase + (pSiS->AccelLinearScratch->offset << sbppshift)); + dstPtr = (CARD32*)((Uchar *)pSiS->FbBase + + (pSiS->AccelLinearScratch->offset << sbppshift)); if(pSiS->alphaBlitBusy) { pSiS->alphaBlitBusy = FALSE; @@ -1624,7 +1626,7 @@ SiSSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, /* Don't need source for clear and dest */ if(!docopy) return TRUE; - dst = (CARD8*)(pSiS->FbBase + (pSiS->AccelLinearScratch->offset << sbppshift)); + dst = (CARD8*)pSiS->FbBase + (pSiS->AccelLinearScratch->offset << sbppshift); if(pSiS->alphaBlitBusy) { pSiS->alphaBlitBusy = FALSE; diff --git a/src/sis6326_video.c b/src/sis6326_video.c index b015303..423ab89 100644 --- a/src/sis6326_video.c +++ b/src/sis6326_video.c @@ -1310,9 +1310,9 @@ SIS6326PutImage( /* copy data */ if((pSiS->XvUseMemcpy) || (totalSize < 16)) { - SiSMemCopyToVideoRam(pSiS, pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf], buf, totalSize); + SiSMemCopyToVideoRam(pSiS, (Uchar *)pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf], buf, totalSize); } else { - dest = (CARD32 *)(pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf]); + dest = (CARD32 *)((Uchar *)pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf]); src = (CARD32 *)buf; for(i = 0; i < (totalSize/16); i++) { *dest++ = *src++; diff --git a/src/sis_accel.c b/src/sis_accel.c index ee2c896..102c419 100644 --- a/src/sis_accel.c +++ b/src/sis_accel.c @@ -830,7 +830,7 @@ SiSAccelInit(ScreenPtr pScreen) usableFbSize = topFB - reservedFbSize; if(pSiS->ColorExpandBufferNumber) { - AvailBufBase = pSiS->FbBase + usableFbSize; + AvailBufBase = (Uchar *)pSiS->FbBase + usableFbSize; for(i = 0; i < pSiS->ColorExpandBufferNumber; i++) { pSiS->ColorExpandBufferAddr[i] = AvailBufBase + i * pSiS->PerColorExpandBufferSize; diff --git a/src/sis_accel.h b/src/sis_accel.h index 1ec72be..17e41a0 100644 --- a/src/sis_accel.h +++ b/src/sis_accel.h @@ -108,10 +108,10 @@ const int sisReg32MMIO[] = { } #define sisSETPATREG() \ - ((UChar *)(pSiS->IOBase + BR(11))) + ((UChar *)pSiS->IOBase + BR(11)) #define sisSETPATREGL() \ - ((ULong *)(pSiS->IOBase + BR(11))) + ((ULong *)((Uchar *)pSiS->IOBase + BR(11))) /* trigger command */ #define sisSETCMD(op) \ diff --git a/src/sis_dri.c b/src/sis_dri.c index ec8a808..1fde3c4 100644 --- a/src/sis_dri.c +++ b/src/sis_dri.c @@ -741,7 +741,7 @@ SISDRIFinishScreenInit(ScreenPtr pScreen) /* frame control */ saPriv->FrameCount = 0; - *(CARD32 *)(pSiS->IOBase+0x8a2c) = 0; + *(CARD32 *)((Uchar *)pSiS->IOBase+0x8a2c) = 0; SiSIdle break; } @@ -864,7 +864,7 @@ SISDRISwapContext(ScreenPtr pScreen, DRISyncType syncType, #endif case SIS_300_VGA: *((unsigned char *)pSiS->IOBase + 0x8B50) = 0xff; - *(CARD32 *)(pSiS->IOBase + 0x8B60) = 0xffffffff; + *(CARD32 *)((Uchar *)pSiS->IOBase + 0x8B60) = 0xffffffff; break; } } diff --git a/src/sis_driver.c b/src/sis_driver.c index 6667185..942f755 100644 --- a/src/sis_driver.c +++ b/src/sis_driver.c @@ -7249,7 +7249,9 @@ static Bool SISMapMem(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); +#ifndef XSERVER_LIBPCIACCESS int mmioFlags = VIDMEM_MMIO; +#endif #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif @@ -7395,7 +7397,7 @@ SISMapMem(ScrnInfoPtr pScrn) } pSiS->FbBase = pSiS->RealFbBase = pSiSEnt->FbBase; /* Adapt FbBase (for DHM and SiS76x UMA skipping; dhmOffset is 0 otherwise) */ - pSiS->FbBase += pSiS->dhmOffset; + pSiS->FbBase = (Uchar *)pSiS->FbBase + pSiS->dhmOffset; } else { #endif @@ -7419,7 +7421,7 @@ SISMapMem(ScrnInfoPtr pScrn) } pSiS->RealFbBase = pSiS->FbBase; #endif - pSiS->FbBase += pSiS->dhmOffset; + pSiS->FbBase = (Uchar *)pSiS->FbBase + pSiS->dhmOffset; #ifdef SISDUALHEAD } diff --git a/src/sis_setup.c b/src/sis_setup.c index c84a38d..834e310 100644 --- a/src/sis_setup.c +++ b/src/sis_setup.c @@ -48,6 +48,10 @@ extern int SiSMclk(SISPtr pSiS); +#ifdef XSERVER_LIBPCIACCESS +static struct pci_device *sis_get_device (int device); +#endif + static const char *dramTypeStr[] = { "Fast Page DRAM", "2 cycle EDO RAM", @@ -100,7 +104,7 @@ static const struct _sis6326mclk { }; #ifdef XSERVER_LIBPCIACCESS -struct pci_device * +static struct pci_device * sis_get_device (int device) { struct pci_slot_match bridge_match = { diff --git a/src/sis_shadow.c b/src/sis_shadow.c index 1adc938..efd3471 100644 --- a/src/sis_shadow.c +++ b/src/sis_shadow.c @@ -93,7 +93,7 @@ SISRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) width = (pbox->x2 - pbox->x1) * Bpp; height = pbox->y2 - pbox->y1; src = pSiS->ShadowPtr + (pbox->y1 * pSiS->ShadowPitch) + (pbox->x1 * Bpp); - dst = pSiS->FbBase + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp); + dst = (Uchar *)pSiS->FbBase + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp); while(height--) { SiSMemCopyToVideoRam(pSiS, dst, src, width); @@ -230,10 +230,10 @@ SISRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox) height = (y2 - y1) >> 2; /* in dwords */ if(pSiS->Rotate == 1) { - dstPtr = pSiS->FbBase + (pbox->x1 * dstPitch) + pScrn->virtualX - y2; + dstPtr = (Uchar *)pSiS->FbBase + (pbox->x1 * dstPitch) + pScrn->virtualX - y2; srcPtr = pSiS->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1; } else { - dstPtr = pSiS->FbBase + ((pScrn->virtualY - pbox->x2) * dstPitch) + y1; + dstPtr = (Uchar *)pSiS->FbBase + ((pScrn->virtualY - pbox->x2) * dstPitch) + y1; srcPtr = pSiS->ShadowPtr + (y1 * srcPitch) + pbox->x2 - 1; } @@ -316,10 +316,10 @@ SISRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox) height = (y2 - y1) >> 2; /* blocks of 3 dwords */ if(pSiS->Rotate == 1) { - dstPtr = pSiS->FbBase + (pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3); + dstPtr = (Uchar *)pSiS->FbBase + (pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3); srcPtr = pSiS->ShadowPtr + ((1 - y2) * srcPitch) + (pbox->x1 * 3); } else { - dstPtr = pSiS->FbBase + ((pScrn->virtualY - pbox->x2) * dstPitch) + (y1 * 3); + dstPtr = (Uchar *)pSiS->FbBase + ((pScrn->virtualY - pbox->x2) * dstPitch) + (y1 * 3); srcPtr = pSiS->ShadowPtr + (y1 * srcPitch) + (pbox->x2 * 3) - 3; } diff --git a/src/sis_video.c b/src/sis_video.c index fc1cd9d..136c53c 100644 --- a/src/sis_video.c +++ b/src/sis_video.c @@ -3630,11 +3630,11 @@ SISPutImage( /* copy data */ if((pSiS->XvUseMemcpy) || (totalSize < 16)) { - SiSMemCopyToVideoRam(pSiS, pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf], buf, totalSize); + SiSMemCopyToVideoRam(pSiS, (Uchar *)pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf], buf, totalSize); } else { ULong i; CARD32 *src = (CARD32 *)buf; - CARD32 *dest = (CARD32 *)(pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf]); + CARD32 *dest = (CARD32 *)((Uchar *)pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf]); for(i = 0; i < (totalSize/16); i++) { *dest++ = *src++; *dest++ = *src++; @@ -4273,8 +4273,8 @@ SISPutImageBlit( memset(&MyPacket, 0, sizeof(MyPacket)); - ybased = pSiS->FbBase + pPriv->bufAddr[index][pPriv->currentBuf[index]]; - uvbased = pSiS->FbBase + pPriv->bufAddr[index][pPriv->currentBuf[index]] + bytesize; + ybased = (Uchar *)pSiS->FbBase + pPriv->bufAddr[index][pPriv->currentBuf[index]]; + uvbased = (Uchar *)pSiS->FbBase + pPriv->bufAddr[index][pPriv->currentBuf[index]] + bytesize; ybases = buf; packed = 0; -- 1.5.4.3