summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTormod Volden <debian.tormod@gmail.com>2011-02-13 23:04:09 +0100
committerTormod Volden <debian.tormod@gmail.com>2011-02-21 21:46:01 +0100
commitaff8f966c6d3f7dbad2d92d040ce7f5c4b286eef (patch)
tree270ac113c4b1e7355bf9a16c2d38eb97f75bd464
parent6b22be096bed59a853e5e1cdd25d8943cce30d4f (diff)
Use proper casts on framebuffer addresses
Correction to df8059025cafadaeea7672842d31134ed8c9c5df. Casting addresses to int is a 32bitism. If we want to use this intermediate cast to silence compiler warnings, we should use uintptr_t instead to not introduce potential bit truncation. Thanks to Mark Kettenis for spotting this. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
-rw-r--r--src/savage_dga.c2
-rw-r--r--src/savage_dri.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/savage_dga.c b/src/savage_dga.c
index 92a179e..1c4d884 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*)(int) psav->FbRegion.base;
+ *mem = (unsigned char*)(uintptr_t) 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 d43b8eb..e0b9f86 100644
--- a/src/savage_dri.c
+++ b/src/savage_dri.c
@@ -922,7 +922,7 @@ Bool SAVAGEDRIScreenInit( ScreenPtr pScreen )
pDRIInfo->ddxDriverMinorVersion = SAVAGE_VERSION_MINOR;
pDRIInfo->ddxDriverPatchVersion = SAVAGE_PATCHLEVEL;
- pDRIInfo->frameBufferPhysicalAddress = (pointer)(int) psav->FbRegion.base;
+ pDRIInfo->frameBufferPhysicalAddress = (pointer)(uintptr_t) psav->FbRegion.base;
pDRIInfo->frameBufferSize = psav->videoRambytes;
pDRIInfo->frameBufferStride = pScrn->displayWidth*(pScrn->bitsPerPixel/8);
pDRIInfo->ddxDrawableTableEntry = SAVAGE_MAX_DRAWABLES;