summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-13 13:43:55 +0000
committertron <tron@openttd.org>2005-11-13 13:43:55 +0000
commit81e5b16d7178f0ee5584201cb2f6c8e36742354f (patch)
tree385ce09aff7cf19e072a627e83e91fe8a5f3fb3b /train_cmd.c
parentd97f56b4e2b6159e696128932da28b89a13a30e0 (diff)
downloadopenttd-81e5b16d7178f0ee5584201cb2f6c8e36742354f.tar.xz
(svn r3172) static, const
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 71013483d..24c696f0c 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -188,9 +188,10 @@ enum AccelType {
AM_BRAKE
};
-static bool TrainShouldStop(Vehicle *v, TileIndex tile)
+static bool TrainShouldStop(const Vehicle* v, TileIndex tile)
{
- Order *o = &v->current_order;
+ const Order* o = &v->current_order;
+
assert(v->type == VEH_Train);
assert(IsTileType(v->tile, MP_STATION));
//When does a train drive through a station
@@ -590,9 +591,9 @@ static int32 CmdBuildRailWagon(EngineID engine, TileIndex tile, uint32 flags)
}
// Move all free vehicles in the depot to the train
-static void NormalizeTrainVehInDepot(Vehicle *u)
+static void NormalizeTrainVehInDepot(const Vehicle* u)
{
- Vehicle *v;
+ const Vehicle* v;
FOR_ALL_VEHICLES(v) {
if (v->type == VEH_Train && v->subtype == TS_Free_Car &&
@@ -624,7 +625,7 @@ static const byte _railveh_score[] = {
};
-int32 EstimateTrainCost(const RailVehicleInfo *rvi)
+static int32 EstimateTrainCost(const RailVehicleInfo* rvi)
{
return (rvi->base_cost * (_price.build_railvehicle >> 3)) >> 5;
}
@@ -1443,7 +1444,7 @@ static void AdvanceWagons(Vehicle *v, bool before)
}
}
-TileIndex GetVehicleTileOutOfTunnel(const Vehicle *v, bool reverse)
+static TileIndex GetVehicleTileOutOfTunnel(const Vehicle* v, bool reverse)
{
TileIndex tile;
byte direction = (!reverse) ? DirToDiagdir(v->direction) : ReverseDiagdir(v->direction >> 1);
@@ -1859,9 +1860,9 @@ static const int8 _vehicle_smoke_pos[8] = {
1, 1, 1, 0, -1, -1, -1, 0
};
-static void HandleLocomotiveSmokeCloud(Vehicle *v)
+static void HandleLocomotiveSmokeCloud(const Vehicle* v)
{
- Vehicle *u;
+ const Vehicle* u;
if (v->vehstatus & VS_TRAIN_SLOWING || v->load_unload_time_rem != 0 || v->cur_speed < 2)
return;
@@ -2054,7 +2055,7 @@ static bool NtpCallbFindStation(TileIndex tile, TrainTrackFollowerData *ttfd, in
}
}
-static void FillWithStationData(TrainTrackFollowerData *fd, Vehicle *v)
+static void FillWithStationData(TrainTrackFollowerData* fd, const Vehicle* v)
{
fd->dest_coords = v->dest_tile;
if (v->current_order.type == OT_GOTO_STATION)
@@ -3535,7 +3536,7 @@ void TrainEnterDepot(Vehicle *v, TileIndex tile)
static void CheckIfTrainNeedsService(Vehicle *v)
{
- Depot *depot;
+ const Depot* depot;
TrainFindDepotData tfdd;
if (PBSTileReserved(v->tile) & v->u.rail.track)