[PATCH 3/3] Janitor: ansification, compiler warnings.

Paulo Cesar Pereira de Andrade pcpa at mandriva.com.br
Fri Feb 6 14:24:28 PST 2009


  Several XAA callbacks ansified.
  Corrected some prototypes that were declared in cyrix_driver.c,
but did not match the definition in cyrix_bank.c.
  Protect remaining, compilable either way, ISA code under #if HAVE_ISA

Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
---
 src/cyrix.h        |    6 +++++
 src/cyrix_accel.c  |   59 +++++++++++++++++++--------------------------------
 src/cyrix_driver.c |   17 ++++++--------
 src/cyrix_helper.c |    1 +
 4 files changed, 36 insertions(+), 47 deletions(-)

diff --git a/src/cyrix.h b/src/cyrix.h
index 9edd1d8..a0e5fb8 100644
--- a/src/cyrix.h
+++ b/src/cyrix.h
@@ -176,6 +176,12 @@ extern void CYRIXsetBlitBuffersOnOldChip(void);
 /* externs in cyrix_accel.c */
 extern void CYRIXAccelInit(ScreenPtr);
 
+/* cyrix_bank.c */
+extern int CYRIXSetRead(ScreenPtr pScreen, int bank);
+extern int CYRIXSetWrite(ScreenPtr pScreen, int bank);
+extern int CYRIXSetReadWrite(ScreenPtr pScreen, int bank);
+
+
 /* A minor Sync() function that only waits for the graphics pipeline
    registers to be flushed so we can define a new operation */
 #define CYRIXsetupSync()            \
diff --git a/src/cyrix_accel.c b/src/cyrix_accel.c
index b76b924..11f19c1 100644
--- a/src/cyrix_accel.c
+++ b/src/cyrix_accel.c
@@ -191,10 +191,8 @@ CYRIXAccelSync(ScrnInfoPtr pScrn)
 
 /* Solid rectangles */
 void 
-CYRIXSetupForSolidFill(pScrn, color, rop, planemask)
-ScrnInfoPtr pScrn;
-int color, rop;
-unsigned int planemask;
+CYRIXSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
+		       unsigned int planemask)
 {
 	CYRIXPrvPtr	pCyrix;
 
@@ -214,9 +212,7 @@ unsigned int planemask;
     
     
 void 
-CYRIXSubsequentSolidFillRect(pScrn, x, y, w, h)
-ScrnInfoPtr pScrn;
-int x, y, w, h;
+CYRIXSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h)
 {
     CYRIXPrvPtr pCyrix = CYRIXPTR(pScrn);
 
@@ -237,13 +233,8 @@ int x, y, w, h;
 
 /* Screen to screen copies */
 void 
-CYRIXSetupForScreenToScreenCopy(pScrn, xdir, ydir, rop,
-				planemask, transparency_color)
-ScrnInfoPtr pScrn;
-int xdir, ydir;
-int rop;
-unsigned int planemask;
-int transparency_color;
+CYRIXSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop,
+				unsigned int planemask, int transparency_color)
 {
 	CYRIXPrvPtr	pCyrix;
 
@@ -292,9 +283,8 @@ int transparency_color;
 }
 
 void 
-CYRIXSubsequentScreenToScreenCopy(pScrn, x1, y1, x2, y2, w, h)
-ScrnInfoPtr pScrn;
-int x1, y1, x2, y2, w, h;
+CYRIXSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1,
+				  int x2, int y2, int w, int h)
 {
     CYRIXPrvPtr pCyrix = CYRIXPTR(pScrn);
     int up       = (pCyrix->blitMode & BM_REVERSE_Y);
@@ -343,8 +333,8 @@ int x1, y1, x2, y2, w, h;
 
 /* Bresenham lines */
 void
-CYRIXSubsequentBresenhamLine(pScrn, x1, y1, e1, e2, err, length, octant)
-ScrnInfoPtr pScrn; int x1, y1, octant, err, e1, e2, length;
+CYRIXSubsequentBresenhamLine(ScrnInfoPtr pScrn, int x1, int y1, int e1, int e2,
+			     int err, int length, int octant)
 {
     CYRIXPrvPtr pCyrix = CYRIXPTR(pScrn);
     
@@ -367,12 +357,10 @@ ScrnInfoPtr pScrn; int x1, y1, octant, err, e1, e2, length;
 
 
 /* 8x8 pattern color expand */
-void CYRIXSetupForColor8x8PatternFillRect(pScrn, patternx, patterny,
-						rop, planemask, transparency_color)
-ScrnInfoPtr pScrn;
-int patternx, patterny;
-int rop, transparency_color;
-unsigned int planemask;
+void CYRIXSetupForColor8x8PatternFillRect(ScrnInfoPtr pScrn,
+					  int patternx, int patterny,
+					  int rop, unsigned int planemask,
+					  int transparency_color)
 {
     CYRIXPrvPtr pCyrix = CYRIXPTR(pScrn);
     XAAInfoRecPtr localRecPtr = pCyrix->AccelInfoRec;
@@ -395,19 +383,17 @@ unsigned int planemask;
 		 IfDest(rop, planemask, BM_READ_DST_FB0) : BM_READ_DST_NONE);
 }
 
-void CYRIXSubsequentColor8x8PatternFillRect(pScrn, patternx, patterny, x, y, w, h)
-ScrnInfoPtr pScrn;
-int patternx, patterny;
-int x, y, w, h;
+void CYRIXSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn,
+					    int patternx, int patterny,
+					    int x, int y, int w, int h)
 {	CYRIXSubsequentSolidFillRect(pScrn, x, y, w, h);
 }
 
 
 /* CPU-to-screen color expansion */
-void CYRIXSetupForCPUToScreenColorExpandFill(pScrn, fg, bg, rop, planemask)
-ScrnInfoPtr pScrn;
-int bg, fg, rop;
-unsigned int planemask;
+void CYRIXSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
+					     int fg, int bg, int rop,
+					     unsigned int planemask)
 {
     CYRIXPrvPtr pCyrix = CYRIXPTR(pScrn);
     XAAInfoRecPtr localRecPtr = pCyrix->AccelInfoRec;
@@ -432,10 +418,9 @@ unsigned int planemask;
 	    | (trans ? IfDest(rop, planemask, BM_READ_DST_FB1) : BM_READ_DST_NONE);
 }
 
-void CYRIXSubsequentCPUToScreenColorExpandFill(pScrn, x, y, w, h, skipleft)
-ScrnInfoPtr pScrn;
-int x, y, w, h;
-int skipleft;
+void CYRIXSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
+					       int x, int y, int w, int h,
+					       int skipleft)
 {
     CYRIXPrvPtr pCyrix = CYRIXPTR(pScrn);
     CYRIXsetupSync();
diff --git a/src/cyrix_driver.c b/src/cyrix_driver.c
index 721d127..12db48d 100644
--- a/src/cyrix_driver.c
+++ b/src/cyrix_driver.c
@@ -102,7 +102,9 @@ static void	CYRIXAdjustFrame(int scrnIndex, int x, int y, int flags);
 
 /* Optional functions */
 static void	CYRIXFreeScreen(int scrnIndex, int flags);
+#if HAVE_ISA
 static int	CYRIXFindIsaDevice(GDevPtr dev);
+#endif
 static ModeStatus CYRIXValidMode(int scrnIndex, DisplayModePtr mode,
 				 Bool verbose, int flags);
 
@@ -113,11 +115,6 @@ static Bool	CYRIXModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
 static void	CYRIXRestorePalette(ScrnInfoPtr pScrn);
 static void	CYRIXSavePalette(ScrnInfoPtr pScrn);
 
-/* Misc additional routines */
-void     CYRIXSetRead(int bank);
-void     CYRIXSetWrite(int bank);
-void     CYRIXSetReadWrite(int bank);
-
 #define CYRIX_VERSION 4000
 #define CYRIX_NAME "CYRIX"
 #define CYRIX_DRIVER_NAME "cyrix"
@@ -249,7 +246,7 @@ static XF86ModuleVersionInfo cyrixVersRec =
 
 _X_EXPORT XF86ModuleData cyrixModuleData = { &cyrixVersRec, cyrixSetup, NULL };
 
-pointer
+static pointer
 cyrixSetup(pointer module, pointer opts, int *errmaj, int *errmin)
 {
     static Bool setupDone = FALSE;
@@ -410,9 +407,8 @@ CYRIXProbe(DriverPtr drv, int flags)
 	if (flags & PROBE_DETECT)
 	    foundScreen = TRUE;
 	else for (i = 0; i < numUsed; i++) {
-	    ScrnInfoPtr pScrn = NULL;
 	    /* Allocate a ScrnInfoRec and claim the slot */
-	    if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i],
+	    if ((pScrn = xf86ConfigPciEntity(NULL, 0, usedChips[i],
 						   CYRIXPCIchipsets,NULL, NULL,
 						   NULL, NULL, NULL))) {
 		pScrn->driverVersion = CYRIX_VERSION;
@@ -448,8 +444,7 @@ CYRIXProbe(DriverPtr drv, int flags)
           for (i=0; i < numUsed; i++) {
 
           /* Fill in what we can of the ScrnInfoRec */
-	        pScrn = NULL;
-	        if ((pScrn = xf86ConfigIsaEntity(pScrn, 0, usedChips[i],
+	        if ((pScrn = xf86ConfigIsaEntity(NULL, 0, usedChips[i],
 						   CYRIXISAChipsets, NULL,
 						   NULL, NULL, NULL, NULL))){
 		    pScrn->driverVersion = VERSION;
@@ -474,6 +469,7 @@ CYRIXProbe(DriverPtr drv, int flags)
     return (foundScreen);
 }
 
+#if HAVE_ISA
 static int
 CYRIXFindIsaDevice(GDevPtr dev)
 {
@@ -539,6 +535,7 @@ CYRIXFindIsaDevice(GDevPtr dev)
     outb(vgaIOBase + 5, 0x00);
     return -1;
 }
+#endif
 
 static void
 CYRIXProbeDDC(ScrnInfoPtr pScrn, int index)
diff --git a/src/cyrix_helper.c b/src/cyrix_helper.c
index d62af0e..fb56eb7 100644
--- a/src/cyrix_helper.c
+++ b/src/cyrix_helper.c
@@ -49,6 +49,7 @@
 #include "vgaHW.h"
 #include "compiler.h"
 #include "xf86.h"
+#include <unistd.h>
 
 #define CYRIXmarkLinesDirty { \
                                int k = 0; \
-- 
1.6.1

------=_20090206205844_30002--



More information about the xorg-devel mailing list