summaryrefslogtreecommitdiff
path: root/yapf
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-10-28 12:43:15 +0000
committertron <tron@openttd.org>2006-10-28 12:43:15 +0000
commit9c219888ba02429e94cb58c915c77f2390aaa33e (patch)
tree194c249d0f6085307f6dcf9c1f801502d84553fb /yapf
parent0bd9e333a1ceb7ce107a16221dc3704446bb4be3 (diff)
downloadopenttd-9c219888ba02429e94cb58c915c77f2390aaa33e.tar.xz
(svn r6992) Make a const_cast<> obsolete by properly propagating the type
Diffstat (limited to 'yapf')
-rw-r--r--yapf/yapf_road.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/yapf/yapf_road.cpp b/yapf/yapf_road.cpp
index 2a4680b8c..47dd91e54 100644
--- a/yapf/yapf_road.cpp
+++ b/yapf/yapf_road.cpp
@@ -345,13 +345,13 @@ public:
return true;
}
- static Depot* stFindNearestDepot(Vehicle* v, TileIndex tile, Trackdir td)
+ static Depot* stFindNearestDepot(const Vehicle* v, TileIndex tile, Trackdir td)
{
Tpf pf;
return pf.FindNearestDepot(v, tile, td);
}
- FORCEINLINE Depot* FindNearestDepot(Vehicle* v, TileIndex tile, Trackdir td)
+ FORCEINLINE Depot* FindNearestDepot(const Vehicle* v, TileIndex tile, Trackdir td)
{
// set origin and destination nodes
Yapf().SetOrigin(tile, TrackdirToTrackdirBits(td));
@@ -440,13 +440,13 @@ Depot* YapfFindNearestRoadDepot(const Vehicle *v)
}
// default is YAPF type 2
- typedef Depot* (*PfnFindNearestDepot)(Vehicle*, TileIndex, Trackdir);
+ typedef Depot* (*PfnFindNearestDepot)(const Vehicle*, TileIndex, Trackdir);
PfnFindNearestDepot pfnFindNearestDepot = &CYapfRoadAnyDepot2::stFindNearestDepot;
// check if non-default YAPF type should be used
if (_patches.yapf.disable_node_optimization)
pfnFindNearestDepot = &CYapfRoadAnyDepot1::stFindNearestDepot; // Trackdir, allow 90-deg
- Depot* ret = pfnFindNearestDepot(const_cast<Vehicle*>(v), tile, trackdir);
+ Depot* ret = pfnFindNearestDepot(v, tile, trackdir);
return ret;
}