[vtk-developers] Recent change to vtkTexture.h adds compiler warnings
David Cole
david.cole at kitware.com
Thu Jun 26 14:43:27 EDT 2008
Actually never mind about trying that... It will end up being irrelevant.
The problem is that we were trying to use an enum type in the
vtkGetMacro/vtkSetMacro paradigm. We can't do that in the public API of a
vtkObject because the wrapper layers don't handle enum types properly. The
types of the variables will be switched to "int" so that they are wrapped
into tcl and python properly and this problem will go away as a result of
that...
Sorry for the brief irrelevance.
Dave
On Thu, Jun 26, 2008 at 2:10 PM, David Cole <david.cole at kitware.com> wrote:
> Sean....
>
> If you change the value in vtkTexture.h from "-1" to "0xFFFFFFFF" does the
> warning go away...?
>
>
> Thx,
> Dave
>
>
>
> On Thu, Jun 26, 2008 at 1:54 PM, David C Thompson <dcthomp at sandia.gov>
> wrote:
>
>> Sorry, I hit send too soon... It would be nice to have the type safety
>> there because when the ivars are declared as the enum type instead of
>> "int" things like switch statements will generate warnings when an enum
>> is not handled.
>>
>> David
>>
>> > > I would suggest removing the enum name.
>> > Would it be possible to change VTK_TEXTURE_BLENDING_MODE_NONE to a large
>> > positive value? It would be nice to have the type safety in the Get/Set
>> > methods.
>> >
>> > David
>> >
>> > >
>> > > Jeff
>> > >
>> > > ---------- Forwarded message ----------
>> > > From: Sean McBride <sean at rogue-research.com>
>> > > Date: Thu, Jun 26, 2008 at 1:08 PM
>> > > Subject: [vtk-developers] Recent change to vtkTexture.h adds compiler
>> warnings
>> > > To: vtk-developers at vtk.org
>> > >
>> > >
>> > > Hi all,
>> > >
>> > > Some warning flags produce far too many warnings with VTK's code but
>> > > cause no problems for VTK's public headers. For this reason, we're
>> able
>> > > to enable more warnings in our app than with our dashboards. Up until
>> > > very recently we were warning-free.
>> > >
>> > > This change:
>> > > <http://public.kitware.com/cgi-bin/viewcvs.cgi/Rendering/vtkTexture.h
>> ?
>> > > r1=1.62&r2=1.63>
>> > >
>> > > has introduced the warning (from gcc's -Wsign-promo):
>> > >
>> > > vtkTexture.h:171: warning: passing 'VTKTextureBlendingMode' chooses
>> > > 'int' over 'unsigned int'
>> > > vtkTexture.h:171: warning: in call to 'vtkOStreamWrapper&
>> > > vtkOStreamWrapper::operator<<(int)'
>> > > vtkTexture.h: In member function 'virtual void
>> > > vtkTexture::SetBlendingMode(VTKTextureBlendingMode)':
>> > >
>> > > This was added:
>> > >
>> > > typedef enum
>> > > {
>> > > VTK_TEXTURE_BLENDING_MODE_NONE = -1,
>> > > VTK_TEXTURE_BLENDING_MODE_REPLACE = 0,
>> > > ...
>> > > } VTKTextureBlendingMode;
>> > >
>> > > The compiler gets to decide the type and size of enums, which I guess
>> is
>> > > the root of the problem. One fix would be:
>> > >
>> > > enum
>> > > {
>> > > VTK_TEXTURE_BLENDING_MODE_NONE = -1,
>> > > VTK_TEXTURE_BLENDING_MODE_REPLACE = 0,
>> > > ...
>> > > };
>> > > typedef int VTKTextureBlendingMode;
>> > >
>> > > What are the coding standards in this situation? VTK actually seems
>> to
>> > > almost never give a name to enums (I found only 2 others) so another
>> > > option would be to remove 'VTKTextureBlendingMode' entirely and use
>> > > 'int' in place.
>> > >
>> > > --
>> > > ____________________________________________________________
>> > > Sean McBride, B. Eng sean at rogue-research.com
>> > > Rogue Research www.rogue-research.com
>> > > Mac Software Developer Montréal, Québec, Canada
>> > >
>> > >
>> > > _______________________________________________
>> > > vtk-developers mailing list
>> > > vtk-developers at vtk.org
>> > > http://www.vtk.org/mailman/listinfo/vtk-developers
>> > >
>> > >
>> > >
>> > > --
>> > > Jeff Baumes, Ph.D.
>> > > R&D Engineer, Kitware Inc.
>> > > (518) 371-3971 x132
>> > > jeff.baumes at kitware.com
>> > > _______________________________________________
>> > > vtk-developers mailing list
>> > > vtk-developers at vtk.org
>> > > http://www.vtk.org/mailman/listinfo/vtk-developers
>> > >
>>
>>
>> _______________________________________________
>> vtk-developers mailing list
>> vtk-developers at vtk.org
>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20080626/03531708/attachment.html>
More information about the vtk-developers
mailing list