[PATCH] savage: More (intermediate) casts to silence warnings
Tormod Volden
lists.tormod at gmail.com
Sun Jan 23 03:47:04 PST 2011
From: Tormod Volden <debian.tormod at gmail.com>
savage_dga.c: In function ‘Savage_OpenFramebuffer’:
savage_dga.c:393: warning: cast to pointer from integer of different size
savage_dri.c: In function ‘SAVAGEDRIScreenInit’:
savage_dri.c:924: warning: cast to pointer from integer of different size
---
Not sure if this is really the way to go, but I have seen similar
commits and it works for me.
The remaining warnings that I see are more tricky, since the drm_handle_t
type in question is different on Linux and BSD:
savage_dri.c:490: warning: format ‘%08lx’ expects type ‘long unsigned int’,
but argument 5 has type ‘drm_handle_t’
I guess we just have to live with those?
Best regards,
Tormod
src/savage_dga.c | 2 +-
src/savage_dri.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/savage_dga.c b/src/savage_dga.c
index 7a9e22c..92a179e 100644
--- a/src/savage_dga.c
+++ b/src/savage_dga.c
@@ -390,7 +390,7 @@ Savage_OpenFramebuffer(
SavagePtr psav = SAVPTR(pScrn);
*name = NULL; /* no special device */
- *mem = (unsigned char*)psav->FbRegion.base;
+ *mem = (unsigned char*)(int) psav->FbRegion.base;
*size = psav->videoRambytes;
*offset = 0;
*flags = DGA_NEED_ROOT;
diff --git a/src/savage_dri.c b/src/savage_dri.c
index e4ebf84..90d3442 100644
--- a/src/savage_dri.c
+++ b/src/savage_dri.c
@@ -921,7 +921,7 @@ Bool SAVAGEDRIScreenInit( ScreenPtr pScreen )
pDRIInfo->ddxDriverMinorVersion = SAVAGE_VERSION_MINOR;
pDRIInfo->ddxDriverPatchVersion = SAVAGE_PATCHLEVEL;
- pDRIInfo->frameBufferPhysicalAddress = (pointer) psav->FbRegion.base;
+ pDRIInfo->frameBufferPhysicalAddress = (pointer)(int) psav->FbRegion.base;
pDRIInfo->frameBufferSize = psav->videoRambytes;
pDRIInfo->frameBufferStride = pScrn->displayWidth*(pScrn->bitsPerPixel/8);
pDRIInfo->ddxDrawableTableEntry = SAVAGE_MAX_DRAWABLES;
--
1.7.0.4
More information about the xorg-devel
mailing list