Vitaliy Margolen : dinput: Pass interface instead of this pointer to joystick poll callback.

Alexandre Julliard julliard at winehq.org
Mon Jan 3 10:58:06 CST 2011


Module: wine
Branch: master
Commit: 7d650d0b284b6814624ba07cdfa2d90854d801a7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7d650d0b284b6814624ba07cdfa2d90854d801a7

Author: Vitaliy Margolen <wine-patches at kievinfo.com>
Date:   Mon Jan  3 07:25:11 2011 -0700

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 7d781c9..e894dc6 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 1396ea5..d489ef3 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 6da6066..1bb3398 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 fc218d3..2b4ea12 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 ebbd325..dfa0dfa 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
 {




More information about the wine-cvs mailing list