diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-26 15:30:15 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-26 15:30:15 +0200 |
| commit | 82ab34aa83463179339eb8382edf1c22cacdad61 (patch) | |
| tree | 3d02aaa7458a4f00e38527c7cfe0f8559398b5d5 /src/timer.cpp | |
| parent | c3bebd8c3263d67f3b66cab7437bc24f5ea724c8 (diff) | |
use array_size instead of std::size/arraySize
Diffstat (limited to 'src/timer.cpp')
| -rw-r--r-- | src/timer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/timer.cpp b/src/timer.cpp index ad78f383..4fdab61d 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -72,16 +72,16 @@ float Time::to_milliseconds(const Ns& ts) noexcept const char* format_datetime_to_string(char (&buf)[fm_DATETIME_BUF_SIZE]) { constexpr const char* fmt = "%a, %d %b %Y %H:%M:%S."; - constexpr size_t fmtsize = std::size("Thu 01 Mon 197000 00:00:00."); + constexpr size_t fmtsize = array_size("Thu 01 Mon 197000 00:00:00."); static_assert(static_array_size<decltype(buf)> - fmtsize == 4); const auto t = SystemClock::now(); const auto ms = duration_cast<Millis>(t.time_since_epoch()) % 1000; const auto time = SystemClock::to_time_t(t); const auto* tm = std::localtime(&time); - auto len = std::strftime(buf, std::size(buf), fmt, tm); + auto len = std::strftime(buf, array_size(buf), fmt, tm); fm_assert(len > 0 && len <= fmtsize); auto len2 = std::sprintf(buf + len, "%03u", unsigned{ms.count()}); - fm_assert(len2 > 0 && len + (size_t)len2 < std::size(buf)); + fm_assert(len2 > 0 && len + (size_t)len2 < array_size(buf)); return buf; } |
