summaryrefslogtreecommitdiff
path: root/src/yapf
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-10 00:31:47 +0000
committerrubidium <rubidium@openttd.org>2009-01-10 00:31:47 +0000
commit11da45ee55957c243854cd78705d81543541c061 (patch)
tree29e703244d28f29c8634b2d30f42b34852fe74bc /src/yapf
parentc3839648f75ebfdca2f7d95b7d6a2b29445ab1c2 (diff)
downloadopenttd-11da45ee55957c243854cd78705d81543541c061.tar.xz
(svn r14949) -Cleanup: pointer coding style
Diffstat (limited to 'src/yapf')
-rw-r--r--src/yapf/nodelist.hpp14
-rw-r--r--src/yapf/yapf.h8
-rw-r--r--src/yapf/yapf.hpp2
-rw-r--r--src/yapf/yapf_base.hpp8
-rw-r--r--src/yapf/yapf_costcache.hpp2
-rw-r--r--src/yapf/yapf_destrail.hpp4
-rw-r--r--src/yapf/yapf_node.hpp2
-rw-r--r--src/yapf/yapf_node_rail.hpp10
-rw-r--r--src/yapf/yapf_node_road.hpp2
-rw-r--r--src/yapf/yapf_rail.cpp10
-rw-r--r--src/yapf/yapf_road.cpp12
-rw-r--r--src/yapf/yapf_ship.cpp4
12 files changed, 39 insertions, 39 deletions
diff --git a/src/yapf/nodelist.hpp b/src/yapf/nodelist.hpp
index ede2169f8..e8c4fdc37 100644
--- a/src/yapf/nodelist.hpp
+++ b/src/yapf/nodelist.hpp
@@ -55,7 +55,7 @@ public:
/** return number of closed nodes */
FORCEINLINE int ClosedCount() {return m_closed.Count();}
/** allocate new data item from m_arr */
- FORCEINLINE Titem_* CreateNewNode()
+ FORCEINLINE Titem_ *CreateNewNode()
{
if (m_new_node == NULL) m_new_node = &m_arr.Add();
return m_new_node;
@@ -80,7 +80,7 @@ public:
m_new_node = NULL;
}
/** return the best open node */
- FORCEINLINE Titem_* GetBestOpenNode()
+ FORCEINLINE Titem_ *GetBestOpenNode()
{
if (!m_open_queue.IsEmpty()) {
Titem_& item = m_open_queue.GetHead();
@@ -89,7 +89,7 @@ public:
return NULL;
}
/** remove and return the best open node */
- FORCEINLINE Titem_* PopBestOpenNode()
+ FORCEINLINE Titem_ *PopBestOpenNode()
{
if (!m_open_queue.IsEmpty()) {
Titem_& item = m_open_queue.PopHead();
@@ -99,9 +99,9 @@ public:
return NULL;
}
/** return the open node specified by a key or NULL if not found */
- FORCEINLINE Titem_* FindOpenNode(const Key& key)
+ FORCEINLINE Titem_ *FindOpenNode(const Key& key)
{
- Titem_* item = m_open.Find(key);
+ Titem_ *item = m_open.Find(key);
return item;
}
/** remove and return the open node specified by a key */
@@ -119,9 +119,9 @@ public:
m_closed.Push(item);
}
/** return the closed node specified by a key or NULL if not found */
- FORCEINLINE Titem_* FindClosedNode(const Key& key)
+ FORCEINLINE Titem_ *FindClosedNode(const Key& key)
{
- Titem_* item = m_closed.Find(key);
+ Titem_ *item = m_closed.Find(key);
return item;
}
diff --git a/src/yapf/yapf.h b/src/yapf/yapf.h
index 45ba94eb3..6d42b2b7e 100644
--- a/src/yapf/yapf.h
+++ b/src/yapf/yapf.h
@@ -44,12 +44,12 @@ Trackdir YapfChooseRailTrack(const Vehicle *v, TileIndex tile, DiagDirection ent
* @param tile destination tile
* @return distance from origin tile to the destination (number of road tiles) or UINT_MAX if path not found
*/
-uint YapfRoadVehDistanceToTile(const Vehicle* v, TileIndex tile);
+uint YapfRoadVehDistanceToTile(const Vehicle *v, TileIndex tile);
/** Used when user sends RV to the nearest depot or if RV needs servicing.
* Returns the nearest depot (or NULL if depot was not found).
*/
-Depot* YapfFindNearestRoadDepot(const Vehicle *v);
+Depot *YapfFindNearestRoadDepot(const Vehicle *v);
/** Used when user sends train to the nearest depot or if train needs servicing.
* @param v train that needs to go to some depot
@@ -64,7 +64,7 @@ Depot* YapfFindNearestRoadDepot(const Vehicle *v);
bool YapfFindNearestRailDepotTwoWay(const Vehicle *v, int max_distance, int reverse_penalty, TileIndex *depot_tile, bool *reversed);
/** Returns true if it is better to reverse the train before leaving station */
-bool YapfCheckReverseTrain(const Vehicle* v);
+bool YapfCheckReverseTrain(const Vehicle *v);
/**
* Try to extend the reserved path of a train to the nearest safe tile.
@@ -81,7 +81,7 @@ bool YapfRailFindNearestSafeTile(const Vehicle *v, TileIndex tile, Trackdir td,
void YapfNotifyTrackLayoutChange(TileIndex tile, Track track);
/** performance measurement helpers */
-void* NpfBeginInterval();
+void *NpfBeginInterval();
int NpfEndInterval(void *perf);
diff --git a/src/yapf/yapf.hpp b/src/yapf/yapf.hpp
index 758d4d459..60d404804 100644
--- a/src/yapf/yapf.hpp
+++ b/src/yapf/yapf.hpp
@@ -51,7 +51,7 @@ struct CPerformanceTimer
struct CPerfStartReal
{
- CPerformanceTimer* m_pperf;
+ CPerformanceTimer *m_pperf;
FORCEINLINE CPerfStartReal(CPerformanceTimer& perf) : m_pperf(&perf) {if (m_pperf != NULL) m_pperf->Start();}
FORCEINLINE ~CPerfStartReal() {Stop();}
diff --git a/src/yapf/yapf_base.hpp b/src/yapf/yapf_base.hpp
index 418a36d9f..eb134b4a1 100644
--- a/src/yapf/yapf_base.hpp
+++ b/src/yapf/yapf_base.hpp
@@ -164,7 +164,7 @@ public:
/** If path was found return the best node that has reached the destination. Otherwise
* return the best visited node (which was nearest to the destination).
*/
- FORCEINLINE Node* GetBestNode()
+ FORCEINLINE Node *GetBestNode()
{
return (m_pBestDestNode != NULL) ? m_pBestDestNode : m_pBestIntermediateNode;
}
@@ -193,7 +193,7 @@ public:
}
/** add multiple nodes - direct children of the given node */
- FORCEINLINE void AddMultipleNodes(Node* parent, const TrackFollower &tf)
+ FORCEINLINE void AddMultipleNodes(Node *parent, const TrackFollower &tf)
{
bool is_choice = (KillFirstBit(tf.m_new_td_bits) != TRACKDIR_BIT_NONE);
for (TrackdirBits rtds = tf.m_new_td_bits; rtds != TRACKDIR_BIT_NONE; rtds = KillFirstBit(rtds)) {
@@ -242,7 +242,7 @@ public:
}
// check new node against open list
- Node* openNode = m_nodes.FindOpenNode(n.GetKey());
+ Node *openNode = m_nodes.FindOpenNode(n.GetKey());
if (openNode != NULL) {
// another node exists with the same key in the open list
// is it better than new one?
@@ -257,7 +257,7 @@ public:
}
// check new node against closed list
- Node* closedNode = m_nodes.FindClosedNode(n.GetKey());
+ Node *closedNode = m_nodes.FindClosedNode(n.GetKey());
if (closedNode != NULL) {
// another node exists with the same key in the closed list
// is it better than new one?
diff --git a/src/yapf/yapf_costcache.hpp b/src/yapf/yapf_costcache.hpp
index 964e638c3..07679822b 100644
--- a/src/yapf/yapf_costcache.hpp
+++ b/src/yapf/yapf_costcache.hpp
@@ -113,7 +113,7 @@ struct CSegmentCostCacheT
FORCEINLINE Tsegment& Get(Key& key, bool *found)
{
- Tsegment* item = m_map.Find(key);
+ Tsegment *item = m_map.Find(key);
if (item == NULL) {
*found = false;
item = new (&m_heap.AddNC()) Tsegment(key);
diff --git a/src/yapf/yapf_destrail.hpp b/src/yapf/yapf_destrail.hpp
index 2af12e271..624e5b974 100644
--- a/src/yapf/yapf_destrail.hpp
+++ b/src/yapf/yapf_destrail.hpp
@@ -117,7 +117,7 @@ protected:
static TileIndex CalcStationCenterTile(StationID station)
{
- const Station* st = GetStation(station);
+ const Station *st = GetStation(station);
/* If the rail station is (temporarily) not present, use the station sign to drive near the station */
if (!IsValidTile(st->train_tile)) return st->xy;
@@ -129,7 +129,7 @@ protected:
}
public:
- void SetDestination(const Vehicle* v)
+ void SetDestination(const Vehicle *v)
{
switch (v->current_order.GetType()) {
case OT_GOTO_STATION:
diff --git a/src/yapf/yapf_node.hpp b/src/yapf/yapf_node.hpp
index 5857e3a7d..16146a488 100644
--- a/src/yapf/yapf_node.hpp
+++ b/src/yapf/yapf_node.hpp
@@ -56,7 +56,7 @@ struct CYapfNodeT {
m_estimate = 0;
}
- FORCEINLINE Node* GetHashNext() {return m_hash_next;}
+ FORCEINLINE Node *GetHashNext() {return m_hash_next;}
FORCEINLINE void SetHashNext(Node *pNext) {m_hash_next = pNext;}
FORCEINLINE TileIndex GetTile() const {return m_key.m_tile;}
FORCEINLINE Trackdir GetTrackdir() const {return m_key.m_td;}
diff --git a/src/yapf/yapf_node_rail.hpp b/src/yapf/yapf_node_rail.hpp
index 0d7e5d4d9..4bb8f9868 100644
--- a/src/yapf/yapf_node_rail.hpp
+++ b/src/yapf/yapf_node_rail.hpp
@@ -86,7 +86,7 @@ DECLARE_ENUM_AS_BIT_SET(EndSegmentReasonBits);
inline CStrA ValueStr(EndSegmentReasonBits bits)
{
- static const char* end_segment_reason_names[] = {
+ static const char *end_segment_reason_names[] = {
"DEAD_END", "RAIL_TYPE", "INFINITE_LOOP", "SEGMENT_TOO_LONG", "CHOICE_FOLLOWS",
"DEPOT", "WAYPOINT", "STATION",
"PATH_TOO_LONG", "FIRST_TWO_WAY_RED", "LOOK_AHEAD_END", "TARGET_REACHED"
@@ -109,7 +109,7 @@ struct CYapfRailSegment
TileIndex m_last_signal_tile;
Trackdir m_last_signal_td;
EndSegmentReasonBits m_end_segment_reason;
- CYapfRailSegment* m_hash_next;
+ CYapfRailSegment *m_hash_next;
FORCEINLINE CYapfRailSegment(const CYapfRailSegmentKey& key)
: m_key(key)
@@ -124,8 +124,8 @@ struct CYapfRailSegment
FORCEINLINE const Key& GetKey() const {return m_key;}
FORCEINLINE TileIndex GetTile() const {return m_key.GetTile();}
- FORCEINLINE CYapfRailSegment* GetHashNext() {return m_hash_next;}
- FORCEINLINE void SetHashNext(CYapfRailSegment* next) {m_hash_next = next;}
+ FORCEINLINE CYapfRailSegment *GetHashNext() {return m_hash_next;}
+ FORCEINLINE void SetHashNext(CYapfRailSegment *next) {m_hash_next = next;}
void Dump(DumpTarget &dmp) const
{
@@ -159,7 +159,7 @@ struct CYapfRailNodeT
} flags_u;
SignalType m_last_red_signal_type;
- FORCEINLINE void Set(CYapfRailNodeT* parent, TileIndex tile, Trackdir td, bool is_choice)
+ FORCEINLINE void Set(CYapfRailNodeT *parent, TileIndex tile, Trackdir td, bool is_choice)
{
base::Set(parent, tile, td, is_choice);
m_segment = NULL;
diff --git a/src/yapf/yapf_node_road.hpp b/src/yapf/yapf_node_road.hpp
index 8d6fd2978..b4521b5fc 100644
--- a/src/yapf/yapf_node_road.hpp
+++ b/src/yapf/yapf_node_road.hpp
@@ -17,7 +17,7 @@ struct CYapfRoadNodeT
TileIndex m_segment_last_tile;
Trackdir m_segment_last_td;
- void Set(CYapfRoadNodeT* parent, TileIndex tile, Trackdir td, bool is_choice)
+ void Set(CYapfRoadNodeT *parent, TileIndex tile, Trackdir td, bool is_choice)
{
base::Set(parent, tile, td, is_choice);
m_segment_last_tile = tile;
diff --git a/src/yapf/yapf_rail.cpp b/src/yapf/yapf_rail.cpp
index 619e0177b..2e2b917ca 100644
--- a/src/yapf/yapf_rail.cpp
+++ b/src/yapf/yapf_rail.cpp
@@ -188,7 +188,7 @@ public:
/// return debug report character to identify the transportation type
FORCEINLINE char TransportTypeChar() const {return 't';}
- static bool stFindNearestDepotTwoWay(const Vehicle *v, TileIndex t1, Trackdir td1, TileIndex t2, Trackdir td2, int max_distance, int reverse_penalty, TileIndex* depot_tile, bool* reversed)
+ static bool stFindNearestDepotTwoWay(const Vehicle *v, TileIndex t1, Trackdir td1, TileIndex t2, Trackdir td2, int max_distance, int reverse_penalty, TileIndex *depot_tile, bool *reversed)
{
Tpf pf1;
bool result1 = pf1.FindNearestDepotTwoWay(v, t1, td1, t2, td2, max_distance, reverse_penalty, depot_tile, reversed);
@@ -207,7 +207,7 @@ public:
return result1;
}
- FORCEINLINE bool FindNearestDepotTwoWay(const Vehicle *v, TileIndex t1, Trackdir td1, TileIndex t2, Trackdir td2, int max_distance, int reverse_penalty, TileIndex* depot_tile, bool* reversed)
+ FORCEINLINE bool FindNearestDepotTwoWay(const Vehicle *v, TileIndex t1, Trackdir td1, TileIndex t2, Trackdir td2, int max_distance, int reverse_penalty, TileIndex *depot_tile, bool *reversed)
{
// set origin and destination nodes
Yapf().SetOrigin(t1, td1, t2, td2, reverse_penalty, true);
@@ -307,7 +307,7 @@ public:
this->SetReservationTarget(pNode, pNode->GetLastTile(), pNode->GetLastTrackdir());
/* Walk through the path back to the origin. */
- Node* pPrev = NULL;
+ Node *pPrev = NULL;
while (pNode->m_parent != NULL) {
pPrev = pNode;
pNode = pNode->m_parent;
@@ -401,7 +401,7 @@ public:
// path was found or at least suggested
// walk through the path back to the origin
- Node* pPrev = NULL;
+ Node *pPrev = NULL;
while (pNode->m_parent != NULL) {
pPrev = pNode;
pNode = pNode->m_parent;
@@ -502,7 +502,7 @@ Trackdir YapfChooseRailTrack(const Vehicle *v, TileIndex tile, DiagDirection ent
return td_ret;
}
-bool YapfCheckReverseTrain(const Vehicle* v)
+bool YapfCheckReverseTrain(const Vehicle *v)
{
/* last wagon */
const Vehicle *last_veh = GetLastVehicleInChain(v);
diff --git a/src/yapf/yapf_road.cpp b/src/yapf/yapf_road.cpp
index 6186f1ac1..ed0be31f1 100644
--- a/src/yapf/yapf_road.cpp
+++ b/src/yapf/yapf_road.cpp
@@ -363,13 +363,13 @@ public:
return true;
}
- static Depot* stFindNearestDepot(const 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(const 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));
@@ -383,7 +383,7 @@ public:
Node *n = Yapf().GetBestNode();
TileIndex depot_tile = n->m_segment_last_tile;
assert(IsRoadDepotTile(depot_tile));
- Depot* ret = GetDepotByTile(depot_tile);
+ Depot *ret = GetDepotByTile(depot_tile);
return ret;
}
};
@@ -444,7 +444,7 @@ uint YapfRoadVehDistanceToTile(const Vehicle *v, TileIndex tile)
return dist;
}
-Depot* YapfFindNearestRoadDepot(const Vehicle *v)
+Depot *YapfFindNearestRoadDepot(const Vehicle *v)
{
TileIndex tile = v->tile;
Trackdir trackdir = GetVehicleTrackdir(v);
@@ -458,13 +458,13 @@ Depot* YapfFindNearestRoadDepot(const Vehicle *v)
}
// default is YAPF type 2
- typedef Depot* (*PfnFindNearestDepot)(const Vehicle*, TileIndex, Trackdir);
+ typedef Depot *(*PfnFindNearestDepot)(const Vehicle*, TileIndex, Trackdir);
PfnFindNearestDepot pfnFindNearestDepot = &CYapfRoadAnyDepot2::stFindNearestDepot;
// check if non-default YAPF type should be used
if (_settings_game.pf.yapf.disable_node_optimization)
pfnFindNearestDepot = &CYapfRoadAnyDepot1::stFindNearestDepot; // Trackdir, allow 90-deg
- Depot* ret = pfnFindNearestDepot(v, tile, trackdir);
+ Depot *ret = pfnFindNearestDepot(v, tile, trackdir);
return ret;
}
diff --git a/src/yapf/yapf_ship.cpp b/src/yapf/yapf_ship.cpp
index 9c935388f..6f75cba17 100644
--- a/src/yapf/yapf_ship.cpp
+++ b/src/yapf/yapf_ship.cpp
@@ -65,10 +65,10 @@ public:
Trackdir next_trackdir = INVALID_TRACKDIR; // this would mean "path not found"
- Node* pNode = pf.GetBestNode();
+ Node *pNode = pf.GetBestNode();
if (pNode != NULL) {
// walk through the path back to the origin
- Node* pPrevNode = NULL;
+ Node *pPrevNode = NULL;
while (pNode->m_parent != NULL) {
pPrevNode = pNode;
pNode = pNode->m_parent;