[PATCH:xf86-video-xgi 10/19] Improve format strings in messages and errors.

Thomas Klausner wiz at NetBSD.org
Thu Aug 6 05:57:08 PDT 2015


Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
---
 src/vb_ext.c     |  2 +-
 src/xgi_accel.c  |  7 ++++---
 src/xgi_driver.c | 18 +++++++++---------
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/vb_ext.c b/src/vb_ext.c
index 2f8c689..662cb7b 100755
--- a/src/vb_ext.c
+++ b/src/vb_ext.c
@@ -510,7 +510,7 @@ VOID XGISetDPMS(ScrnInfoPtr pScrn, PVB_DEVICE_INFO pVBInfo, PXGI_HW_DEVICE_INFO
     /* VB_DEVICE_INFO VBINF; */
     /* PVB_DEVICE_INFO pVBInfo = pXGI->XGI_Pr */ /* &VBINF */;
 
-	ErrorF("XGISetDPMS(VESA_POWER_STATE = 0x%x)...\n", VESA_POWER_STATE);
+    ErrorF("XGISetDPMS(VESA_POWER_STATE = 0x%lx)...\n", VESA_POWER_STATE);
 
     InitTo330Pointer( pXGIHWDE->jChipType,  pVBInfo ) ;
     ReadVBIOSTablData( pXGIHWDE->jChipType , pVBInfo) ;
diff --git a/src/xgi_accel.c b/src/xgi_accel.c
index 62607fb..d4d8d4b 100755
--- a/src/xgi_accel.c
+++ b/src/xgi_accel.c
@@ -1722,11 +1722,12 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn)
     ErrorF("----------------------------------------------------------------------\n") ;
 
 	SwWP = Volari_GetSwWP() ;
-    ErrorF("SwWP=0x%x\n", SwWP) ;
-    ErrorF("pXGI->cmdQueueBase=0x%x\n", pXGI->cmdQueueBase) ;
+    ErrorF("SwWP=0x%lx\n", SwWP) ;
+    ErrorF("pXGI->cmdQueueBase=%p\n", pXGI->cmdQueueBase) ;
 	for( i = 0 ; i < SwWP ; i+=0x04 )
 	{
-		ErrorF("[%04X]: %08lX\n",i, *(CARD32 *)(pXGI->cmdQueueBase+i));
+		ErrorF("[%04X]: %08lX\n",i,
+		    (unsigned long)*(CARD32 *)(pXGI->cmdQueueBase+i));
 	}
 }
 
diff --git a/src/xgi_driver.c b/src/xgi_driver.c
index a8a04db..2b72e5a 100755
--- a/src/xgi_driver.c
+++ b/src/xgi_driver.c
@@ -726,13 +726,13 @@ XGIErrorLog(ScrnInfoPtr pScrn, const char *format, ...)
         "**************************************************\n";
 
     va_start(ap, format);
-    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str);
+    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s", str);
     xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "                      ERROR:\n");
     xf86VDrvMsgVerb(pScrn->scrnIndex, X_ERROR, 1, format, ap);
     va_end(ap);
     xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
                "                  END OF MESSAGE\n");
-    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str);
+    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s", str);
 }
 
 #ifdef XSERVER_LIBPCIACCESS
@@ -2626,12 +2626,12 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags)
 		  vgaHWSetMmioFuncs(VGAHWPTR(pScrn), VGAHWPTR(pScrn)->Base, 0); 	
 #endif
 
-		  xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 
-				  "VGA memory map from 0x%x to 0x%x \n", 
+		  xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+				  "VGA memory map from %p to %p \n",
 #ifdef XSERVER_LIBPCIACCESS
-				  pXGI->PciInfo->regions[2].base_addr, VGAHWPTR(pScrn)->Base);
+				  (void *)(intptr_t)pXGI->PciInfo->regions[2].base_addr, VGAHWPTR(pScrn)->Base);
 #else
-				  pXGI->PciInfo->ioBase[2], VGAHWPTR(pScrn)->Base);
+				  (void *)(intptr_t)pXGI->PciInfo->ioBase[2], VGAHWPTR(pScrn)->Base);
 #endif
         }
     }
@@ -2907,7 +2907,7 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags)
     pXGI->xgi_HwDevExt.pjIOAddress = (pointer)((XGIIOADDRESS) (pXGI->RelIO + 0x30));
     xf86DrvMsg(pScrn->scrnIndex, from, "Relocated IO registers at 0x%lX\n",
                (unsigned long) pXGI->RelIO);
-	ErrorF("xgi_driver.c-pXGI->xgi_HwDevExt.pjIOAddress=0x%x...\n", pXGI->xgi_HwDevExt.pjIOAddress);
+    ErrorF("xgi_driver.c-pXGI->xgi_HwDevExt.pjIOAddress=0x%lx...\n", pXGI->xgi_HwDevExt.pjIOAddress);
 
     if (!xf86SetDepthBpp(pScrn, 0, 0, 0, pix24flags)) {
         XGIErrorLog(pScrn, "xf86SetDepthBpp() error\n");
@@ -3585,7 +3585,7 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags)
 			pScrn->monitor->nHsync = 1;
 			pScrn->monitor->hsync[0].lo=30;
 			pScrn->monitor->hsync[0].hi=50;
-			ErrorF("No HorizSync information set in Monitor section and use default (%d, %d)...\n", 
+			ErrorF("No HorizSync information set in Monitor section and use default (%g, %g)...\n",
 				pScrn->monitor->hsync[0].lo, pScrn->monitor->hsync[0].hi);
 		}
 
@@ -3594,7 +3594,7 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags)
 			pScrn->monitor->nVrefresh = 1;
 			pScrn->monitor->vrefresh[0].lo=40;
 			pScrn->monitor->vrefresh[0].hi=60;
-			ErrorF("No VertRefresh information set in Monitor section and use default (%d, %d)...\n", 
+			ErrorF("No VertRefresh information set in Monitor section and use default (%g, %g)...\n",
 				pScrn->monitor->vrefresh[0].lo, pScrn->monitor->vrefresh[0].hi);
 		}
 	}
-- 
2.5.0



More information about the xorg-devel mailing list