summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2006-03-10 23:43:08 +0000
committerLuc Verhaegen <libv@skynet.be>2006-03-10 23:43:08 +0000
commit9517166664c113e5363d58ce5f503202121ff8f7 (patch)
treefb4909d5cd4672352133368fd8fccc5afc1454db
parent4c0db56fc7ec8a144c704d994f5f008e684429e7 (diff)
Add -Wall, -pedantic and -g to GCCs CFLAGS. Spend a few minutes fixing all
the issues that suddenly pop up.
-rw-r--r--ChangeLog15
-rw-r--r--configure.ac4
-rw-r--r--src/aticonsole.c3
-rw-r--r--src/atidri.c41
-rw-r--r--src/atimode.c2
-rw-r--r--src/atioption.c2
-rw-r--r--src/atiprobe.c2
-rw-r--r--src/atistruct.h26
8 files changed, 57 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index 8731a76..e30e8bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2006-03-11 Luc Verhaegen <libv@skynet.be>
+
+ * configure.ac:
+ * src/aticonsole.c: (ATIProbeAndSetActiveDisplays):
+ * src/atidri.c: (ATIDRIAgpInit), (ATIDRIMapInit),
+ (ATIDRIMapBuffers), (ATIDRIIrqInit), (ATIDRIScreenInit),
+ (ATIDRIResume):
+ * src/atimode.c: (ATISetVBEMode):
+ * src/atioption.c: (ATIAvailableOptions):
+ * src/atiprobe.c: (ATIProbe):
+ * src/atistruct.h:
+
+ Add -Wall, -pedantic and -g to GCCs CFLAGS. Spend a few minutes
+ fixing all the issues that suddenly pop up.
+
2006-03-10 Luc Verhaegen <libv@skynet.be>
* Makefile.am:
diff --git a/configure.ac b/configure.ac
index dbd4ec5..f5389f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,10 @@ AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_PROG_CC
+if test "x$GCC" = "xyes"; then
+ CFLAGS="$CFLAGS -Wall -pedantic -g"
+fi
+
AH_TOP([#include "xorg-server.h"])
AC_ARG_WITH(xorg-module-dir,
diff --git a/src/aticonsole.c b/src/aticonsole.c
index 346bf44..53b1ed8 100644
--- a/src/aticonsole.c
+++ b/src/aticonsole.c
@@ -177,8 +177,7 @@ ATIProbeAndSetActiveDisplays
xf86LoaderRefSymLists(vbeSymbols, NULL);
if (xf86GetVerbosity() > 3) {
- xf86ErrorFVerb(4, "\n Before TV-Out queries\n\n",
- pScreenInfo->currentMode->name);
+ xf86ErrorFVerb(4, "\n Before TV-Out queries\n\n");
ATIPrintRegisters(pATI);
}
diff --git a/src/atidri.c b/src/atidri.c
index 2156603..d76cad9 100644
--- a/src/atidri.c
+++ b/src/atidri.c
@@ -772,8 +772,8 @@ static Bool ATIDRIAgpInit( ScreenPtr pScreen )
if (pATI->OptionBufferSize > 2) {
xf86DrvMsg( pScreen->myNum, X_WARNING, "[agp] Illegal DMA buffers size: %d MB\n",
pATI->OptionBufferSize );
- xf86DrvMsg( pScreen->myNum, X_WARNING, "[agp] Clamping DMA buffers size to 2 MB\n",
- pATI->OptionBufferSize );
+ xf86DrvMsg(pScreen->myNum, X_WARNING,
+ "[agp] Clamping DMA buffers size to 2 MB\n");
pATIDRIServer->bufferSize = 2;
} else {
pATIDRIServer->bufferSize = pATI->OptionBufferSize;
@@ -813,9 +813,8 @@ static Bool ATIDRIAgpInit( ScreenPtr pScreen )
"[agp] Could not add ring mapping\n" );
return FALSE;
}
- xf86DrvMsg( pScreen->myNum, X_INFO,
- "[agp] ring handle = 0x%08lx\n",
- pATIDRIServer->ringHandle );
+ xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] ring handle = 0x%08x\n",
+ pATIDRIServer->ringHandle);
if ( drmMap( pATI->drmFD, pATIDRIServer->ringHandle,
pATIDRIServer->ringMapSize, &pATIDRIServer->ringMap ) < 0 ) {
@@ -834,9 +833,8 @@ static Bool ATIDRIAgpInit( ScreenPtr pScreen )
"[agp] Could not add vertex buffers mapping\n" );
return FALSE;
}
- xf86DrvMsg( pScreen->myNum, X_INFO,
- "[agp] vertex buffers handle = 0x%08lx\n",
- pATIDRIServer->bufferHandle );
+ xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] vertex buffers handle = 0x%08x\n",
+ pATIDRIServer->bufferHandle );
if ( drmMap( pATI->drmFD, pATIDRIServer->bufferHandle,
pATIDRIServer->bufferMapSize, &pATIDRIServer->bufferMap ) < 0 ) {
@@ -856,7 +854,7 @@ static Bool ATIDRIAgpInit( ScreenPtr pScreen )
return FALSE;
}
xf86DrvMsg(pScreen->myNum, X_INFO,
- "[agp] AGP texture region handle = 0x%08lx\n",
+ "[agp] AGP texture region handle = 0x%08x\n",
pATIDRIServer->agpTexHandle);
if (drmMap(pATI->drmFD, pATIDRIServer->agpTexHandle, pATIDRIServer->agpTexMapSize,
@@ -924,9 +922,8 @@ static Bool ATIDRIMapInit( ScreenPtr pScreen )
"[drm] failed to map registers\n" );
return FALSE;
}
- xf86DrvMsg( pScreen->myNum, X_INFO,
- "[drm] register handle = 0x%08lx\n",
- pATIDRIServer->regsHandle );
+ xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] register handle = 0x%08x\n",
+ pATIDRIServer->regsHandle );
return TRUE;
}
@@ -1018,7 +1015,7 @@ static Bool ATIDRIMapBuffers( ScreenPtr pScreen )
return FALSE;
}
xf86DrvMsg( pScreen->myNum, X_INFO,
- "[drm] Mapped %d DMA buffers at 0x%08lx\n",
+ "[drm] Mapped %d DMA buffers at %p\n",
pATIDRIServer->drmBuffers->count,
pATIDRIServer->drmBuffers->list->address );
@@ -1058,8 +1055,7 @@ static Bool ATIDRIIrqInit( ScreenPtr pScreen )
pATI->irq);
else {
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
- "[drm] Falling back to irq-free operation\n",
- pATI->irq);
+ "[drm] Falling back to irq-free operation\n");
return FALSE;
}
}
@@ -1149,7 +1145,13 @@ Bool ATIDRIScreenInit( ScreenPtr pScreen )
pDRIInfo->ddxDriverMajorVersion = ATI_VERSION_MAJOR;
pDRIInfo->ddxDriverMinorVersion = ATI_VERSION_MINOR;
pDRIInfo->ddxDriverPatchVersion = ATI_VERSION_PATCH;
+
+#if DRIINFO_MAJOR_VERSION < 5
pDRIInfo->frameBufferPhysicalAddress = pATI->LinearBase;
+#else
+ pDRIInfo->frameBufferPhysicalAddress = (pointer) pATI->LinearBase;
+#endif
+
pDRIInfo->frameBufferSize = pATI->LinearSize;
pDRIInfo->frameBufferStride = (pScreenInfo->displayWidth *
pATI->FBBytesPerPixel);
@@ -1314,8 +1316,9 @@ Bool ATIDRIScreenInit( ScreenPtr pScreen )
if (pATI->OptionBufferSize > 2) {
xf86DrvMsg( pScreen->myNum, X_WARNING, "[pci] Illegal DMA buffers size: %d MB\n",
pATI->OptionBufferSize );
- xf86DrvMsg( pScreen->myNum, X_WARNING, "[pci] Clamping DMA buffers size to 2 MB\n",
- pATI->OptionBufferSize );
+ xf86DrvMsg(pScreen->myNum, X_WARNING,
+ "[pci] Clamping DMA buffers size to 2 MB\n");
+
pATIDRIServer->bufferSize = 2;
} else {
pATIDRIServer->bufferSize = pATI->OptionBufferSize;
@@ -1460,14 +1463,12 @@ void ATIDRIResume( ScreenPtr pScreen )
ATIPtr pATI = ATIPTR(pScreenInfo);
ATIDRIServerInfoPtr pATIDRIServer = pATI->pDRIServerInfo;
- int ret;
-
xf86DrvMsg( pScreen->myNum, X_INFO,
"[RESUME] Attempting to re-init Mach64 hardware.\n");
if (!pATIDRIServer->IsPCI) {
if (!ATIDRISetAgpMode(pScreen))
- return;
+ return;
outm( AGP_BASE, drmAgpBase(pATI->drmFD) );
}
diff --git a/src/atimode.c b/src/atimode.c
index 098659e..0db4f45 100644
--- a/src/atimode.c
+++ b/src/atimode.c
@@ -998,7 +998,7 @@ ATISetVBEMode
#endif
default:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
- "Mode not supported for TV-Out: depth: %ld HDisplay: %ld\n",
+ "Mode not supported for TV-Out: depth: %d HDisplay: %d\n",
modekey>>16, modekey & 0xffff);
return;
}
diff --git a/src/atioption.c b/src/atioption.c
index cd4311e..16cba24 100644
--- a/src/atioption.c
+++ b/src/atioption.c
@@ -238,7 +238,5 @@ ATIAvailableOptions
int BusId
)
{
- const OptionInfoRec *pOptions;
-
return ATIPublicOptions;
}
diff --git a/src/atiprobe.c b/src/atiprobe.c
index ab6f0a7..856f989 100644
--- a/src/atiprobe.c
+++ b/src/atiprobe.c
@@ -1002,7 +1002,9 @@ ATIProbe
#ifndef AVOID_CPIO
ATIPtr pVGA = NULL, p8514 = NULL;
+#ifndef AVOID_NON_PCI
ATIPtr pMach64[3] = {NULL, NULL, NULL};
+#endif
pciConfigPtr *xf86PciInfo = xf86GetPciConfigInfo();
PortPtr PCIPorts = NULL;
int nPCIPort = 0;
diff --git a/src/atistruct.h b/src/atistruct.h
index 0aa37b5..589c31e 100644
--- a/src/atistruct.h
+++ b/src/atistruct.h
@@ -430,16 +430,16 @@ typedef struct _ATIRec
/*
* Driver options.
*/
- CARD8 OptionAccel:1; /* Use hardware draw engine */
- CARD8 OptionBIOSDisplay:1; /* Allow BIOS interference */
- CARD8 OptionBlend:1; /* Force horizontal blending */
- CARD8 OptionCRTDisplay:1; /* Display on both CRT and digital panel */
- CARD8 OptionCSync:1; /* Use composite sync */
- CARD8 OptionDevel:1; /* Intentionally undocumented */
+ Bool OptionAccel; /* Use hardware draw engine */
+ Bool OptionBIOSDisplay; /* Allow BIOS interference */
+ Bool OptionBlend; /* Force horizontal blending */
+ Bool OptionCRTDisplay; /* Display on both CRT and digital panel */
+ Bool OptionCSync; /* Use composite sync */
+ Bool OptionDevel; /* Intentionally undocumented */
#ifndef AVOID_CPIO
- CARD8 OptionLinear:1; /* Use linear fb aperture when available */
+ Bool OptionLinear; /* Use linear fb aperture when available */
#endif /* AVOID_CPIO */
@@ -450,12 +450,12 @@ typedef struct _ATIRec
#endif /* TV_OUT */
- CARD8 OptionMMIOCache:1; /* Cache MMIO writes */
- CARD8 OptionTestMMIOCache:1;/* Test MMIO cache integrity */
- CARD8 OptionPanelDisplay:1; /* Prefer digital panel over CRT */
- CARD8 OptionProbeClocks:1; /* Force probe for fixed clocks */
- CARD8 OptionShadowFB:1; /* Use shadow frame buffer */
- CARD8 OptionLCDSync:1; /* Temporary */
+ Bool OptionMMIOCache; /* Cache MMIO writes */
+ Bool OptionTestMMIOCache;/* Test MMIO cache integrity */
+ Bool OptionPanelDisplay; /* Prefer digital panel over CRT */
+ Bool OptionProbeClocks; /* Force probe for fixed clocks */
+ Bool OptionShadowFB; /* Use shadow frame buffer */
+ Bool OptionLCDSync; /* Temporary */
/*
* State flags.