(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

@@ -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)
/**