Commit 14a071c4 authored by Daniel Chabrowski's avatar Daniel Chabrowski

Fix osx build

parent e601ebe1
...@@ -42,7 +42,6 @@ inline void append_int(T n, fmt::basic_memory_buffer<char, Buffer_Size> &dest) ...@@ -42,7 +42,6 @@ inline void append_int(T n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
dest.append(i.data(), i.data() + i.size()); dest.append(i.data(), i.data() + i.size());
} }
template<size_t Buffer_Size> template<size_t Buffer_Size>
inline void pad2(int n, fmt::basic_memory_buffer<char, Buffer_Size> &dest) inline void pad2(int n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
{ {
...@@ -66,17 +65,15 @@ inline void pad2(int n, fmt::basic_memory_buffer<char, Buffer_Size> &dest) ...@@ -66,17 +65,15 @@ inline void pad2(int n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
} }
} }
template<typename T, size_t Buffer_Size> template<typename T, size_t Buffer_Size>
inline void pad_uint(T n, unsigned int width, fmt::basic_memory_buffer<char, Buffer_Size> &dest) inline void pad_uint(T n, unsigned int width, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
{ {
static_assert(std::is_unsigned<T>::value, "append_uint must get unsigned T"); static_assert(std::is_unsigned<T>::value, "append_uint must get unsigned T");
auto digits = fmt::internal::count_digits(n); auto digits = fmt::internal::count_digits(static_cast<uint64_t>(n));
if(width > digits) if (width > digits)
{ {
const char* zeroes = "0000000000000000000"; const char *zeroes = "0000000000000000000";
dest.append(zeroes, zeroes + width-digits); dest.append(zeroes, zeroes + width - digits);
} }
append_int(n, dest); append_int(n, dest);
} }
...@@ -87,7 +84,6 @@ inline void pad3(T n, fmt::basic_memory_buffer<char, Buffer_Size> &dest) ...@@ -87,7 +84,6 @@ inline void pad3(T n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
pad_uint(n, 3, dest); pad_uint(n, 3, dest);
} }
template<typename T, size_t Buffer_Size> template<typename T, size_t Buffer_Size>
inline void pad6(T n, fmt::basic_memory_buffer<char, Buffer_Size> &dest) inline void pad6(T n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
{ {
...@@ -100,8 +96,6 @@ inline void pad9(T n, fmt::basic_memory_buffer<char, Buffer_Size> &dest) ...@@ -100,8 +96,6 @@ inline void pad9(T n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
pad_uint(n, 9, dest); pad_uint(n, 9, dest);
} }
// return fraction of a second of the given time_point. // return fraction of a second of the given time_point.
// e.g. // e.g.
// fraction<std::milliseconds>(tp) -> will return the millis part of the second // fraction<std::milliseconds>(tp) -> will return the millis part of the second
......
...@@ -487,7 +487,6 @@ public: ...@@ -487,7 +487,6 @@ public:
auto ns = fmt_helper::time_fraction<std::chrono::nanoseconds>(msg.time); auto ns = fmt_helper::time_fraction<std::chrono::nanoseconds>(msg.time);
fmt_helper::pad9(static_cast<size_t>(ns.count()), dest); fmt_helper::pad9(static_cast<size_t>(ns.count()), dest);
} }
}; };
...@@ -653,7 +652,7 @@ public: ...@@ -653,7 +652,7 @@ public:
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
{ {
const size_t field_size = fmt::internal::count_digits(msg.thread_id); const auto field_size = fmt::internal::count_digits(static_cast<uint64_t>(msg.thread_id));
scoped_pad p(field_size, padinfo_, dest); scoped_pad p(field_size, padinfo_, dest);
fmt_helper::append_int(msg.thread_id, dest); fmt_helper::append_int(msg.thread_id, dest);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment