[PATCH 3/3] Fix compiler warnings in hw/xfree86/os-support/solaris

Alan Coopersmith alan.coopersmith at oracle.com
Mon Nov 29 20:22:19 PST 2010


sun_init.c: In function `xf86OpenConsole':
sun_init.c:99: warning: cast does not match function type
sun_init.c:74: warning: unused variable `FreeVTslot'
sun_init.c: In function `xf86UseMsg':
sun_init.c:417: warning: old-style parameter declaration

sun_vid.c: In function `solUnMapVidMem':
sun_vid.c:162: warning: long unsigned int format, pointer arg (arg 6)
sun_vid.c: In function `xf86ReadBIOS':
sun_vid.c:217: warning: long unsigned int format, pointer arg (arg 5)
sun_vid.c:217: warning: long unsigned int format, int arg (arg 6)

sun_agp.c: In function `xf86EnableAGP':
sun_agp.c:321: warning: unsigned int format, CARD32 arg (arg 4)

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 hw/xfree86/os-support/solaris/sun_agp.c  |    2 +-
 hw/xfree86/os-support/solaris/sun_init.c |    7 +++----
 hw/xfree86/os-support/solaris/sun_vid.c  |    5 ++---
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/hw/xfree86/os-support/solaris/sun_agp.c b/hw/xfree86/os-support/solaris/sun_agp.c
index 9db5d63..dd4b1e2 100644
--- a/hw/xfree86/os-support/solaris/sun_agp.c
+++ b/hw/xfree86/os-support/solaris/sun_agp.c
@@ -318,7 +318,7 @@ xf86EnableAGP(int screenNum, CARD32 mode)
 	if (ioctl(gartFd, AGPIOC_SETUP, &setup) != 0) {
 		xf86DrvMsg(screenNum, X_WARNING, "xf86EnableAGP: "
 		    "AGPIOC_SETUP with mode %x failed (%s)\n",
-		    mode, strerror(errno));
+		    (unsigned int) mode, strerror(errno));
 		return FALSE;
 	}
 
diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c
index edcc60b..281a6df 100644
--- a/hw/xfree86/os-support/solaris/sun_init.c
+++ b/hw/xfree86/os-support/solaris/sun_init.c
@@ -71,7 +71,6 @@ xf86OpenConsole(void)
     int fd;
     struct vt_mode VT;
     struct vt_stat vtinfo;
-    int FreeVTslot;
     MessageType from = X_PROBED;
 #endif
 
@@ -95,8 +94,8 @@ xf86OpenConsole(void)
 	    }
 	    else
 	    {
-		if ((int)mmap(0, 0x1000, PROT_NONE,
-			      MAP_FIXED | MAP_SHARED, fd, 0) == -1)
+		if (mmap(0, 0x1000, PROT_NONE,
+			 MAP_FIXED | MAP_SHARED, fd, 0) == MAP_FAILED)
 		    xf86Msg(X_WARNING,
 			"xf86OpenConsole: failed to protect page 0 (%s)\n",
 			strerror(errno));
@@ -413,7 +412,7 @@ xf86ProcessArgument(int argc, char **argv, int i)
     return 0;
 }
 
-void xf86UseMsg()
+void xf86UseMsg(void)
 {
 #ifdef HAS_USL_VTS
     ErrorF("vtX                    Use the specified VT number\n");
diff --git a/hw/xfree86/os-support/solaris/sun_vid.c b/hw/xfree86/os-support/solaris/sun_vid.c
index 5089ae7..9497973 100644
--- a/hw/xfree86/os-support/solaris/sun_vid.c
+++ b/hw/xfree86/os-support/solaris/sun_vid.c
@@ -157,7 +157,7 @@ solUnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
     if (munmap(Base, Size) != 0) {
 	xf86DrvMsgVerb(ScreenNum, X_WARNING, 0,
 		       "solUnMapVidMem: failed to unmap %s"
-		       " (0x%08lx,0x%lx) (%s)\n",
+		       " (0x%p,0x%lx) (%s)\n",
 		       apertureDevName, Base, Size,
 		       strerror(errno));
     }
@@ -212,8 +212,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
     (void)memcpy(Buf, (void *)(ptr + Offset), Len);
     if (munmap((caddr_t)ptr, mlen) != 0) {
 	xf86MsgVerb(X_WARNING, 0,
-		    "solUnMapVidMem: failed to unmap %s"
-		    " (0x%08lx,0x%lx) (%s)\n",
+		    "xf86ReadBIOS: failed to unmap %s (0x%p,0x%x) (%s)\n",
 		    apertureDevName, ptr, mlen, strerror(errno));
     }
 
-- 
1.7.3.2



More information about the xorg-devel mailing list