(svn r11564) -Codechange: Increase the usage of the for_each_bit macro and rename it fitting to the naming style

This commit is contained in:
skidd13
2007-12-03 09:19:19 +00:00
parent 1a43c6a6f6
commit 82913a2134
6 changed files with 38 additions and 29 deletions

View File

@@ -121,8 +121,9 @@ uint GetMaskOfTownActions(int *nump, PlayerID pid, const Town *t)
static int GetNthSetBit(uint32 bits, int n)
{
if (n >= 0) {
for (uint i = 0; bits != 0; bits >>= 1, i++) {
if (bits & 1) n--;
uint i;
FOR_EACH_SET_BIT(i, bits) {
n--;
if (n < 0) return i;
}
}