[PATCH 2/2] Janitor: compiler warning fixes.

Paulo Cesar Pereira de Andrade pcpa at mandriva.com.br
Fri Feb 6 11:44:25 PST 2009


  The corrections to utils/*.c maybe really need the main chunk of
macros moved to AsmMacros.h. But this patch should be sufficient,
and the comment in the code self descriptive.

Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
---
 src/ct_accel.c   |    2 +-
 src/ct_driver.c  |    9 +++++----
 src/ct_regs.c    |    2 +-
 util/AsmMacros.h |   21 ++++++---------------
 util/dRegs.c     |    7 +++++++
 util/mRegs.c     |    7 +++++++
 util/modClock.c  |   13 ++++++++++---
 7 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/src/ct_accel.c b/src/ct_accel.c
index 8d049eb..614a010 100644
--- a/src/ct_accel.c
+++ b/src/ct_accel.c
@@ -444,7 +444,7 @@ chips_imagewrite:
 }
 
 #ifdef CHIPS_HIQV
-void
+static void
 CTNAME(DepthChange)(ScrnInfoPtr pScrn, int depth)
 {
     CHIPSPtr cPtr = CHIPSPTR(pScrn);
diff --git a/src/ct_driver.c b/src/ct_driver.c
index 4bc5e68..bb1fd8b 100644
--- a/src/ct_driver.c
+++ b/src/ct_driver.c
@@ -154,7 +154,9 @@ static ModeStatus CHIPSValidMode(int scrnIndex, DisplayModePtr mode,
 static Bool	CHIPSSaveScreen(ScreenPtr pScreen, int mode);
 
 /* Internally used functions */
+#ifdef HAVE_ISA
 static int      chipsFindIsaDevice(GDevPtr dev);
+#endif
 static Bool     chipsClockSelect(ScrnInfoPtr pScrn, int no);
 Bool     chipsModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
 static void     chipsSave(ScrnInfoPtr pScrn, vgaRegPtr VgaSave,
@@ -895,13 +897,12 @@ CHIPSAvailableOptions(int chipid, int busid)
 
 /* Mandatory */
 #ifdef XSERVER_LIBPCIACCESS
-Bool
+static Bool
 CHIPSPciProbe(DriverPtr drv, int entity_num, struct pci_device * dev,
 	    intptr_t match_data)
 {
     ScrnInfoPtr pScrn = NULL;
     EntityInfoPtr pEnt;
-    CHIPSPtr cPtr;
 
     /* Allocate a ScrnInfoRec and claim the slot */
     pScrn = xf86ConfigPciEntity(pScrn, 0, entity_num, CHIPSPCIchipsets, NULL,
@@ -1167,7 +1168,7 @@ chipsFindIsaDevice(GDevPtr dev)
 #endif
 
 /* Mandatory */
-Bool
+static Bool
 CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
 {
     pciVideoPtr pciPtr;
@@ -7509,7 +7510,7 @@ chipsHWCursorOff(CHIPSPtr cPtr, ScrnInfoPtr pScrn)
     }
 }
 
-void
+static void
 chipsFixResume(ScrnInfoPtr pScrn)
 {
     CHIPSPtr cPtr = CHIPSPTR(pScrn);
diff --git a/src/ct_regs.c b/src/ct_regs.c
index e9a4c20..b169ce0 100644
--- a/src/ct_regs.c
+++ b/src/ct_regs.c
@@ -112,7 +112,7 @@
 /*
  * PIO Access to the C&T extension registers
  */
-void
+static void
 chipsStdWriteXR(CHIPSPtr cPtr, CARD8 index, CARD8 value)
 {
     outb(cPtr->PIOBase + CHIPS_XR_INDEX, index);
diff --git a/util/AsmMacros.h b/util/AsmMacros.h
index 34ccc0a..70d4925 100644
--- a/util/AsmMacros.h
+++ b/util/AsmMacros.h
@@ -325,32 +325,25 @@ short port;
 #else /* GCCUSESGAS */
 
 static __inline__ void
-outb(port, val)
-     short port;
-     char val;
+outb(short port, char val)
 {
   __asm__ __volatile__("out%B0 (%1)" : :"a" (val), "d" (port));
 }
 
 static __inline__ void
-outw(port, val)
-     short port;
-     short val;
+outw(short port, short val)
 {
   __asm__ __volatile__("out%W0 (%1)" : :"a" (val), "d" (port));
 }
 
 static __inline__ void
-outl(port, val)
-     short port;
-     unsigned int val;
+outl(short port, unsigned int val)
 {
   __asm__ __volatile__("out%L0 (%1)" : :"a" (val), "d" (port));
 }
 
 static __inline__ unsigned int
-inb(port)
-     short port;
+inb(short port)
 {
   unsigned int ret;
   __asm__ __volatile__("in%B0 (%1)" :
@@ -360,8 +353,7 @@ inb(port)
 }
 
 static __inline__ unsigned int
-inw(port)
-     short port;
+inw(short port)
 {
   unsigned int ret;
   __asm__ __volatile__("in%W0 (%1)" :
@@ -371,8 +363,7 @@ inw(port)
 }
 
 static __inline__ unsigned int
-inl(port)
-     short port;
+inl(short port)
 {
   unsigned int ret;
   __asm__ __volatile__("in%L0 (%1)" :
diff --git a/util/dRegs.c b/util/dRegs.c
index b7edc8f..29fb554 100644
--- a/util/dRegs.c
+++ b/util/dRegs.c
@@ -50,6 +50,13 @@
 #    endif
 #  else
 #    ifdef linux
+#      if 0
+	/* FIXME including <sys/io.h> will also get prototypes/macros for
+	 * inb(), outb(), etc, with inverted port/value arguments order. */
+#        include <sys/io.h>
+#      else
+extern int iopl(int level);
+#      endif
 #      define SET_IOPL() iopl(3)
 #      define RESET_IOPL() iopl(0)
 #    else
diff --git a/util/mRegs.c b/util/mRegs.c
index f359738..5150bbe 100644
--- a/util/mRegs.c
+++ b/util/mRegs.c
@@ -50,6 +50,13 @@
 #    endif
 #  else
 #    ifdef linux
+#      if 0
+	/* FIXME including <sys/io.h> will also get prototypes/macros for
+	 * inb(), outb(), etc, with inverted port/value arguments order. */
+#        include <sys/io.h>
+#      else
+extern int iopl(int level);
+#      endif
 #      define SET_IOPL() iopl(3)
 #      define RESET_IOPL() iopl(0)
 #    else
diff --git a/util/modClock.c b/util/modClock.c
index 89a291a..75c6ba7 100644
--- a/util/modClock.c
+++ b/util/modClock.c
@@ -48,6 +48,13 @@
 #    endif
 #  else
 #    ifdef linux
+#      if 0
+	/* FIXME including <sys/io.h> will also get prototypes/macros for
+	 * inb(), outb(), etc, with inverted port/value arguments order. */
+#        include <sys/io.h>
+#      else
+extern int iopl(int level);
+#      endif
 #      define SET_IOPL() iopl(3)
 #      define RESET_IOPL() iopl(0)
 #    else
@@ -86,7 +93,7 @@
 #define MemClk 1
 #define IS_MemClk(X) X&0x1
 
-int compute_clock (
+static int compute_clock (
 		   unsigned int ChipType,
 		   double target,
 		   double Fref,
@@ -210,7 +217,7 @@ int compute_clock (
   return 1;
 }
 
-int set_clock(
+static int set_clock(
 	      unsigned int ChipType,
 	      unsigned int ClockType,
 	      unsigned int ProgClock,
@@ -279,7 +286,7 @@ int set_clock(
   return 0;
 }
 
-unsigned int probe_chip(void) {
+static unsigned int probe_chip(void) {
 
   unsigned int ChipType, temp;
 
-- 
1.6.1

------=_20090206181627_48787--



More information about the xorg-devel mailing list