diff options
author | truebrain <truebrain@openttd.org> | 2011-12-20 17:57:56 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-20 17:57:56 +0000 |
commit | 1c9bec19993417b1f3b240f2bdb0745aa26c0cb3 (patch) | |
tree | d09407cc962ee87ac1bbbbc60951cad74c6b1db7 /src/pathfinder/yapf/yapf_costcache.hpp | |
parent | 7a38642a1c83531a65907ae784bc03a82d35132a (diff) | |
download | openttd-1c9bec19993417b1f3b240f2bdb0745aa26c0cb3.tar.xz |
(svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC)
Diffstat (limited to 'src/pathfinder/yapf/yapf_costcache.hpp')
-rw-r--r-- | src/pathfinder/yapf/yapf_costcache.hpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/pathfinder/yapf/yapf_costcache.hpp b/src/pathfinder/yapf/yapf_costcache.hpp index ee4cee25c..7a568b703 100644 --- a/src/pathfinder/yapf/yapf_costcache.hpp +++ b/src/pathfinder/yapf/yapf_costcache.hpp @@ -30,7 +30,7 @@ public: * Called by YAPF to attach cached or local segment cost data to the given node. * @return true if globally cached data were used or false if local data was used */ - FORCEINLINE bool PfNodeCacheFetch(Node& n) + inline bool PfNodeCacheFetch(Node& n) { return false; } @@ -39,7 +39,7 @@ public: * Called by YAPF to flush the cached segment cost data back into cache storage. * Current cache implementation doesn't use that. */ - FORCEINLINE void PfNodeCacheFlush(Node& n) + inline void PfNodeCacheFlush(Node& n) { } }; @@ -65,7 +65,7 @@ protected: LocalCache m_local_cache; /** to access inherited path finder */ - FORCEINLINE Tpf& Yapf() + inline Tpf& Yapf() { return *static_cast<Tpf*>(this); } @@ -75,7 +75,7 @@ public: * Called by YAPF to attach cached or local segment cost data to the given node. * @return true if globally cached data were used or false if local data was used */ - FORCEINLINE bool PfNodeCacheFetch(Node& n) + inline bool PfNodeCacheFetch(Node& n) { CacheKey key(n.GetKey()); Yapf().ConnectNodeToCachedData(n, *new (m_local_cache.Append()) CachedData(key)); @@ -86,7 +86,7 @@ public: * Called by YAPF to flush the cached segment cost data back into cache storage. * Current cache implementation doesn't use that. */ - FORCEINLINE void PfNodeCacheFlush(Node& n) + inline void PfNodeCacheFlush(Node& n) { } }; @@ -133,16 +133,16 @@ struct CSegmentCostCacheT HashTable m_map; Heap m_heap; - FORCEINLINE CSegmentCostCacheT() {} + inline CSegmentCostCacheT() {} /** flush (clear) the cache */ - FORCEINLINE void Flush() + inline void Flush() { m_map.Clear(); m_heap.Clear(); } - FORCEINLINE Tsegment& Get(Key& key, bool *found) + inline Tsegment& Get(Key& key, bool *found) { Tsegment *item = m_map.Find(key); if (item == NULL) { @@ -177,15 +177,15 @@ public: protected: Cache& m_global_cache; - FORCEINLINE CYapfSegmentCostCacheGlobalT() : m_global_cache(stGetGlobalCache()) {}; + inline CYapfSegmentCostCacheGlobalT() : m_global_cache(stGetGlobalCache()) {}; /** to access inherited path finder */ - FORCEINLINE Tpf& Yapf() + inline Tpf& Yapf() { return *static_cast<Tpf*>(this); } - FORCEINLINE static Cache& stGetGlobalCache() + inline static Cache& stGetGlobalCache() { static int last_rail_change_counter = 0; static Date last_date = 0; @@ -211,7 +211,7 @@ public: * Called by YAPF to attach cached or local segment cost data to the given node. * @return true if globally cached data were used or false if local data was used */ - FORCEINLINE bool PfNodeCacheFetch(Node& n) + inline bool PfNodeCacheFetch(Node& n) { if (!Yapf().CanUseGlobalCache(n)) { return Tlocal::PfNodeCacheFetch(n); @@ -227,7 +227,7 @@ public: * Called by YAPF to flush the cached segment cost data back into cache storage. * Current cache implementation doesn't use that. */ - FORCEINLINE void PfNodeCacheFlush(Node& n) + inline void PfNodeCacheFlush(Node& n) { } }; |