(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

@@ -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);