summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-12-14 06:20:23 +0000
committertron <tron@openttd.org>2005-12-14 06:20:23 +0000
commit23bfc03054c52065006a73d8cebdeee068784892 (patch)
tree5042ddfac1e3c26fb99ea38d0bd4b90959a93d61
parentce94c90a7b966c0bff294f2b582068d984ba172c (diff)
downloadopenttd-23bfc03054c52065006a73d8cebdeee068784892.tar.xz
(svn r3297) Staticise
-rw-r--r--ai/ai.c2
-rw-r--r--aircraft_cmd.c2
-rw-r--r--airport.c11
-rw-r--r--newgrf.c4
-rw-r--r--oldloader.c2
-rw-r--r--queue.c4
-rw-r--r--rail_cmd.c4
-rw-r--r--station_cmd.c2
-rw-r--r--table/autorail.h4
-rw-r--r--train_cmd.c2
-rw-r--r--vehicle.c2
-rw-r--r--waypoint.c6
12 files changed, 24 insertions, 21 deletions
diff --git a/ai/ai.c b/ai/ai.c
index 8142f1444..15d08bb54 100644
--- a/ai/ai.c
+++ b/ai/ai.c
@@ -25,7 +25,7 @@ static uint uids[MAX_PLAYERS];
/**
* Dequeues commands put in the queue via AI_PutCommandInQueue.
*/
-void AI_DequeueCommands(byte player)
+static void AI_DequeueCommands(byte player)
{
AICommand *com, *entry_com;
diff --git a/aircraft_cmd.c b/aircraft_cmd.c
index 06aef2916..4ec0b531f 100644
--- a/aircraft_cmd.c
+++ b/aircraft_cmd.c
@@ -121,7 +121,7 @@ void DrawAircraftEngine(int x, int y, EngineID engine, uint32 image_ormod)
}
}
-int32 EstimateAircraftCost(EngineID engine_type)
+static int32 EstimateAircraftCost(EngineID engine_type)
{
return AircraftVehInfo(engine_type)->base_cost * (_price.aircraft_base>>3)>>5;
}
diff --git a/airport.c b/airport.c
index f9c62a63b..a3fbf3af9 100644
--- a/airport.c
+++ b/airport.c
@@ -8,11 +8,12 @@
#include "macros.h"
#include "variables.h"
-AirportFTAClass *CountryAirport;
-AirportFTAClass *CityAirport;
-AirportFTAClass *Heliport, *Oilrig;
-AirportFTAClass *MetropolitanAirport;
-AirportFTAClass *InternationalAirport;
+static AirportFTAClass* CountryAirport;
+static AirportFTAClass* CityAirport;
+static AirportFTAClass* Oilrig;
+static AirportFTAClass* Heliport;
+static AirportFTAClass* MetropolitanAirport;
+static AirportFTAClass* InternationalAirport;
static void AirportFTAClass_Constructor(AirportFTAClass *Airport,
const byte *terminals, const byte *helipads,
diff --git a/newgrf.c b/newgrf.c
index 5396ef323..362accd28 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -1276,7 +1276,7 @@ static void VehicleChangeInfo(byte *buf, int len)
* @param value The value that was used to represent this callback result
* @return A spritegroup representing that callback result
*/
-SpriteGroup *NewCallBackResultSpriteGroup(uint16 value)
+static SpriteGroup* NewCallBackResultSpriteGroup(uint16 value)
{
SpriteGroup *group = calloc(1, sizeof(*group));
@@ -1300,7 +1300,7 @@ SpriteGroup *NewCallBackResultSpriteGroup(uint16 value)
* @param sprites The number of sprites per set.
* @return A spritegroup representing the sprite number result.
*/
-SpriteGroup *NewResultSpriteGroup(uint16 value, byte sprites)
+static SpriteGroup* NewResultSpriteGroup(uint16 value, byte sprites)
{
SpriteGroup *group = calloc(1, sizeof(*group));
group->type = SGT_RESULT;
diff --git a/oldloader.c b/oldloader.c
index b11482891..e25b6b9f1 100644
--- a/oldloader.c
+++ b/oldloader.c
@@ -455,7 +455,7 @@ static uint32 _old_town_index;
static uint16 _old_string_id;
static uint16 _old_string_id_2;
-void ReadTTDPatchFlags(void)
+static void ReadTTDPatchFlags(void)
{
int i;
diff --git a/queue.c b/queue.c
index b5a018d42..2fad5c3ed 100644
--- a/queue.c
+++ b/queue.c
@@ -504,7 +504,8 @@ void delete_Hash(Hash* h, bool free_values) {
free(h);
}
-void stat_Hash(Hash* h)
+#ifdef HASH_STATS
+static void stat_Hash(Hash* h)
{
uint used_buckets = 0;
uint max_collision = 0;
@@ -546,6 +547,7 @@ void stat_Hash(Hash* h)
}
printf ("}\n");
}
+#endif
void clear_Hash(Hash* h, bool free_values)
{
diff --git a/rail_cmd.c b/rail_cmd.c
index bab602ade..7264ab9f6 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -1304,7 +1304,7 @@ static void DetTrackDrawProc_Null(const TileInfo *ti)
}
typedef void DetailedTrackProc(const TileInfo *ti);
-DetailedTrackProc * const _detailed_track_proc[16] = {
+static DetailedTrackProc* const _detailed_track_proc[] = {
DetTrackDrawProc_Null,
DetTrackDrawProc_Null,
@@ -1719,7 +1719,7 @@ static void *SignalVehicleCheckProc(Vehicle *v, void *data)
}
/* Special check for SetSignalsAfterProc, to see if there is a vehicle on this tile */
-bool SignalVehicleCheck(TileIndex tile, uint track)
+static bool SignalVehicleCheck(TileIndex tile, uint track)
{
SignalVehicleCheckStruct dest;
diff --git a/station_cmd.c b/station_cmd.c
index e6f0cc580..c7357863a 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -1343,7 +1343,7 @@ int32 DoConvertStationRail(TileIndex tile, uint totype, bool exec)
return _price.build_rail >> 1;
}
-void FindRoadStationSpot(bool truck_station, Station *st, RoadStop ***currstop, RoadStop **prev)
+static void FindRoadStationSpot(bool truck_station, Station* st, RoadStop*** currstop, RoadStop** prev)
{
RoadStop **primary_stop;
diff --git a/table/autorail.h b/table/autorail.h
index 2519aa6a8..1968d90c6 100644
--- a/table/autorail.h
+++ b/table/autorail.h
@@ -13,7 +13,7 @@
// table maps each of the six rail directions and tileh combinations to a sprite
// invalid entries are required to make sure that this array can be quickly accessed
-const int _AutorailTilehSprite[31][6] = {
+static const int _AutorailTilehSprite[][6] = {
// type 0 1 2 3 4 5
{ 0, 8, 16, 25, 34, 42 }, // tileh = 0
{ 5, 13, RED(22), RED(31), 35, 42 }, // tileh = 1
@@ -52,7 +52,7 @@ const int _AutorailTilehSprite[31][6] = {
// maps each pixel of a tile (16x16) to a selection type
// (0,0) is the top corner, (16,16) the bottom corner
-const byte _AutorailPiece[16][16] = {
+static const byte _AutorailPiece[][16] = {
{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
diff --git a/train_cmd.c b/train_cmd.c
index 2689da67f..faae38584 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -36,7 +36,7 @@ static const byte _state_dir_table[4] = { 0x20, 8, 0x10, 4 };
* the consist changes.
* @param v First vehicle of the consist.
*/
-void TrainCargoChanged(Vehicle* v)
+static void TrainCargoChanged(Vehicle* v)
{
Vehicle *u;
uint16 weight = 0;
diff --git a/vehicle.c b/vehicle.c
index f87c075d4..4c1619565 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -597,7 +597,7 @@ void VehicleEnteredDepotThisTick(Vehicle *v)
}
}
-VehicleTickProc *_vehicle_tick_procs[] = {
+static VehicleTickProc* _vehicle_tick_procs[] = {
Train_Tick,
RoadVeh_Tick,
Ship_Tick,
diff --git a/waypoint.c b/waypoint.c
index 53844a609..8d323eb3a 100644
--- a/waypoint.c
+++ b/waypoint.c
@@ -41,7 +41,7 @@ static void WaypointPoolNewBlock(uint start_item)
MemoryPool _waypoint_pool = { "Waypoints", WAYPOINT_POOL_MAX_BLOCKS, WAYPOINT_POOL_BLOCK_SIZE_BITS, sizeof(Waypoint), &WaypointPoolNewBlock, 0, 0, NULL };
/* Create a new waypoint */
-Waypoint *AllocateWaypoint(void)
+static Waypoint* AllocateWaypoint(void)
{
Waypoint *wp;
@@ -72,7 +72,7 @@ void UpdateWaypointSign(Waypoint *wp)
}
/* Redraw the sign of a waypoint */
-void RedrawWaypointSign(Waypoint *wp)
+static void RedrawWaypointSign(const Waypoint* wp)
{
MarkAllViewportsDirty(
wp->sign.left - 6,
@@ -93,7 +93,7 @@ void UpdateAllWaypointSigns(void)
}
/* Set the default name for a waypoint */
-void MakeDefaultWaypointName(Waypoint *wp)
+static void MakeDefaultWaypointName(Waypoint* wp)
{
Waypoint *local_wp;
bool used_waypoint[MAX_WAYPOINTS_PER_TOWN];