summaryrefslogtreecommitdiff
path: root/platform/osx
diff options
context:
space:
mode:
authorWilson E. Alvarez <wilson.e.alvarez1@gmail.com>2017-08-21 15:15:36 -0400
committerWilson E. Alvarez <wilson.e.alvarez1@gmail.com>2017-08-21 15:15:55 -0400
commit738d2ab96997faa1e13b91e38cf8a0000d829f70 (patch)
treee33258663017edb924695e68224ba836e5fc9f08 /platform/osx
parent4717d37bfa867d8cdcd4805967324978da6701b7 (diff)
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);