summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2017-06-07 20:33:54 -0700
committerGitHub <noreply@github.com>2017-06-07 20:33:54 -0700
commitb11d722eeda67bc498f7bf727649fb4ae4e5f997 (patch)
tree597b9596564442ac1c125f5f7332ffc6ec97ce03 /Source/Core/InputCommon
parente6aa118f2111351c7fb38a611f3523793927addb (diff)
parentfd166032abec349b9fae7240830133bf7e0c77b5 (diff)
Merge pull request #5572 from shuffle2/msvc-w4
msvc: use /W4 (and fixes to make it work)
Diffstat (limited to 'Source/Core/InputCommon')
-rw-r--r--Source/Core/InputCommon/GCAdapter.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/Core/InputCommon/GCAdapter.cpp b/Source/Core/InputCommon/GCAdapter.cpp
index 2cb7819d9d..a422e2635e 100644
--- a/Source/Core/InputCommon/GCAdapter.cpp
+++ b/Source/Core/InputCommon/GCAdapter.cpp
@@ -266,27 +266,26 @@ static bool CheckDeviceAccess(libusb_device* device)
}
return false;
}
- else if ((ret = libusb_kernel_driver_active(s_handle, 0)) == 1)
+ else
{
- if ((ret = libusb_detach_kernel_driver(s_handle, 0)) && ret != LIBUSB_ERROR_NOT_SUPPORTED)
+ ret = libusb_kernel_driver_active(s_handle, 0);
+ if (ret == 1)
{
- ERROR_LOG(SERIALINTERFACE, "libusb_detach_kernel_driver failed with error: %d", ret);
+ ret = libusb_detach_kernel_driver(s_handle, 0);
+ if (ret != 0 && ret != LIBUSB_ERROR_NOT_SUPPORTED)
+ ERROR_LOG(SERIALINTERFACE, "libusb_detach_kernel_driver failed with error: %d", ret);
}
}
// this split is needed so that we don't avoid claiming the interface when
// detaching the kernel driver is successful
if (ret != 0 && ret != LIBUSB_ERROR_NOT_SUPPORTED)
- {
return false;
- }
- else if ((ret = libusb_claim_interface(s_handle, 0)))
- {
+
+ ret = libusb_claim_interface(s_handle, 0);
+ if (ret)
ERROR_LOG(SERIALINTERFACE, "libusb_claim_interface failed with error: %d", ret);
- }
else
- {
return true;
- }
}
return false;
}