summaryrefslogtreecommitdiff
path: root/src/waypoint.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/waypoint.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/waypoint.h')
-rw-r--r--src/waypoint.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/waypoint.h b/src/waypoint.h
index eedef025b..7e6f9f12a 100644
--- a/src/waypoint.h
+++ b/src/waypoint.h
@@ -40,8 +40,8 @@ struct Waypoint : PoolItem<Waypoint, WaypointID, &_Waypoint_pool> {
inline bool IsValid() const { return this->xy != INVALID_TILE; }
};
-#define FOR_ALL_WAYPOINTS_FROM(wp, start) for (wp = Waypoint::Get(start); wp != NULL; wp = (wp->index + 1U < Waypoint::GetPoolSize()) ? Waypoint::Get(wp->index + 1U) : NULL) if (wp->IsValid())
-#define FOR_ALL_WAYPOINTS(wp) FOR_ALL_WAYPOINTS_FROM(wp, 0)
+#define FOR_ALL_WAYPOINTS_FROM(var, start) FOR_ALL_ITEMS_FROM(Waypoint, waypoint_index, var, start)
+#define FOR_ALL_WAYPOINTS(var) FOR_ALL_WAYPOINTS_FROM(var, 0)
/**