[PATCH] savage: Add casts to silence build warnings

Tormod Volden lists.tormod at gmail.com
Sun Jan 23 03:47:03 PST 2011


From: Tormod Volden <debian.tormod at gmail.com>

savage_exa.c: In function ‘SavageUploadToScreen’:
savage_exa.c:545: warning: passing argument 1 of ‘memcpy’ discards qualifiers from pointer target type
/usr/include/bits/string3.h:49: note: expected ‘void * restrict’ but argument is of type ‘volatile CARD32 *’

savage_video.c: In function ‘SavagePutImage’:
savage_video.c:2007: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘drmSize’
savage_video.c:2007: warning: format ‘%ld’ expects type ‘long int’, but argument 5 has type ‘int’
---
 src/savage_exa.c   |    2 +-
 src/savage_video.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/savage_exa.c b/src/savage_exa.c
index 8411298..5515f2c 100644
--- a/src/savage_exa.c
+++ b/src/savage_exa.c
@@ -542,7 +542,7 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
 
 	if (4 * dwords <= queue) {
 	    /* WARNING: breaking BCI_PTR abstraction here */
-	    memcpy(bci_ptr, srcp, 4 * dwords);
+	    memcpy((CARD32 *)bci_ptr, srcp, 4 * dwords);
 	    bci_ptr += dwords;
 	    queue -= 4 * dwords;
 	} else {
diff --git a/src/savage_video.c b/src/savage_video.c
index 311f47a..86ae0cd 100644
--- a/src/savage_video.c
+++ b/src/savage_video.c
@@ -2003,8 +2003,8 @@ SavagePutImage(
 	    /* This situation is expected if AGPforXv is disabled, otherwise report. */
 	    if (pSAVAGEDRIServer->agpXVideo.size > 0) {
 		xf86DrvMsg( pScreen->myNum, X_ERROR,
-		    "[agp] XVideo: not enough space in buffer (got %ld bytes, required %ld bytes).\n", 
-	    	    pSAVAGEDRIServer->agpXVideo.size, max(new_size, planarFrameSize));
+		    "[agp] XVideo: not enough space in buffer (got %ld bytes, required %d bytes).\n", 
+	    	    (long int)pSAVAGEDRIServer->agpXVideo.size, max(new_size, planarFrameSize));
 	    }
 	    pPriv->agpBufferMap = NULL;
 	    pPriv->agpBufferOffset = 0;
-- 
1.7.0.4



More information about the xorg-devel mailing list