[vtk-developers] int to bool patch, white space convention?

Cory Quammen cory.quammen at kitware.com
Tue Nov 17 08:56:56 EST 2015


I commented on the gitlab issue, but I'll reiterate here. I'm worried about
backwards incompatibilities this might introduce. In most cases, you should
be fine. But I have suspicions things may be more complicated than they
first appear.

With ITK a few years back, there was a seemingly innocent change of a
common parameter from 'int' to 'unsigned int'. In principle this made sense
because this parameter represented a number of threads, but it caused
numerous problems that were hard to foresee.

We'll need to test ParaView build with this change at the very least...

Thanks,
Cory

On Mon, Nov 16, 2015 at 11:35 PM, Sean McBride <sean at rogue-research.com>
wrote:

> Hi all,
>
> I'm working on a patch that changes some VTK APIs that use 'int' to
> instead use 'bool'.  I've used a bunch of regexes to find vtkBooleanMacro
> uses, ex:
>
>   vtkSetMacro\((.*),int\);\r  vtkGetMacro\(\1,int\);\r
> vtkBooleanMacro\(\1,int\);
>
> I've discovered there's a variety of a) whitespace b) ordering, ex:
>
>   vtkSetMacro(foo, bool);
>   vtkGetMacro(foo, bool);
>   vtkBooleanMacro(foo, bool);
>
> vs
>
>   vtkBooleanMacro(bar,bool);
>   vtkSetMacro(bar,bool);
>   vtkGetMacro(bar,bool);
>
> Shall I take this opportunity to make everything uniform?
>
> The most common form is:
>
>   vtkSetMacro(foo,int);
>   vtkGetMacro(foo,int);
>   vtkBooleanMacro(foo,int);
>
> The 2nd most common is the same order, but with a space after the comma.
> The style guide seems to have examples of both.  Is one preferred?
>
> Here's my WIP:
> <https://gitlab.kitware.com/vtk/vtk/merge_requests/917>
>
> Cheers,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>


-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20151117/095c5510/attachment.html>


More information about the vtk-developers mailing list