View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-07-2010 , 01:11   Re: [TUT] Bits, Bit-fields, and Bit-wise Operators
Reply With Quote #10

Quote:
Originally Posted by Exolent[jNr] View Post
Okay, so I've read it and it's very detailed and explained well.

I have one thought though.
Shouldn't this:
Code:
new iBitfieldArray[ ( MAX_BIT / 32 ) + 1 ];
be this:
Code:
new iBitfieldArray[ ( MAX_BIT >> 5 ) + 1 ];
Not that the first is wrong, but 1. we are talking about bits, and 2. it was proved in the other thread that the latter was quicker than the former.
Either will do the same but I think it may just confuse readers more than help them having MAX_BIT >> 5. IMO, the latter method serves a better purpose in the macros because they will be used much more frequently whereas in the variable declaration it is probably only called once per map change (assuming a global var).
__________________
Bugsy is offline