industry_cmd.c
changeset 2630 7206058a7e82
parent 2598 d69238b81415
child 2637 722dae65c4a8
--- a/industry_cmd.c	Sat Nov 12 11:10:12 2005 +0000
+++ b/industry_cmd.c	Sun Nov 13 13:43:55 2005 +0000
@@ -38,8 +38,8 @@
 /* Initialize the industry-pool */
 MemoryPool _industry_pool = { "Industry", INDUSTRY_POOL_MAX_BLOCKS, INDUSTRY_POOL_BLOCK_SIZE_BITS, sizeof(Industry), &IndustryPoolNewBlock, 0, 0, NULL };
 
-byte _industry_sound_ctr;
-TileIndex _industry_sound_tile;
+static byte _industry_sound_ctr;
+static TileIndex _industry_sound_tile;
 
 void ShowIndustryViewWindow(int industry);
 void BuildOilRig(TileIndex tile);
@@ -341,7 +341,7 @@
 
 static void DrawTile_Industry(TileInfo *ti)
 {
-	Industry *ind;
+	const Industry* ind;
 	const DrawIndustryTileStruct *dits;
 	byte z;
 	uint32 image, ormod;
@@ -425,7 +425,7 @@
 
 static void GetTileDesc_Industry(TileIndex tile, TileDesc *td)
 {
-	Industry *i = GetIndustry(_m[tile].m2);
+	const Industry* i = GetIndustry(_m[tile].m2);
 
 	td->owner = i->owner;
 	td->str = STR_4802_COAL_MINE + i->type;
@@ -863,7 +863,8 @@
 
 static void GetProducedCargo_Industry(TileIndex tile, byte *b)
 {
-	Industry *i = GetIndustry(_m[tile].m2);
+	const Industry* i = GetIndustry(_m[tile].m2);
+
 	b[0] = i->produced_cargo[0];
 	b[1] = i->produced_cargo[1];
 }
@@ -1262,10 +1263,10 @@
 	return true;
 }
 
-static Town *CheckMultipleIndustryInTown(TileIndex tile, int type)
+static const Town* CheckMultipleIndustryInTown(TileIndex tile, int type)
 {
-	Town *t;
-	Industry *i;
+	const Town* t;
+	const Industry* i;
 
 	t = ClosestTownFromTile(tile, (uint)-1);
 
@@ -1309,7 +1310,7 @@
 	16, 16, 16, 16, 16, 16, 16,
 };
 
-static bool CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable *it, int type, Town *t)
+static bool CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable* it, int type, const Town* t)
 {
 	TileInfo ti;
 
@@ -1451,7 +1452,7 @@
 	return AddBlockToPool(&_industry_pool) ? AllocateIndustry() : NULL;
 }
 
-static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const IndustryTileTable *it, Town *t, byte owner)
+static void DoCreateNewIndustry(Industry* i, TileIndex tile, int type, const IndustryTileTable* it, const Town* t, byte owner)
 {
 	const IndustrySpec *spec;
 	uint32 r;
@@ -1547,7 +1548,7 @@
  */
 int32 CmdBuildIndustry(int x, int y, uint32 flags, uint32 p1, uint32 p2)
 {
-	Town *t;
+	const Town* t;
 	Industry *i;
 	TileIndex tile = TileVirtXY(x, y);
 	int num;
@@ -1601,7 +1602,7 @@
 
 Industry *CreateNewIndustry(TileIndex tile, int type)
 {
-	Town *t;
+	const Town* t;
 	const IndustryTileTable *it;
 	Industry *i;