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

DavidL david.dljunk at gmail.com
Mon Jul 11 03:45:00 CDT 2016


I am compiling with -Wdeclaration-after-statement but oddly enough the
compiler did not generate that warning for dinput. However, I don't know
why not, because I see what you're saying and will make the necessary
change anyway.

David

On Sun, Jul 10, 2016 at 3:33 PM, Ken Thomases <ken at codeweavers.com> wrote:

> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20160711/ed75ff88/attachment-0001.html>


More information about the wine-devel mailing list