[v3 3/3] dinput: Alter function name and code style

David Lawrie david.dljunk at gmail.com
Thu Jun 30 19:02:33 CDT 2016


Makes the dinput Mac joystick code more similar to winmm Mac joystick
code and improves code stylistically

Tested on OS X 10.10.5.

Signed-off-by: David Lawrie <david.dljunk at gmail.com>
---
 dlls/dinput/joystick_osx.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c
index 6f3f316..ace7444 100644
--- a/dlls/dinput/joystick_osx.c
+++ b/dlls/dinput/joystick_osx.c
@@ -201,9 +201,9 @@ static long get_device_location_ID(IOHIDDeviceRef device)
     return result;
 }
 
-static void CFSetApplierFunctionCopyToCFArray(const void *value, void *context)
+static void copy_set_to_array(const void *value, void *context)
 {
-    CFArrayAppendValue( ( CFMutableArrayRef ) context, value );
+    CFArrayAppendValue(context, value);
 }
 
 static CFComparisonResult device_location_comparator(const void *val1, const void *val2, void *context)
@@ -490,10 +490,10 @@ static int find_osx_devices(void)
     if (devset)
     {
         CFIndex num_devices, num_main_elements, idx;
-        CFMutableArrayRef devices = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
-        CFSetApplyFunction(devset, CFSetApplierFunctionCopyToCFArray, devices);
-        CFRelease( devset);
-        num_devices = CFArrayGetCount(devices);
+        num_devices = CFSetGetCount(devset);
+        CFMutableArrayRef devices = CFArrayCreateMutable(kCFAllocatorDefault, num_devices, &kCFTypeArrayCallBacks);
+        CFSetApplyFunction(devset, copy_set_to_array, devices);
+        CFRelease(devset);
         CFArraySortValues(devices, CFRangeMake(0, num_devices), device_location_comparator, NULL);
 
         device_main_elements = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
-- 
1.7.12.4 (Apple Git-37)




More information about the wine-patches mailing list