[PATCH] dinput: Avoid negating FAILED()

Michael Stefaniuc mstefani at winehq.org
Tue Oct 19 15:54:33 CDT 2021


Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
 dlls/dinput/joystick_hid.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index a6715463690..3e515f11fec 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -2720,7 +2720,7 @@ static HRESULT WINAPI hid_joystick_effect_Start( IDirectInputEffect *iface, DWOR
         hr = DIERR_NOTEXCLUSIVEACQUIRED;
     else if ((flags & DIES_NODOWNLOAD) && !impl->index)
         hr = DIERR_NOTDOWNLOADED;
-    else if ((flags & DIES_NODOWNLOAD) || !FAILED(hr = IDirectInputEffect_Download( iface )))
+    else if ((flags & DIES_NODOWNLOAD) || SUCCEEDED(hr = IDirectInputEffect_Download( iface )))
     {
         count = 1;
         status = HidP_InitializeReportForID( HidP_Output, effect_control->id, preparsed,
@@ -2865,7 +2865,7 @@ static HRESULT WINAPI hid_joystick_effect_Download( IDirectInputEffect *iface )
         hr = DIERR_NOTEXCLUSIVEACQUIRED;
     else if ((impl->flags & complete_mask) != complete_mask)
         hr = DIERR_INCOMPLETEEFFECT;
-    else if (!impl->index && !FAILED(hr = find_next_effect_id( impl->joystick, &impl->index )))
+    else if (!impl->index && SUCCEEDED(hr = find_next_effect_id( impl->joystick, &impl->index )))
     {
         if (!impl->type_specific_buf[0][0]) status = HIDP_STATUS_SUCCESS;
         else status = HidP_SetUsageValue( HidP_Output, HID_USAGE_PAGE_PID, 0, PID_USAGE_EFFECT_BLOCK_INDEX,
@@ -3030,7 +3030,7 @@ static HRESULT WINAPI hid_joystick_effect_Unload( IDirectInputEffect *iface )
     EnterCriticalSection( &joystick->base.crit );
     if (!impl->index)
         hr = DI_NOEFFECT;
-    else if (!FAILED(hr = IDirectInputEffect_Stop( iface )))
+    else if (SUCCEEDED(hr = IDirectInputEffect_Stop( iface )))
     {
         impl->joystick->effect_inuse[impl->index - 1] = FALSE;
         impl->index = 0;
-- 
2.31.1




More information about the wine-devel mailing list