Dear Paul,

This sounds like a great idea to me.

Joe Mundy

Brown University

 

From: Paul Smyth [mailto:paul.smyth@vicon.com]
Sent: Friday, December 03, 2010 6:01 PM
To: vxl-maintainers@lists.sourceforge.net; vxl-users@lists.sourceforge.net
Subject: [Vxl-maintainers] unsigned int -> size_t for indexing

 

Hi all,

We’re increasingly using vxl (mostly vnl/vil) in a 64 bit Windows and Linux environment, and are repeatedly running into problems associated with the use of unsigned int rather than size_t for indexing into matrices, vectors, images etc., as this produces warnings absolutely everywhere we have used size_t as an indexing type (it is the type of std::vector<T>::size() ), and then use that to then index into a vnl/vil type.

Would it be unreasonable if we ported at least vnl & vil to use size_t in place of unsigned int?

 

Additionally, there are quite a few situations where (signed) int is used for indexing, in which case more care is required porting to size_t, as there is the possibility of the signed-ness being used: e.g. for(int i = v.size()-1; i  >= 0; --i)  {lookup v[i] } // loop through vector in reverse.

We’d like to sort out as many of those as possible, without causing too much risk. Opinions?

 

Cheers, Paul Smyth.

Vicon Motion Systems Ltd.

www.vicon.com

 

 


________________________________________________________________________
This e-mail, and any attachment, is confidential. If you have received it in error, do not use or disclose the information in any way, notify me immediately, and please delete it from your system.
________________________________________________________________________