[vtk-developers] unsigned/signed comparison

Andrew Maclean andrew.amaclean at gmail.com
Wed Dec 23 16:57:37 EST 2009


If polygon2->GetNumberOfPoints() is returning int the you should use:
for (int i ...

Regards
   Andrew


On Thu, Dec 24, 2009 at 8:49 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> Is the preferred way to do this comparison:
> for(unsigned int i = 0; i < polygon2->GetNumberOfPoints(); i++)
>
> to use a signed int for the counter:
> for(int i = 0; i < polygon2->GetNumberOfPoints(); i++)
>
> or cast the compare value as an unsigned int:
> for(unsigned int i = 0; i < static_cast<unsigned
> int>(polygon2->GetNumberOfPoints()); i++)
>
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>



-- 
___________________________________________
Andrew J. P. Maclean
Centre for Autonomous Systems
The Rose Street Building J04
The University of Sydney  2006  NSW
AUSTRALIA
Ph: +61 2 9351 3283
Fax: +61 2 9351 7474
URL: http://www.acfr.usyd.edu.au/
___________________________________________



More information about the vtk-developers mailing list