diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-06-24 18:42:47 +0000 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-06-24 18:42:47 +0000 |
commit | ac1646ab851b1d4727ada8d74da9c3648ecf98de (patch) | |
tree | 72929b4ad5f3ec21719ae025b5b51bef37094bc8 /src/utils/performance.cpp | |
parent | b0052ff6b29c0f8222b7b9b659e2750b2470fb18 (diff) | |
download | manaplus-ac1646ab851b1d4727ada8d74da9c3648ecf98de.tar.gz manaplus-ac1646ab851b1d4727ada8d74da9c3648ecf98de.tar.bz2 manaplus-ac1646ab851b1d4727ada8d74da9c3648ecf98de.tar.xz manaplus-ac1646ab851b1d4727ada8d74da9c3648ecf98de.zip |
Fix profiler compile
call of overloaded 'toString(long long unsigned int)' is ambiguous, see !189
Squashed with:
* Apply perfo[r]mance typofixes that were missed in mana/plus!186
... because USE_PROFILER was off/undefined.
****
mana/plus!200
Diffstat (limited to 'src/utils/performance.cpp')
-rw-r--r-- | src/utils/performance.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/utils/performance.cpp b/src/utils/performance.cpp index ccc232aa4..e18e848e4 100644 --- a/src/utils/performance.cpp +++ b/src/utils/performance.cpp @@ -28,6 +28,7 @@ #include "configuration.h" #include "game.h" +#include "utils/cast.h" #include "utils/timer.h" #include <algorithm> @@ -41,8 +42,8 @@ static const clockid_t clockType = CLOCK_MONOTONIC; -#define timeData ((static_cast<long long int>(time.tv_sec) * 1000000000LL \ - + static_cast<long long int>(time.tv_nsec)) / 1) +#define timeData \ + (CAST_U64(time.tv_sec) * 1000000000LL + CAST_U64(time.tv_nsec)) namespace Performance { @@ -69,24 +70,26 @@ namespace Performance { timespec time; clock_gettime(clockType, &time); - temp.append(toString(timeData - startTime)).append( - " __init__\n"); + temp.append(toString(CAST_U64(timeData - startTime))) + .append(" __init__\n"); } void blockStart(const std::string &name) { timespec time; clock_gettime(clockType, &time); - temp.append(toString(timeData - startTime)).append( - " start: ").append(name).append("\n"); + temp.append(toString(CAST_U64(timeData - startTime))) + .append(" start: ") + .append(name).append("\n"); } void blockEnd(const std::string &name) { timespec time; clock_gettime(clockType, &time); - temp.append(toString(timeData - startTime)).append( - " end: ").append(name).append("\n"); + temp.append(toString(CAST_U64(timeData - startTime))) + .append(" end: ") + .append(name).append("\n"); } void flush() |