From 5d74f2ced4206725724d92fd8a5a22f9e1ce8b14 Mon Sep 17 00:00:00 2001 From: skidd13 Date: Mon, 3 Dec 2007 09:19:19 +0000 Subject: (svn r11564) -Codechange: Increase the usage of the for_each_bit macro and rename it fitting to the naming style --- src/town_gui.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/town_gui.cpp') 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; } } -- cgit v1.2.3-54-g00ecf