diff options
author | tron <tron@openttd.org> | 2006-09-03 08:25:27 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-09-03 08:25:27 +0000 |
commit | 1c21c645ae04601cd3711b37e6541d807cb727a7 (patch) | |
tree | 79ebec494a87cd0b8e16e577740868f5bf90a7d2 /openttd.h | |
parent | 302772883ce9dd965ca6dfe9ade85530c6de8210 (diff) | |
download | openttd-1c21c645ae04601cd3711b37e6541d807cb727a7.tar.xz |
(svn r6353) -Codechange: Make DestinationID a typedef of uin16, which is as large as any type of destinataion (StationID, DepotID, WaypointID) it can hold
DestinationID being a union of these types is just hassle without benefit and cannot be handled correctly everywhere because of local lack of information
Diffstat (limited to 'openttd.h')
-rw-r--r-- | openttd.h | 20 |
1 files changed, 7 insertions, 13 deletions
@@ -57,20 +57,14 @@ typedef uint16 WaypointID; typedef uint16 OrderID; typedef uint16 SignID; typedef uint16 EngineRenewID; +typedef uint16 DestinationID; -typedef union DestinationID { - StationID station; - DepotID depot; - WaypointID waypoint; - uint16 disaster; ///< Please don't ask about it, but disasters uses orders to store stuff... -} DestinationID; - -/* All items of DestinationID has to be of the same size, because some part - * of the code depends on the fact that DestinationID is the same for all - * items inside DestinationID. Check PackOrder() */ -assert_compile(sizeof(StationID) == sizeof(DepotID)); -assert_compile(sizeof(StationID) == sizeof(WaypointID)); -assert_compile(sizeof(StationID) == sizeof(uint16)); +/* DestinationID must be at least as large as every these below, because it can + * be any of them + */ +assert_compile(sizeof(DestinationID) == sizeof(DepotID)); +assert_compile(sizeof(DestinationID) == sizeof(WaypointID)); +assert_compile(sizeof(DestinationID) == sizeof(StationID)); typedef uint32 WindowNumber; typedef byte WindowClass; |