(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

@@ -24,7 +24,7 @@ struct Depot : PoolItem<Depot, DepotID, &_Depot_pool> {
Depot *GetDepotByTile(TileIndex tile);
#define FOR_ALL_DEPOTS_FROM(d, start) for (d = Depot::Get(start); d != NULL; d = (d->index + 1U < Depot::GetPoolSize()) ? Depot::Get(d->index + 1U) : NULL) if (d->IsValid())
#define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0)
#define FOR_ALL_DEPOTS_FROM(var, start) FOR_ALL_ITEMS_FROM(Depot, depot_index, var, start)
#define FOR_ALL_DEPOTS(var) FOR_ALL_DEPOTS_FROM(var, 0)
#endif /* DEPOT_BASE_H */