diff options
Diffstat (limited to 'platform/osx/joypad_osx.cpp')
-rw-r--r-- | platform/osx/joypad_osx.cpp | 10 |
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); |