How to safely set all bits in a bitflag?
I need to return a bitflag with all bits set. My first thought was to set it to '0xFFFFFFFF'. But then I realized in AMD64 cells have 64 bits. I'm not sure if this would set the most or the least significant bits. And unfortunately I don't have a 64bit processor to test it.
Would this work? Code:
#if cellbits==32 |
Re: How to safely set all bits in a bitflag?
signed value for all bits set is -1
or ~0 for unsure case (unsigned or signed) |
| All times are GMT -4. The time now is 01:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.