David Lawrie : dinput: Alter function name and code style.
Module: wine Branch: master Commit: c543c603a541c050cc30bc5b502e5f8031d4f6d5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c543c603a541c050cc30bc5b50... Author: David Lawrie <david.dljunk(a)gmail.com> Date: Mon Jul 11 04:06:02 2016 -0700 dinput: Alter function name and code style. Signed-off-by: David Lawrie <david.dljunk(a)gmail.com> Signed-off-by: Ken Thomases <ken(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_osx.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c index e937647..637692b 100644 --- a/dlls/dinput/joystick_osx.c +++ b/dlls/dinput/joystick_osx.c @@ -198,10 +198,9 @@ static long get_device_location_ID(IOHIDDeviceRef device) return get_device_property_long(device, CFSTR(kIOHIDLocationIDKey)); } - -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) @@ -486,10 +485,12 @@ 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); + CFMutableArrayRef devices; + + num_devices = CFSetGetCount(devset); + 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);
participants (1)
-
Alexandre Julliard