From c7ca2195b3870c9eb20ffeff51fabfc00d83a2c0 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Fri, 21 Mar 2008 01:23:41 -0300 Subject: [PATCH] Compile warning fixes. Cast printf format arguments and remove unused variables. Remaining warnings are about unused variable pScreen, but it is an argument to REGION macros, that may be defined as function calls instead of "inlined", and then the argument would be used. And two other warnings due to assigning pciaddr_t (an unsigned long long) to a pointer, that should only generate a warning on 32 bit architecture. --- src/savage_accel.c | 3 ++- src/savage_cursor.c | 3 ++- src/savage_dri.c | 42 +++++++++++++++++++++--------------------- src/savage_driver.c | 9 +++++---- src/savage_exa.c | 3 +-- src/savage_video.c | 1 - 6 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/savage_accel.c b/src/savage_accel.c index 450b402..616463e 100644 --- a/src/savage_accel.c +++ b/src/savage_accel.c @@ -1257,6 +1257,7 @@ void SavageSetGBD_2000(ScrnInfoPtr pScrn) OUTREG8(SEQ_DATA_REG,byte); } +#if 0 static void SavageRestoreAccelState(ScrnInfoPtr pScrn) { @@ -1266,6 +1267,7 @@ void SavageRestoreAccelState(ScrnInfoPtr pScrn) return; } +#endif /* Acceleration init function, sets up pointers to our accelerated functions */ @@ -1278,7 +1280,6 @@ SavageInitAccel(ScreenPtr pScreen) #ifdef XF86DRI if (psav->directRenderingEnabled) { SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo; - BoxRec MemBox; int cpp = pScrn->bitsPerPixel / 8; int widthBytes = psav->lDelta; int bufferSize = ((pScrn->virtualY * widthBytes + SAVAGE_BUFFER_ALIGN) diff --git a/src/savage_cursor.c b/src/savage_cursor.c index 1af2449..6196b25 100644 --- a/src/savage_cursor.c +++ b/src/savage_cursor.c @@ -78,7 +78,7 @@ static void SavageSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg); * detect if display is stretched. Therefore we cannot rescale * the HW cursor position. */ - +#if 0 static Bool SavageUseHWCursor(ScreenPtr pScr, CursorPtr pCurs) { @@ -94,6 +94,7 @@ SavageUseHWCursor(ScreenPtr pScr, CursorPtr pCurs) } return TRUE; } +#endif Bool SavageHWCursorInit(ScreenPtr pScreen) diff --git a/src/savage_dri.c b/src/savage_dri.c index 0d40222..13f498c 100644 --- a/src/savage_dri.c +++ b/src/savage_dri.c @@ -487,7 +487,7 @@ static Bool SAVAGEDRIAgpInit(ScreenPtr pScreen) } xf86DrvMsg( pScreen->myNum, X_INFO, "[agp] %d kB allocated with handle 0x%08lx\n", - pSAVAGEDRIServer->agp.size/1024, pSAVAGEDRIServer->agp.handle ); + pSAVAGEDRIServer->agp.size/1024, (unsigned long)pSAVAGEDRIServer->agp.handle ); if ( drmAgpBind( psav->drmFD, pSAVAGEDRIServer->agp.handle, 0 ) < 0 ) { xf86DrvMsg( pScreen->myNum, X_ERROR, "[agp] Could not bind memory\n" ); @@ -538,7 +538,7 @@ static Bool SAVAGEDRIAgpInit(ScreenPtr pScreen) } xf86DrvMsg( pScreen->myNum, X_INFO, "[agp] command DMA handle = 0x%08lx\n", - pSAVAGEDRIServer->cmdDma.handle ); + (unsigned long)pSAVAGEDRIServer->cmdDma.handle ); /* not needed in the server if ( drmMap( psav->drmFD, pSAVAGEDRIServer->cmdDma.handle, @@ -564,7 +564,7 @@ static Bool SAVAGEDRIAgpInit(ScreenPtr pScreen) } xf86DrvMsg( pScreen->myNum, X_INFO, "[agp] DMA buffers handle = 0x%08lx\n", - pSAVAGEDRIServer->buffers.handle ); + (unsigned long)pSAVAGEDRIServer->buffers.handle ); /* not needed in the server if ( drmMap( psav->drmFD, pSAVAGEDRIServer->buffers.handle, @@ -595,7 +595,7 @@ static Bool SAVAGEDRIAgpInit(ScreenPtr pScreen) /* pSAVAGEDRIServer->agp_offset=pSAVAGEDRIServer->agpTexture.size;*/ xf86DrvMsg( pScreen->myNum, X_INFO, "[agp] agpTextures handle = 0x%08lx\n", - pSAVAGEDRIServer->agpTextures.handle ); + (unsigned long)pSAVAGEDRIServer->agpTextures.handle ); /* not needed in the server if ( drmMap( psav->drmFD, @@ -647,7 +647,7 @@ static Bool SAVAGEDRIMapInit( ScreenPtr pScreen ) xf86DrvMsg( pScreen->myNum, X_INFO, "[drm] aperture handle = 0x%08lx\n", - pSAVAGEDRIServer->aperture.handle ); + (unsigned long)pSAVAGEDRIServer->aperture.handle ); /*if(drmMap(psav->drmFD, pSAVAGEDRIServer->registers.handle, @@ -672,7 +672,7 @@ static Bool SAVAGEDRIMapInit( ScreenPtr pScreen ) } else xf86DrvMsg( pScreen->myNum, X_INFO, "[drm] PCI command DMA handle = 0x%08lx\n", - pSAVAGEDRIServer->cmdDma.handle ); + (unsigned long)pSAVAGEDRIServer->cmdDma.handle ); } /* Enable ShadowStatus by default for direct rendering. */ @@ -696,7 +696,7 @@ static Bool SAVAGEDRIMapInit( ScreenPtr pScreen ) } xf86DrvMsg( pScreen->myNum, X_INFO, "[drm] Status handle = 0x%08lx\n", - pSAVAGEDRIServer->status.handle ); + (unsigned long)pSAVAGEDRIServer->status.handle ); if ( drmMap( psav->drmFD, pSAVAGEDRIServer->status.handle, @@ -1186,31 +1186,31 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen ) xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] textureOffset:0x%08x\n",pSAVAGEDRIServer->textureOffset); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] textureSize:0x%08x\n",pSAVAGEDRIServer->textureSize); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] textureSize:0x%08x\n",pSAVAGEDRIServer->textureSize); - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] logTextureGranularity:0x%08x\n",pSAVAGEDRIServer->logTextureGranularity); + xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] logTextureGranularity:0x%08x\n",(unsigned int)pSAVAGEDRIServer->logTextureGranularity); - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agp:handle:0x%08lx\n",pSAVAGEDRIServer->agp.handle); - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agp:offset:0x%08x\n",pSAVAGEDRIServer->agp.offset); + xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agp:handle:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->agp.handle); + xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agp:offset:0x%08x\n",(unsigned int)pSAVAGEDRIServer->agp.offset); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agp:size:0x%08x\n",pSAVAGEDRIServer->agp.size); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agp:map:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->agp.map); - - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] registers:handle:0x%08lx\n",pSAVAGEDRIServer->registers.handle); + + xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] registers:handle:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->registers.handle); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] registers:offset:0x%08x\n",pSAVAGEDRIServer->registers.offset); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] registers:size:0x%08x\n",pSAVAGEDRIServer->registers.size); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] registers:map:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->registers.map); - - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] status:handle:0x%08lx\n",pSAVAGEDRIServer->status.handle); + + xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] status:handle:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->status.handle); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] status:offset:0x%08x\n",pSAVAGEDRIServer->status.offset); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] status:size:0x%08x\n",pSAVAGEDRIServer->status.size); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] status:map:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->status.map); - - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agpTextures:handle:0x%08lx\n",pSAVAGEDRIServer->agpTextures.handle); + + xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agpTextures:handle:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->agpTextures.handle); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agpTextures:offset:0x%08x\n",pSAVAGEDRIServer->agpTextures.offset); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agpTextures:size:0x%08x\n",pSAVAGEDRIServer->agpTextures.size); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] apgTextures:map:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->agpTextures.map); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] logAgpTextureGranularity:0x%08x\n",pSAVAGEDRIServer->logAgpTextureGranularity); - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] cmdDma:handle:0x%08lx\n",pSAVAGEDRIServer->cmdDma.handle); + xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] cmdDma:handle:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->cmdDma.handle); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] cmdDma:offset:0x%08x\n",pSAVAGEDRIServer->cmdDma.offset); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] cmdDma:size:0x%08x\n",pSAVAGEDRIServer->cmdDma.size); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] cmdDma:map:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->cmdDma.map); @@ -1239,16 +1239,16 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen ) xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] textureOffset:0x%08x\n",pSAVAGEDRI->textureOffset ); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] textureSize:0x%08x\n",pSAVAGEDRI->textureSize ); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] logTextureGranularity:0x%08x\n",pSAVAGEDRI->logTextureGranularity ); - - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agpTextureHandle:0x%08lx\n",pSAVAGEDRI->agpTextureHandle ); + + xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agpTextureHandle:0x%08lx\n",(unsigned long)pSAVAGEDRI->agpTextureHandle ); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agpTextureSize:0x%08x\n",pSAVAGEDRI->agpTextureSize ); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] logAgpTextureGranularity:0x%08x\n",pSAVAGEDRI->logAgpTextureGranularity ); - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] apertureHandle:0x%08lx\n",pSAVAGEDRI->apertureHandle); + xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] apertureHandle:0x%08lx\n",(unsigned long)pSAVAGEDRI->apertureHandle); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] apertureSize:0x%08x\n",pSAVAGEDRI->apertureSize); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] aperturePitch:0x%08x\n",pSAVAGEDRI->aperturePitch); - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] statusHandle:0x%08lx\n",pSAVAGEDRI->statusHandle); + xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] statusHandle:0x%08lx\n",(unsigned long)pSAVAGEDRI->statusHandle); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] statusSize:0x%08x\n",pSAVAGEDRI->statusSize); xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] sarea_priv_offset:0x%08x\n",pSAVAGEDRI->sarea_priv_offset); diff --git a/src/savage_driver.c b/src/savage_driver.c index eb06519..1034997 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -1413,8 +1413,8 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) } if(!psav->NoAccel) { - from = X_DEFAULT; char *strptr; + from = X_DEFAULT; if((strptr = (char *)xf86GetOptValString(psav->Options, OPTION_ACCELMETHOD))) { if(!xf86NameCmp(strptr,"XAA")) { from = X_CONFIG; @@ -2280,10 +2280,11 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) const char **symNames = NULL; if (psav->useEXA) { - modName = "exa"; - symNames = exaSymbols; XF86ModReqInfo req; int errmaj, errmin; + + modName = "exa"; + symNames = exaSymbols; memset(&req, 0, sizeof(req)); req.majorversion = 2; req.minorversion = 0; @@ -3160,7 +3161,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn) } psav->ApertureMap = (psav->IsSecondary) - ? psav->ApertureRegion.memory + 0x1000000 + ? (unsigned char *)psav->ApertureRegion.memory + 0x1000000 : psav->ApertureRegion.memory; } diff --git a/src/savage_exa.c b/src/savage_exa.c index aa6905a..cbc8950 100644 --- a/src/savage_exa.c +++ b/src/savage_exa.c @@ -455,7 +455,7 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum]; SavagePtr psav = SAVPTR(pScrn); BCI_GET_PTR; - int i, j, dwords, queue, Bpp; + int dwords, queue, Bpp; unsigned int cmd; CARD32 * srcp; @@ -508,7 +508,6 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int Bool SavageDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch) { - ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum]; unsigned char *src = pSrc->devPrivate.ptr; int src_pitch = exaGetPixmapPitch(pSrc); int bpp = pSrc->drawable.bitsPerPixel; diff --git a/src/savage_video.c b/src/savage_video.c index a68c191..735605d 100644 --- a/src/savage_video.c +++ b/src/savage_video.c @@ -1184,7 +1184,6 @@ SavageCopyPlanarDataBCI( unsigned long offsetV = offsetY + srcPitch * h; unsigned long offsetU = offsetV + srcPitch2 * (h>>1); unsigned long dstOffset = (unsigned long)dst - (unsigned long)psav->FBBase; - int i; BCI_GET_PTR; -- 1.5.3.2