(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

@@ -1653,13 +1653,11 @@ clear_town_stuff:;
k = 0;
// Build the rail
for (i = 0; i != 6; i++, j >>= 1) {
if (j & 1) {
k = i;
ret = DoCommand(c, railtype, i, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_SINGLE_RAIL);
if (CmdFailed(ret)) return CMD_ERROR;
total_cost.AddCost(ret);
}
FOR_EACH_SET_BIT(i, j) {
k = i;
ret = DoCommand(c, railtype, i, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_SINGLE_RAIL);
if (CmdFailed(ret)) return CMD_ERROR;
total_cost.AddCost(ret);
}
/* signals too? */
@@ -2854,7 +2852,6 @@ static bool AiCheckRoadFinished(Player *p)
TileIndex tile;
DiagDirection dir = p->ai.cur_dir_a;
uint32 bits;
int i;
are.dest = p->ai.cur_tile_b;
tile = TILE_MASK(p->ai.cur_tile_a + TileOffsByDiagDir(dir));
@@ -2865,7 +2862,8 @@ static bool AiCheckRoadFinished(Player *p)
are.best_dist = (uint)-1;
for_each_bit(i, bits) {
uint i;
FOR_EACH_SET_BIT(i, bits) {
FollowTrack(tile, 0x3000 | TRANSPORT_ROAD, ROADTYPES_ROAD, (DiagDirection)_dir_by_track[i], (TPFEnumProc*)AiEnumFollowRoad, NULL, &are);
}