=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: dinput: Use BOOL type where appropriate.

Alexandre Julliard julliard at winehq.org
Fri Oct 4 15:08:40 CDT 2013


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

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Fri Oct  4 11:43:23 2013 +0200

dinput: Use BOOL type where appropriate.

---

 dlls/dinput/device.c              |    6 +++---
 dlls/dinput/joystick.c            |    4 ++--
 dlls/dinput/joystick_linuxinput.c |    4 ++--
 dlls/dinput/joystick_osx.c        |    9 +++++----
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index 2ca26fb..fc5ad5d 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -719,8 +719,8 @@ HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf,
     IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface);
     WCHAR username[MAX_PATH];
     DWORD username_size = MAX_PATH;
-    int i, has_actions = 0;
-    BOOL load_success = FALSE;
+    int i;
+    BOOL load_success = FALSE, has_actions = FALSE;
 
     /* Unless asked the contrary by these flags, try to load a previous mapping */
     if (!(dwFlags & DIDBAM_HWDEFAULTS))
@@ -760,7 +760,7 @@ HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf,
                 lpdiaf->rgoAction[i].dwObjID = obj_id;
                 lpdiaf->rgoAction[i].guidInstance = This->guid;
                 lpdiaf->rgoAction[i].dwHow = DIAH_DEFAULT;
-                has_actions = 1;
+                has_actions = TRUE;
             }
         }
         else if (!(dwFlags & DIDBAM_PRESERVE))
diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
index ce267e6..4eddd89 100644
--- a/dlls/dinput/joystick.c
+++ b/dlls/dinput/joystick.c
@@ -708,7 +708,7 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
 {
     JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface);
     unsigned int i, j;
-    int has_actions = 0;
+    BOOL has_actions = FALSE;
     DWORD object_types[] = { DIDFT_AXIS, DIDFT_BUTTON };
     DWORD type_map[] = { DIDFT_RELAXIS, DIDFT_PSHBUTTON };
 
@@ -739,7 +739,7 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
                     lpdiaf->rgoAction[i].guidInstance = This->base.guid;
                     lpdiaf->rgoAction[i].dwHow = DIAH_DEFAULT;
 
-                    has_actions = 1;
+                    has_actions = TRUE;
 
                     /* No need to try other types if the action was already mapped */
                     break;
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index 5d1cacc..559f181 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -97,7 +97,7 @@ struct JoyDev {
 	char *name;
 	GUID guid;
 
-	int has_ff;
+        BOOL has_ff;
         int num_effects;
 
 	/* data returned by EVIOCGBIT for caps, EV_ABS, EV_KEY, and EV_FF */
@@ -275,7 +275,7 @@ static void find_joydevs(void)
             joydev.num_effects > 0)
         {
 	    TRACE(" ... with force feedback\n");
-	    joydev.has_ff = 1;
+            joydev.has_ff = TRUE;
         }
 #endif
 
diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c
index 66b020e..622b054 100644
--- a/dlls/dinput/joystick_osx.c
+++ b/dlls/dinput/joystick_osx.c
@@ -841,13 +841,13 @@ static const char *osx_ff_axis_name(UInt8 axis)
     return ret;
 }
 
-static int osx_axis_has_ff(FFCAPABILITIES *ffcaps, UInt8 axis)
+static BOOL osx_axis_has_ff(FFCAPABILITIES *ffcaps, UInt8 axis)
 {
     int i;
     for(i = 0; i < ffcaps->numFfAxes; ++i)
         if(ffcaps->ffAxes[i] == axis)
-            return 1;
-    return 0;
+            return TRUE;
+    return FALSE;
 }
 
 static HRESULT alloc_device(REFGUID rguid, IDirectInputImpl *dinput,
@@ -948,7 +948,8 @@ static HRESULT alloc_device(REFGUID rguid, IDirectInputImpl *dinput,
 
     for (i = 0; i < newDevice->generic.devcaps.dwAxes; i++)
     {
-        int wine_obj = -1, has_ff = 0;
+        int wine_obj = -1;
+        BOOL has_ff  = FALSE;
         switch (axis_map[i])
         {
             case kHIDUsage_GD_X:




More information about the wine-cvs mailing list