summaryrefslogtreecommitdiff
path: root/src/cargopacket.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/cargopacket.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/cargopacket.h')
-rw-r--r--src/cargopacket.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cargopacket.h b/src/cargopacket.h
index 74b9287b7..739e7f3ed 100644
--- a/src/cargopacket.h
+++ b/src/cargopacket.h
@@ -60,16 +60,16 @@ struct CargoPacket : PoolItem<CargoPacket, CargoPacketID, &_CargoPacket_pool> {
/**
* Iterate over all _valid_ cargo packets from the given start
- * @param cp the variable used as "iterator"
+ * @param var the variable used as "iterator"
* @param start the cargo packet ID of the first packet to iterate over
*/
-#define FOR_ALL_CARGOPACKETS_FROM(cp, start) for (cp = CargoPacket::Get(start); cp != NULL; cp = (cp->index + 1U < CargoPacket::GetPoolSize()) ? CargoPacket::Get(cp->index + 1U) : NULL) if (cp->IsValid())
+#define FOR_ALL_CARGOPACKETS_FROM(var, start) FOR_ALL_ITEMS_FROM(CargoPacket, cargopacket_index, var, start)
/**
* Iterate over all _valid_ cargo packets from the begin of the pool
- * @param cp the variable used as "iterator"
+ * @param var the variable used as "iterator"
*/
-#define FOR_ALL_CARGOPACKETS(cp) FOR_ALL_CARGOPACKETS_FROM(cp, 0)
+#define FOR_ALL_CARGOPACKETS(var) FOR_ALL_CARGOPACKETS_FROM(var, 0)
extern const struct SaveLoad *GetGoodsDesc();