# HG changeset patch # User rubidium # Date 1156102318 0 # Node ID 0b698c3335ab95a8b145d41533c7241a5e7b778a # Parent 802bb06b06cf3dc6953e073b034f9099a063842f (svn r6005) -Cleanup: introduce IndustryID and use it -Cleanup: use TownID and StationID for two instances of uint16 diff --git a/economy.c b/economy.c --- a/economy.c +++ b/economy.c @@ -844,7 +844,7 @@ return tp; } -void DeleteSubsidyWithIndustry(uint16 index) +void DeleteSubsidyWithIndustry(IndustryID index) { Subsidy *s; @@ -857,7 +857,7 @@ } } -void DeleteSubsidyWithStation(uint16 index) +void DeleteSubsidyWithStation(StationID index) { Subsidy *s; bool dirty = false; diff --git a/industry.h b/industry.h --- a/industry.h +++ b/industry.h @@ -35,7 +35,7 @@ Year last_prod_year; byte was_cargo_delivered; - uint16 index; + IndustryID index; }; typedef struct IndustryTileTable { diff --git a/industry_cmd.c b/industry_cmd.c --- a/industry_cmd.c +++ b/industry_cmd.c @@ -811,7 +811,7 @@ } while (--size); } -static void PlantFarmField(TileIndex tile, uint16 industry) +static void PlantFarmField(TileIndex tile, IndustryID industry) { uint size_x, size_y; uint32 r; @@ -1404,7 +1404,7 @@ FOR_ALL_INDUSTRIES(i) { if (i->xy == 0) { - uint index = i->index; + IndustryID index = i->index; if (i->index > _total_industries) _total_industries = i->index; diff --git a/industry_map.h b/industry_map.h --- a/industry_map.h +++ b/industry_map.h @@ -28,7 +28,7 @@ GFX_TOY_FACTORY = 143 }; -static inline uint GetIndustryIndex(TileIndex t) +static inline IndustryID GetIndustryIndex(TileIndex t) { assert(IsTileType(t, MP_INDUSTRY)); return _m[t].m2; @@ -95,7 +95,7 @@ _m[t].m5 = gfx; } -static inline void MakeIndustry(TileIndex t, uint index, IndustryGfx gfx) +static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx) { SetTileType(t, MP_INDUSTRY); _m[t].m1 = 0; diff --git a/openttd.h b/openttd.h --- a/openttd.h +++ b/openttd.h @@ -38,6 +38,7 @@ typedef uint16 VehicleID; typedef uint16 StationID; typedef uint16 TownID; +typedef uint16 IndustryID; typedef byte PlayerID; typedef byte OrderID; typedef byte CargoID; diff --git a/town_cmd.c b/town_cmd.c --- a/town_cmd.c +++ b/town_cmd.c @@ -951,7 +951,7 @@ Town *t; FOR_ALL_TOWNS(t) { if (t->xy == 0) { - uint index = t->index; + TownID index = t->index; if (t->index > _total_towns) _total_towns = t->index;