(svn r16377) -Codechange: unify FOR_ALL_* macros, use separate index variable instead of var->index

This commit is contained in:
smatz
2009-05-22 14:23:36 +00:00
parent 70d3ed15c8
commit 7eb14aa49f
16 changed files with 42 additions and 37 deletions

View File

@@ -326,8 +326,8 @@ static inline Town *GetRandomTown()
Town *CalcClosestTownFromTile(TileIndex tile, uint threshold = UINT_MAX);
#define FOR_ALL_TOWNS_FROM(t, start) for (t = Town::Get(start); t != NULL; t = (t->index + 1U < Town::GetPoolSize()) ? Town::Get(t->index + 1U) : NULL) if (t->IsValid())
#define FOR_ALL_TOWNS(t) FOR_ALL_TOWNS_FROM(t, 0)
#define FOR_ALL_TOWNS_FROM(var, start) FOR_ALL_ITEMS_FROM(Town, town_index, var, start)
#define FOR_ALL_TOWNS(var) FOR_ALL_TOWNS_FROM(var, 0)
extern Town *_cleared_town;
extern int _cleared_town_rating;