From d13828797fe22856b07e08a55d2b9375902194bf Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Fri, 18 Apr 2008 20:38:31 -0700 Subject: [PATCH] XQuartz: Cleaned up some casting to get rid of compiler warnings (cherry picked from commit 6f1c85b96550adf0bc34efb6ca649b87bcc1b18c) --- hw/xquartz/darwin.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index 990b08e91..aad55fc64 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -335,37 +335,34 @@ static void DarwinChangePointerControl( * DarwinMouseProc * Handle the initialization, etc. of a mouse */ -static int DarwinMouseProc( - DeviceIntPtr pPointer, - int what ) -{ - CARD8 map[8] = {0, 1, 2, 3, 4, 5, 6, 7}; - +static int DarwinMouseProc(DeviceIntPtr pPointer, int what) { + CARD8 map[8] = {0, 1, 2, 3, 4, 5, 6, 7}; + switch (what) { - + case DEVICE_INIT: pPointer->public.on = FALSE; - + // Set button map. - InitPointerDeviceStruct( (DevicePtr)pPointer, map, 7, - GetMotionHistory, - (PtrCtrlProcPtr)NoopDDA, - GetMotionHistorySize(), 7); - InitProximityClassDeviceStruct( (DevicePtr)pPointer); + InitPointerDeviceStruct((DevicePtr)pPointer, map, 7, + GetMotionHistory, + (PtrCtrlProcPtr)NoopDDA, + GetMotionHistorySize(), 7); + InitProximityClassDeviceStruct(pPointer); break; - + case DEVICE_ON: pPointer->public.on = TRUE; AddEnabledDevice( darwinEventReadFD ); return Success; - + case DEVICE_CLOSE: case DEVICE_OFF: pPointer->public.on = FALSE; - RemoveEnabledDevice( darwinEventReadFD ); + RemoveEnabledDevice(darwinEventReadFD); return Success; } - + return Success; }