Jolley, Thomas P wrote:
I can't imagine a case where I would ever want to treat a bit
or a bitmask as a signed value. I can imagine testing (mask
!= 0), but I can never imagine needing to test for (mask < 0)
or (mask > 0). Knowing whether a bit or mask is negative or
positive conveys no useful information.
(mask < 0) would mean the most significant bit is true (but only if it is
signed).
You could say the same for testing an unsigned int against 13. I can't imaging
testing for (mask < 13) or (mask > 13). This also conveys no useful
information for a bitmask.
Please disregard my last post. I didn't realize that you had
misunderstood the point of my quote above.
When I said "I can't see a need for testing (mask < 0) or (mask > 0)," I
meant to say that I don't see a need to know the sign of a bitmask
variable. Thus we should use unsigned for bitmasks. As the name implies,
unsigned variables don't have a sign. The alternative, signed, imbues
bitmasks with the ability to be positive or negative, which is not
useful in code that deals with bitmasks.
Sorry for the confusion.
-Paul
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org