clang fixes

pull/2/head
SChernykh 3 years ago
parent 133b8dde19
commit 4a5691e349

2
.gitignore vendored

@ -0,0 +1,2 @@
build

@ -166,6 +166,10 @@ INT_ENTRY(uint16_t)
INT_ENTRY(uint32_t)
INT_ENTRY(uint64_t)
#ifdef __clang__
INT_ENTRY(unsigned long)
#endif
#undef INT_ENTRY
template<typename T, int base>
@ -287,24 +291,6 @@ template<> struct log::Stream::Entry<std::string>
static FORCEINLINE void put(const std::string& value, Stream* wrapper) { wrapper->writeBuf(value.c_str(), value.length()); }
};
template<char... digits> struct to_str { static const char s[]; };
template<char... digits> constexpr char to_str<digits...>::s[] = { ('0' + digits)..., 0 };
template<uint64_t N, char... digits>
struct Str : Str<N / 10, N % 10, digits...> {};
template<char... digits>
struct Str<0, digits...> : to_str<digits...> {};
template<uint64_t N, char... digits>
struct log::Stream::Entry<Str<N, digits...>>
{
static FORCEINLINE void put(Str<N, digits...>&& value, Stream* wrapper)
{
wrapper->writeBuf(value.s, sizeof(value.s) - 1);
}
};
struct Hashrate
{
explicit FORCEINLINE Hashrate(uint64_t data) : m_data(data) {}

@ -447,7 +447,7 @@ bool TCPServer<READ_BUF_SIZE, WRITE_BUF_SIZE>::send_internal(Client* client, Sen
const size_t bytes_written = callback(buf->m_data);
if (bytes_written > sizeof(buf->m_data)) {
LOGERR(0, "send callback wrote " << bytes_written << " bytes, expected no more than " << log::Str<sizeof(buf->m_data)>() << " bytes");
LOGERR(0, "send callback wrote " << bytes_written << " bytes, expected no more than " << sizeof(buf->m_data) << " bytes");
panic();
}

Loading…
Cancel
Save