[vtk-developers] compiler warnings, float vs double

Mathieu Malaterre mathieu.malaterre at gmail.com
Mon Aug 6 05:02:43 EDT 2007


Hi,

  VTK was changed from a float API to a double API during the VTK 4.2
to VTK 4.4 transition. I would say that this is simply an oversight
during the transition (Ken any comment?).

  So I'd rather say switch definitely to double if you can spot those
type of typos.

2 cents,
-Mathieu

On 8/1/07, David Cole <david.cole at kitware.com> wrote:
> You are trying to eliminate warnings, so just change the constants to the
> correct type to match the methods. That is a no-op as far as everybody else
> is concerned.
>
> If you change the signatures of methods unnecessarily, others may have to
> change their client code to keep pace. (For some clients and some methods
> this may be a *huge* amount of work.) If there were a "*better*" reason to
> change the signature, I'd say open it up for discussion, but not just to
> eliminate warnings.
>
> Change the constants unless some other people speak up and disagree with
> me....
>
> :-)
> David Cole
>
>
>
> On 8/1/07, Sean McBride < sean at rogue-research.com> wrote:
> > Hi all,
> >
> > I'd like to fix a few compiler warnings related to implicit 64 to 32 bit
> > conversion.  For example in vtkRenderWindow.h:
> >
> >   vtkSetClampMacro(AnaglyphColorSaturation,float, 0.0,
> 1.0);
> >   vtkGetMacro(AnaglyphColorSaturation,float);
> >
> > the variable is float but the constants are double.
> >
> > I could: 1) change the float to double 2) change the consts to 0.0f,
> > 1.0f.  I seem to remember that in VTK 5 there was a big float->double
> > change.  So is solution 1 preferred?
> >
> > Thanks,
> >
> > --
> >
> ____________________________________________________________
> > 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
> >
>
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>


-- 
Mathieu



More information about the vtk-developers mailing list