From 04723b240ebc7384954f73590be517ad2a47ce04 Mon Sep 17 00:00:00 2001 From: smatz Date: Fri, 22 May 2009 14:23:36 +0000 Subject: (svn r16377) -Codechange: unify FOR_ALL_* macros, use separate index variable instead of var->index --- src/waypoint.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/waypoint.h') 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 { 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) /** -- cgit v1.2.3-54-g00ecf