From 7d650d0b284b6814624ba07cdfa2d90854d801a7 Mon Sep 17 00:00:00 2001 From: Vitaliy Margolen Date: Mon, 3 Jan 2011 07:25:11 -0700 Subject: [PATCH] dinput: Pass interface instead of this pointer to joystick poll callback. --- dlls/dinput/joystick.c | 4 ++-- dlls/dinput/joystick_linux.c | 9 +++++---- dlls/dinput/joystick_linuxinput.c | 4 ++-- dlls/dinput/joystick_osx.c | 4 ++-- dlls/dinput/joystick_private.h | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c index 7d781c92698..e894dc6cfe0 100644 --- a/dlls/dinput/joystick.c +++ b/dlls/dinput/joystick.c @@ -358,7 +358,7 @@ HRESULT WINAPI JoystickAGenericImpl_Poll(LPDIRECTINPUTDEVICE8A iface) return DIERR_NOTACQUIRED; } - This->joy_polldev(This); + This->joy_polldev(iface); return DI_OK; } @@ -381,7 +381,7 @@ HRESULT WINAPI JoystickAGenericImpl_GetDeviceState( } /* update joystick state */ - This->joy_polldev(This); + This->joy_polldev(iface); /* convert and copy data to user supplied buffer */ fill_DataFormat(ptr, len, &This->js, &This->base.data_format); diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index 1396ea56d84..d489ef3b9ad 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -110,7 +110,7 @@ static const GUID DInput_Wine_Joystick_GUID = { /* 9e573ed9-7734-11d2-8d4a-23903 static INT joystick_devices_count = -1; static struct JoyDev *joystick_devices; -static void joy_polldev(JoystickGenericImpl *This); +static void joy_polldev(LPDIRECTINPUTDEVICE8A iface); static INT find_joystick_devices(void) { @@ -544,10 +544,11 @@ static HRESULT WINAPI JoystickLinuxAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) return DI_NOEFFECT; } -static void joy_polldev(JoystickGenericImpl *This_in) { +static void joy_polldev(LPDIRECTINPUTDEVICE8A iface) +{ struct pollfd plfd; - struct js_event jse; - JoystickImpl *This = (JoystickImpl*) This_in; + struct js_event jse; + JoystickImpl *This = (JoystickImpl*) iface; TRACE("(%p)\n", This); diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 6da60663b36..1bb3398bbd1 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -135,7 +135,7 @@ struct JoystickImpl static void fake_current_js_state(JoystickImpl *ji); static void find_joydevs(void); -static void joy_polldev(JoystickGenericImpl *This); +static void joy_polldev(LPDIRECTINPUTDEVICE8A iface); /* This GUID is slightly different from the linux joystick one. Take note. */ static const GUID DInput_Wine_Joystick_Base_GUID = { /* 9e573eda-7734-11d2-8d4a-23903fb6bdf7 */ @@ -731,7 +731,7 @@ static void fake_current_js_state(JoystickImpl *ji) #undef CENTER_AXIS /* convert wine format offset to user format object index */ -static void joy_polldev(JoystickGenericImpl *iface) +static void joy_polldev(LPDIRECTINPUTDEVICE8A iface) { struct pollfd plfd; struct input_event ie; diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c index fc218d3f722..2b4ea12e3d6 100644 --- a/dlls/dinput/joystick_osx.c +++ b/dlls/dinput/joystick_osx.c @@ -517,9 +517,9 @@ static void get_osx_device_elements_props(JoystickImpl *device) } } -static void poll_osx_device_state(JoystickGenericImpl *device_in) +static void poll_osx_device_state(LPDIRECTINPUTDEVICE8A iface) { - JoystickImpl *device = (JoystickImpl*)device_in; + JoystickImpl *device = (JoystickImpl*)iface; IOHIDElementRef tIOHIDTopElementRef; IOHIDDeviceRef tIOHIDDeviceRef; CFArrayRef gElementCFArrayRef = device->elementCFArrayRef; diff --git a/dlls/dinput/joystick_private.h b/dlls/dinput/joystick_private.h index ebbd3253144..dfa0dfa024d 100644 --- a/dlls/dinput/joystick_private.h +++ b/dlls/dinput/joystick_private.h @@ -33,7 +33,7 @@ #define MAX_PROPS 164 struct JoystickGenericImpl; -typedef void joy_polldev_handler(struct JoystickGenericImpl *This); +typedef void joy_polldev_handler(LPDIRECTINPUTDEVICE8A iface); typedef struct JoystickGenericImpl {