From 40f99464d8a9dab3cd80a471726f548d4fea6a41 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Fri, 7 Mar 2008 15:33:52 -0300 Subject: [PATCH] Compile warning fixes. Most are casts to unsigned long to printf %lx arguments, and removal of unused variables. Remaining warnings are due to pciaddr_t being a 64 bits integer (when compiling in ia32). --- src/savage_accel.c | 10 ---------- src/savage_cursor.c | 2 ++ src/savage_dri.c | 39 ++++++++++++++++++++------------------- src/savage_driver.c | 2 +- src/savage_exa.c | 3 +-- src/savage_video.c | 3 --- 6 files changed, 24 insertions(+), 35 deletions(-) diff --git a/src/savage_accel.c b/src/savage_accel.c index c80dfa0..0a98d10 100644 --- a/src/savage_accel.c +++ b/src/savage_accel.c @@ -1258,15 +1258,6 @@ void SavageSetGBD_2000(ScrnInfoPtr pScrn) OUTREG8(SEQ_DATA_REG,byte); } -static -void SavageRestoreAccelState(ScrnInfoPtr pScrn) -{ - SavagePtr psav = SAVPTR(pScrn); - - psav->WaitIdleEmpty(psav); - - return; -} /* Acceleration init function, sets up pointers to our accelerated functions */ @@ -1279,7 +1270,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..e07a484 100644 --- a/src/savage_cursor.c +++ b/src/savage_cursor.c @@ -73,6 +73,7 @@ static void SavageSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg); } #define MAX_CURS 64 +#if 0 /* * Disable HW Cursor on stretched LCDs. We don't know how to * detect if display is stretched. Therefore we cannot rescale @@ -94,6 +95,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 5a69509..48d014e 100644 --- a/src/savage_dri.c +++ b/src/savage_dri.c @@ -487,7 +487,8 @@ 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 +539,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 +565,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 +596,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 +648,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 +673,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 +697,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, @@ -1188,29 +1189,29 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen ) 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] agp:handle:0x%08lx\n",pSAVAGEDRIServer->agp.handle); + 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",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 +1240,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..70fa410 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -3160,7 +3160,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..59d9e7d 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; @@ -1855,7 +1854,6 @@ SavagePutImage( ){ SavagePortPrivPtr pPriv = (SavagePortPrivPtr)data; SavagePtr psav = SAVPTR(pScrn); - ScreenPtr pScreen = pScrn->pScreen; INT32 x1, x2, y1, y2; unsigned char *dst_start; int pitch, new_size, offset, offsetV=0, offsetU=0; @@ -2180,7 +2178,6 @@ SavageDisplaySurface( ){ OffscreenPrivPtr pPriv = (OffscreenPrivPtr)surface->devPrivate.ptr; ScrnInfoPtr pScrn = surface->pScrn; - ScreenPtr pScreen = pScrn->pScreen; SavagePortPrivPtr portPriv = GET_PORT_PRIVATE(pScrn); INT32 x1, y1, x2, y2; BoxRec dstBox; -- 1.5.4.3