Fixed cppcheck errors

This commit is contained in:
SChernykh
2023-12-23 11:22:03 +01:00
parent bc36be1e58
commit f98d2e652a
5 changed files with 8 additions and 0 deletions

View File

@@ -213,6 +213,7 @@ NOINLINE bool difficulty_type::check_pow(const hash& pow_hash) const
std::ostream& operator<<(std::ostream& s, const difficulty_type& d)
{
char buf[log::Stream::BUF_SIZE + 1];
// cppcheck-suppress uninitvar
log::Stream s1(buf);
s1 << d << '\0';
s << buf;
@@ -251,6 +252,7 @@ std::istream& operator>>(std::istream& s, difficulty_type& diff)
std::ostream& operator<<(std::ostream& s, const hash& h)
{
char buf[log::Stream::BUF_SIZE + 1];
// cppcheck-suppress uninitvar
log::Stream s1(buf);
s1 << h << '\0';
s << buf;
@@ -401,6 +403,7 @@ struct BackgroundJobTracker::Impl
}
char buf[log::Stream::BUF_SIZE + 1];
// cppcheck-suppress uninitvar
log::Stream s(buf);
for (const auto& job : m_jobs) {
s << '\n' << job.first << " (" << job.second << ')';