summaryrefslogtreecommitdiff
path: root/platform/osx
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-22 00:58:12 +0200
committerGitHub <noreply@github.com>2017-08-22 00:58:12 +0200
commitdf590fc2d33c1ba715a4ce58f71d83e0ed9f5693 (patch)
tree8bfdc3e033aaf4dc9a5de5e8040e4f99afa0c540 /platform/osx
parent13f879587dd9bce59528e44b0faaf6e062f6d918 (diff)
parent738d2ab96997faa1e13b91e38cf8a0000d829f70 (diff)
Merge pull request #10340 from Rubonnek/remove-unnecessary-assignments
Removed unnecessary assignments
Diffstat (limited to 'platform/osx')
-rw-r--r--platform/osx/joypad_osx.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp
index 1a4b3a460e..96c660ad1d 100644
--- a/platform/osx/joypad_osx.cpp
+++ b/platform/osx/joypad_osx.cpp
@@ -217,10 +217,9 @@ static void joypad_added_callback(void *ctx, IOReturn res, void *sender, IOHIDDe
}
static bool is_joypad(IOHIDDeviceRef p_device_ref) {
- CFTypeRef refCF = NULL;
int usage_page = 0;
int usage = 0;
- refCF = IOHIDDeviceGetProperty(p_device_ref, CFSTR(kIOHIDPrimaryUsagePageKey));
+ CFTypeRef refCF = IOHIDDeviceGetProperty(p_device_ref, CFSTR(kIOHIDPrimaryUsagePageKey));
if (refCF) {
CFNumberGetValue((CFNumberRef)refCF, kCFNumberSInt32Type, &usage_page);
}
@@ -289,13 +288,11 @@ static String _hex_str(uint8_t p_byte) {
bool JoypadOSX::configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy) {
- CFTypeRef refCF = NULL;
-
p_joy->device_ref = p_device_ref;
/* get device name */
String name;
char c_name[256];
- refCF = IOHIDDeviceGetProperty(p_device_ref, CFSTR(kIOHIDProductKey));
+ CFTypeRef refCF = IOHIDDeviceGetProperty(p_device_ref, CFSTR(kIOHIDProductKey));
if (!refCF) {
refCF = IOHIDDeviceGetProperty(p_device_ref, CFSTR(kIOHIDManufacturerKey));
}
@@ -334,8 +331,7 @@ bool JoypadOSX::configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy) {
input->joy_connection_changed(id, true, name, guid);
}
- CFArrayRef array = NULL;
- array = IOHIDDeviceCopyMatchingElements(p_device_ref, NULL, kIOHIDOptionsTypeNone);
+ CFArrayRef array = IOHIDDeviceCopyMatchingElements(p_device_ref, NULL, kIOHIDOptionsTypeNone);
if (array) {
p_joy->add_hid_elements(array);
CFRelease(array);