format_time/src/format_time_ns.cpp : Replaced STRING_BUFFER_SIZE with STR_BUFFER_SIZE

This commit is contained in:
saundersp
2025-07-30 11:26:27 +02:00
parent 7f1752ba3f
commit 939b373b22

View File

@@ -9,8 +9,6 @@ static constexpr const std::array<const char* const, N_TIMES> time_formats = { "
static constexpr const std::array<const uint64_t, N_TIMES> time_numbers = { 1, 1000, 1000000, u64(1e9), u64(6e10), u64(36e11), u64(864e11), static constexpr const std::array<const uint64_t, N_TIMES> time_numbers = { 1, 1000, 1000000, u64(1e9), u64(6e10), u64(36e11), u64(864e11),
u64(6048e11), u64(26298e11), u64(315576e11), u64(315576e13) }; u64(6048e11), u64(26298e11), u64(315576e11), u64(315576e13) };
#define STRING_BUFFER_SIZE 64
/** /**
* @brief Convert a given number of nanoseconds to a human readable format * @brief Convert a given number of nanoseconds to a human readable format
* *
@@ -18,7 +16,7 @@ static constexpr const std::array<const uint64_t, N_TIMES> time_numbers = { 1, 1
* @return Human readable formatted string * @return Human readable formatted string
*/ */
std::string format_time_ns(uint64_t time) noexcept { std::string format_time_ns(uint64_t time) noexcept {
char s[STRING_BUFFER_SIZE] = {0}; char s[STR_BUFFER_SIZE] = {0};
size_t j = 0; size_t j = 0;
if (time == 0){ if (time == 0){