Hi Martin et. al,

On the topic of masks and the debate that Tom pointed to.  At the time said
I would let the issue lie and return to it once I'm come to conclusion once
things had settled. It's one of these issues where it's six of one and half
a dozen of the other.  Time has gone on and your post has spurred me to
finally make my mind up.

Masks to be unsigned int  or int?   On considering all the different
possibilities and issues I've come to conclusion that types for masks where
enum's are the most natural way of specify the options then int's should be
used.

Traditionally the OSG code bases uses unsigned int in this situation, and
I've always felt it more natural that a mask would be an unsigned int,
but... enum's are int's and with compilers getting more a more picky about
types the use of unsigned int for masks that we use in conjunction with
enum.  Either we'd have to ditch the use of enum's in this context and
adopted #define or static const unsigned int usage in it's place, or adopt
int's.  The later seems like the line of least resistance, and easist to
maintain long term (as it's the most minimal code wise) and the easiest for
OSG users as it should avoid the need to introducing casting that users
previous had to do to avoid some warnings.

I have now gone through the OSG headers and source files and updated them to
using int's for the mask types where appropriate.  One place -
osgSim::ObjectRecordData I've kept unsigned int as this matched the
OpenFlight file format that it was mapping, and have replaced the previous
enum with a series of static const unsigned int  declarations in the
headers.  This combination avoids warnings.

These changes are now checked into svn/trunk.  Fingers crossed there won't
be any build breakages, and hopefully should address some of the warnings -
it's fixed some for me ;-)

Cheers,
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to