diff --git a/src/log.h b/src/log.h index e51967b..d9d2ab2 100644 --- a/src/log.h +++ b/src/log.h @@ -146,7 +146,13 @@ COLOR_ENTRY(LightCyan, "\x1b[0;96m") template struct Stream::Entry { - static FORCEINLINE void put(const char (&data)[N], Stream* wrapper) { wrapper->writeBuf(data, N - 1); } + template + // cppcheck-suppress constParameterReference + static FORCEINLINE void put(T (&data)[N], Stream* wrapper) + { + static_assert(std::is_same::value, "Non-const char buffer must be cast to \"const char*\""); + wrapper->writeBuf(data, N - 1); + } }; template<> struct Stream::Entry diff --git a/src/p2pool.cpp b/src/p2pool.cpp index 8c0f332..da9cf9f 100644 --- a/src/p2pool.cpp +++ b/src/p2pool.cpp @@ -234,10 +234,10 @@ void p2pool::print_hosts() const } if (h.m_displayName == host.m_displayName) { - LOGINFO(0, log::LightCyan() << "-> " << h.m_displayName << buf); + LOGINFO(0, log::LightCyan() << "-> " << h.m_displayName << static_cast(buf)); } else { - LOGINFO(0, " " << h.m_displayName << buf); + LOGINFO(0, " " << h.m_displayName << static_cast(buf)); } } }