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/pf_performance_timer.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/pf_performance_timer.hpp')
-rw-r--r-- | src/pathfinder/pf_performance_timer.hpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pathfinder/pf_performance_timer.hpp b/src/pathfinder/pf_performance_timer.hpp index 2f4662cbb..808542d25 100644 --- a/src/pathfinder/pf_performance_timer.hpp +++ b/src/pathfinder/pf_performance_timer.hpp @@ -21,27 +21,27 @@ struct CPerformanceTimer CPerformanceTimer() : m_start(0), m_acc(0) {} - FORCEINLINE void Start() + inline void Start() { m_start = QueryTime(); } - FORCEINLINE void Stop() + inline void Stop() { m_acc += QueryTime() - m_start; } - FORCEINLINE int Get(int64 coef) + inline int Get(int64 coef) { return (int)(m_acc * coef / QueryFrequency()); } - FORCEINLINE int64 QueryTime() + inline int64 QueryTime() { return ottd_rdtsc(); } - FORCEINLINE int64 QueryFrequency() + inline int64 QueryFrequency() { return ((int64)2200 * 1000000); } @@ -51,17 +51,17 @@ struct CPerfStartReal { CPerformanceTimer *m_pperf; - FORCEINLINE CPerfStartReal(CPerformanceTimer& perf) : m_pperf(&perf) + inline CPerfStartReal(CPerformanceTimer& perf) : m_pperf(&perf) { if (m_pperf != NULL) m_pperf->Start(); } - FORCEINLINE ~CPerfStartReal() + inline ~CPerfStartReal() { Stop(); } - FORCEINLINE void Stop() + inline void Stop() { if (m_pperf != NULL) { m_pperf->Stop(); @@ -72,9 +72,9 @@ struct CPerfStartReal struct CPerfStartFake { - FORCEINLINE CPerfStartFake(CPerformanceTimer& perf) {} - FORCEINLINE ~CPerfStartFake() {} - FORCEINLINE void Stop() {} + inline CPerfStartFake(CPerformanceTimer& perf) {} + inline ~CPerfStartFake() {} + inline void Stop() {} }; typedef CPerfStartFake CPerfStart; |