(svn r6005) -Cleanup: introduce IndustryID and use it
authorrubidium
Sun, 20 Aug 2006 19:31:58 +0000
changeset 4330 cf31daa8b321
parent 4329 0e6e689f66e7
child 4331 ec584824ffb8
(svn r6005) -Cleanup: introduce IndustryID and use it
-Cleanup: use TownID and StationID for two instances of uint16
economy.c
industry.h
industry_cmd.c
industry_map.h
openttd.h
town_cmd.c
--- a/economy.c	Sun Aug 20 19:05:28 2006 +0000
+++ b/economy.c	Sun Aug 20 19:31:58 2006 +0000
@@ -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;
--- a/industry.h	Sun Aug 20 19:05:28 2006 +0000
+++ b/industry.h	Sun Aug 20 19:31:58 2006 +0000
@@ -35,7 +35,7 @@
 	Year last_prod_year;
 	byte was_cargo_delivered;
 
-	uint16 index;
+	IndustryID index;
 };
 
 typedef struct IndustryTileTable {
--- a/industry_cmd.c	Sun Aug 20 19:05:28 2006 +0000
+++ b/industry_cmd.c	Sun Aug 20 19:31:58 2006 +0000
@@ -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;
 
--- a/industry_map.h	Sun Aug 20 19:05:28 2006 +0000
+++ b/industry_map.h	Sun Aug 20 19:31:58 2006 +0000
@@ -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;
--- a/openttd.h	Sun Aug 20 19:05:28 2006 +0000
+++ b/openttd.h	Sun Aug 20 19:31:58 2006 +0000
@@ -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;
--- a/town_cmd.c	Sun Aug 20 19:05:28 2006 +0000
+++ b/town_cmd.c	Sun Aug 20 19:31:58 2006 +0000
@@ -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;