First of all, Graal doesn't support above 32bits for numbers (I think).
Second, what I said was correct
if (flags & (0x100000001 | 0x10000))
[edit]
We had a discussion about this on IRC and we came to that I misunderstood your original question, mostly because your original question was not written very well.
Anyway, my point of view: you're using bitflags for the wrong reason.
But uhh, here's how I would do it:
PHP Code:
function getFlagCount(flags)
{
temp.count = 0;
while (temp.flags > 0)
{
temp.count += temp.flags & 1;
temp.flags >>= 1;
}
return temp.count;
}