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

Ken Thomases ken at codeweavers.com
Sun Jul 10 17:33:56 CDT 2016


On Jun 30, 2016, at 7:02 PM, David Lawrie <david.dljunk at gmail.com> wrote:
> @@ -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);

You've now interleaved statements and declarations.  Wine's code standard requires that declarations all come before statements.  So, you could change the assignment of num_devices to an initialization or split the declaration and initialization of devices to separate declaration and assignment.

Wine should be using -Wdeclaration-after-statement for its compile commands.  Therefore, this change would have added a new warning.  I know that some of the Mac files have a lot of warnings, which makes it hard to see new ones, but you should strive to avoid adding more.

-Ken




More information about the wine-devel mailing list