From 9918e04cf623bf79ad8230318678a93193b3a1ab Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Sat, 15 Mar 2008 20:12:47 -0300 Subject: [PATCH] Compile warning fixes. This fixes all warnings but those about usage of deprecated libpciaccess functions and some macro values passed to pci_device_cfg_read_u32, that expects unsigned arguments, but the values default to signed integers in the definition, and probably would be too much pedantic to add an ending U to code like "define val " --- src/tdfx.h | 4 ++-- src/tdfx_dri.c | 2 +- src/tdfx_driver.c | 23 ++++++++++++----------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/tdfx.h b/src/tdfx.h index 5f09401..f6e68bd 100644 --- a/src/tdfx.h +++ b/src/tdfx.h @@ -185,8 +185,8 @@ enum tdfx_chips { typedef struct _TDFXRec { #ifdef XSERVER_LIBPCIACCESS enum tdfx_chips match_id; - void *MMIOBase[MAXCHIPS]; - void *FbBase; + unsigned char *MMIOBase[MAXCHIPS]; + unsigned char *FbBase; #else unsigned char *MMIOBase[MAXCHIPS]; unsigned char *FbBase; diff --git a/src/tdfx_dri.c b/src/tdfx_dri.c index 9548c00..0103663 100644 --- a/src/tdfx_dri.c +++ b/src/tdfx_dri.c @@ -361,7 +361,7 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen) pDRIInfo->ddxDriverMajorVersion = TDFX_MAJOR_VERSION; pDRIInfo->ddxDriverMinorVersion = TDFX_MINOR_VERSION; pDRIInfo->ddxDriverPatchVersion = TDFX_PATCHLEVEL; - pDRIInfo->frameBufferPhysicalAddress = pTDFX->LinearAddr[0]; + pDRIInfo->frameBufferPhysicalAddress = (void *)pTDFX->LinearAddr[0]; pDRIInfo->frameBufferSize = pTDFX->FbMapSize; pDRIInfo->frameBufferStride = pTDFX->stride; pDRIInfo->ddxDrawableTableEntry = TDFX_MAX_DRAWABLES; diff --git a/src/tdfx_driver.c b/src/tdfx_driver.c index 1b51124..d1ba6cd 100644 --- a/src/tdfx_driver.c +++ b/src/tdfx_driver.c @@ -738,29 +738,29 @@ TDFXInitChips(ScrnInfoPtr pScrn) "TDFXInitChips: numchips = %d\n", pTDFX->numChips); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "TDFXInitChips: cfgbits = 0x%08lx, initbits = 0x%08lx\n", - cfgbits, initbits); + (unsigned long)cfgbits, (unsigned long)initbits); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "TDFXInitChips: mem0base = 0x%08lx, mem1base = 0x%08lx\n", - mem0base, mem1base); + (unsigned long)mem0base, (unsigned long)mem1base); mem0size = 32 * 1024 * 1024; /* Registers are always 32MB */ mem1size = pScrn->videoRam * 1024 * 2; /* Linear mapping is 2x memory */ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "TDFXInitChips: mem0size = 0x%08lx, mem1size = 0x%08lx\n", - mem0size, mem1size); + (unsigned long)mem0size, (unsigned long)mem1size); mem0bits = TDFXSizeToCfg(mem0size); mem1bits = TDFXSizeToCfg(mem1size) << 4; xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "TDFXInitChips: mem0bits = 0x%08lx, mem1bits = 0x%08lx\n", - mem0bits, mem1bits); + (unsigned long)mem0bits, (unsigned long)mem1bits); cfgbits = (cfgbits & ~(0xFF)) | mem0bits | mem1bits; xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, - "TDFXInitChips: cfgbits = 0x%08lx\n", cfgbits); + "TDFXInitChips: cfgbits = 0x%08lx\n", (unsigned long)cfgbits); for (i = 0; i < pTDFX->numChips; i++) { PCI_WRITE_LONG(initbits | BIT(10), CFG_INIT_ENABLE, i); @@ -796,7 +796,7 @@ TDFXInitChips(ScrnInfoPtr pScrn) } } -void +static void TDFXPutBits(I2CBusPtr b, int scl, int sda) { TDFXPtr pTDFX= b->DriverPrivate.ptr; @@ -809,7 +809,7 @@ TDFXPutBits(I2CBusPtr b, int scl, int sda) pTDFX->writeLong(pTDFX, VIDSERIALPARALLELPORT, reg); } -void +static void TDFXGetBits(I2CBusPtr b, int *scl, int *sda) { TDFXPtr pTDFX = b->DriverPrivate.ptr; @@ -820,7 +820,7 @@ TDFXGetBits(I2CBusPtr b, int *scl, int *sda) *scl = (reg & VSP_SCL0_IN) ? 1 : 0; } -Bool TDFXI2cInit(ScrnInfoPtr pScrn) +static Bool TDFXI2cInit(ScrnInfoPtr pScrn) { TDFXPtr pTDFX = TDFXPTR(pScrn); @@ -854,7 +854,6 @@ Bool TDFXI2cInit(ScrnInfoPtr pScrn) static xf86MonPtr doTDFXDDC(ScrnInfoPtr pScrn) { TDFXPtr pTDFX = TDFXPTR(pScrn); - I2CBusPtr pI2CBus; xf86MonPtr pMon = NULL; CARD32 reg; @@ -1371,7 +1370,7 @@ TDFXMapMem(ScrnInfoPtr pScrn) pTDFX->MMIOAddr[i], TDFXIOMAPSIZE, TRUE, - & pTDFX->MMIOBase[i]); + (void *)&pTDFX->MMIOBase[i]); if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map MMIO region for card %u (%d).\n", @@ -1385,7 +1384,7 @@ TDFXMapMem(ScrnInfoPtr pScrn) pTDFX->LinearAddr[0], pTDFX->FbMapSize, TRUE, - & pTDFX->FbBase); + (void *)&pTDFX->FbBase); if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map framebuffer (%d).\n", err); @@ -1415,7 +1414,9 @@ static Bool TDFXUnmapMem(ScrnInfoPtr pScrn) { TDFXPtr pTDFX; +#ifndef XSERVER_LIBPCIACCESS int i; +#endif TDFXTRACE("TDFXUnmapMem start\n"); pTDFX = TDFXPTR(pScrn); -- 1.5.3.2