From eb3377ffb8a7baa26c9831e56ed782d48b28fa71 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Tue, 1 Nov 2011 14:59:15 -0700 Subject: xfree86: Fix powerpc build with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast memType is a uint64_t on powerpc. Using memType only really makes sense for *physical* addresses, which can be 64-bit for 32-bit systems running on 64-bit hardware. However, unmapVidMem() only deals with *virtual* addresses, which are guaranteed to fit into an uintptr_t. Signed-off-by: Jeremy Huddleston Reviewed-by: Mark Kettenis --- hw/xfree86/os-support/linux/lnx_video.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index e711784e7..0d91f7a52 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -465,11 +465,11 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) static void unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) { - memType alignOff = (memType)Base - - ((memType)Base & ~(getpagesize() - 1)); + uintptr_t alignOff = (uintptr_t)Base + - ((uintptr_t)Base & ~(getpagesize() - 1)); - DebugF("alignment offset: %lx\n",alignOff); - munmap((caddr_t)((memType)Base - alignOff), (Size + alignOff)); + DebugF("alignment offset: %lx\n", (unsigned long)alignOff); + munmap((void *)((uintptr_t)Base - alignOff), (Size + alignOff)); } -- cgit v1.2.3