diff options
author | skidd13 <skidd13@openttd.org> | 2007-12-03 09:19:19 +0000 |
---|---|---|
committer | skidd13 <skidd13@openttd.org> | 2007-12-03 09:19:19 +0000 |
commit | 82913a21348a741eaacee6c81a57eba9a2c00250 (patch) | |
tree | ffda3073f527cfcef5eb31264655b305398d87ab /src/town_gui.cpp | |
parent | 1a43c6a6f6d78c1bbdebe8278ac67b6c2d5a8854 (diff) | |
download | openttd-82913a21348a741eaacee6c81a57eba9a2c00250.tar.xz |
(svn r11564) -Codechange: Increase the usage of the for_each_bit macro and rename it fitting to the naming style
Diffstat (limited to 'src/town_gui.cpp')
-rw-r--r-- | src/town_gui.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 452210e55..ccc723e41 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -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; } } |