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 | 5d74f2ced4206725724d92fd8a5a22f9e1ce8b14 (patch) | |
tree | ffda3073f527cfcef5eb31264655b305398d87ab /src/station_gui.cpp | |
parent | 2b372e7e7b7aa04a45dd218681a3f1ed76d812ce (diff) | |
download | openttd-5d74f2ced4206725724d92fd8a5a22f9e1ce8b14.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/station_gui.cpp')
-rw-r--r-- | src/station_gui.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 04438acd5..fe5f11fbf 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -403,8 +403,9 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e) ToggleBit(facilities, e->we.click.widget - STATIONLIST_WIDGET_TRAIN); w->ToggleWidgetLoweredState(e->we.click.widget); } else { - for (uint i = 0; facilities != 0; i++, facilities >>= 1) { - if (HasBit(facilities, 0)) w->RaiseWidget(i + STATIONLIST_WIDGET_TRAIN); + uint i; + FOR_EACH_SET_BIT(i, facilities) { + w->RaiseWidget(i + STATIONLIST_WIDGET_TRAIN); } SetBit(facilities, e->we.click.widget - STATIONLIST_WIDGET_TRAIN); w->LowerWidget(e->we.click.widget); |