summaryrefslogtreecommitdiff
path: root/src/station_base.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-05-22 14:23:36 +0000
committersmatz <smatz@openttd.org>2009-05-22 14:23:36 +0000
commit04723b240ebc7384954f73590be517ad2a47ce04 (patch)
treeac4bd41288d9d96a256ea0c702d1a75502bfecd9 /src/station_base.h
parentb687ac51ee5e8628ed56319df573c903c0c86ef3 (diff)
downloadopenttd-04723b240ebc7384954f73590be517ad2a47ce04.tar.xz
(svn r16377) -Codechange: unify FOR_ALL_* macros, use separate index variable instead of var->index
Diffstat (limited to 'src/station_base.h')
-rw-r--r--src/station_base.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/station_base.h b/src/station_base.h
index 2fa332a70..218f1aa9e 100644
--- a/src/station_base.h
+++ b/src/station_base.h
@@ -204,14 +204,14 @@ public:
uint GetCatchmentRadius() const;
};
-#define FOR_ALL_STATIONS_FROM(st, start) for (st = Station::Get(start); st != NULL; st = (st->index + 1U < Station::GetPoolSize()) ? Station::Get(st->index + 1U) : NULL) if (st->IsValid())
-#define FOR_ALL_STATIONS(st) FOR_ALL_STATIONS_FROM(st, 0)
+#define FOR_ALL_STATIONS_FROM(var, start) FOR_ALL_ITEMS_FROM(Station, station_index, var, start)
+#define FOR_ALL_STATIONS(var) FOR_ALL_STATIONS_FROM(var, 0)
/* Stuff for ROADSTOPS */
-#define FOR_ALL_ROADSTOPS_FROM(rs, start) for (rs = RoadStop::Get(start); rs != NULL; rs = (rs->index + 1U < RoadStop::GetPoolSize()) ? RoadStop::Get(rs->index + 1U) : NULL) if (rs->IsValid())
-#define FOR_ALL_ROADSTOPS(rs) FOR_ALL_ROADSTOPS_FROM(rs, 0)
+#define FOR_ALL_ROADSTOPS_FROM(var, start) FOR_ALL_ITEMS_FROM(RoadStop, roadstop_index, var, start)
+#define FOR_ALL_ROADSTOPS(var) FOR_ALL_ROADSTOPS_FROM(var, 0)
/* End of stuff for ROADSTOPS */