Fixed some analizer warnings

This commit is contained in:
gabime 2024-12-06 12:08:29 +02:00
parent b789fb52dd
commit 28ea21b241
4 changed files with 7 additions and 13 deletions

View File

@ -150,5 +150,5 @@ void bench_mt(int howmany, std::shared_ptr<spdlog::logger> logger, int thread_co
auto delta = high_resolution_clock::now() - start;
auto delta_d = duration_cast<duration<double>>(delta).count();
spdlog::info("Elapsed: {} secs\t {:L}/sec", delta_d, int(howmany / delta_d));
spdlog::info("Elapsed: {} secs\t {:L}/sec", delta_d, static_cast<int>(howmany / delta_d));
}

View File

@ -116,7 +116,7 @@ void bench(int howmany, std::shared_ptr<spdlog::logger> log) {
auto delta_d = duration_cast<duration<double>>(delta).count();
spdlog::info(spdlog::fmt_lib::format(std::locale("en_US.UTF-8"), "{:<30} Elapsed: {:0.2f} secs {:>16L}/sec", log->name(),
delta_d, size_t(howmany / delta_d)));
delta_d, static_cast<size_t>(howmany / delta_d)));
}
void bench_mt(int howmany, std::shared_ptr<spdlog::logger> log, size_t thread_count) {
@ -142,7 +142,7 @@ void bench_mt(int howmany, std::shared_ptr<spdlog::logger> log, size_t thread_co
auto delta = high_resolution_clock::now() - start;
auto delta_d = duration_cast<duration<double>>(delta).count();
spdlog::info(spdlog::fmt_lib::format(std::locale("en_US.UTF-8"), "{:<30} Elapsed: {:0.2f} secs {:>16L}/sec", log->name(),
delta_d, size_t(howmany / delta_d)));
delta_d, static_cast<size_t>(howmany / delta_d)));
}
/*

View File

@ -88,10 +88,8 @@ inline details::dump_info<It> to_hex(const It range_begin, const It range_end, s
} // namespace spdlog
namespace fmt {
template <typename T>
struct formatter<spdlog::details::dump_info<T>, char> {
struct fmt::formatter<spdlog::details::dump_info<T>, char> {
const char delimiter = ' ';
bool put_newlines = true;
bool put_delimiters = true;
@ -202,5 +200,4 @@ struct formatter<spdlog::details::dump_info<T>, char> {
spdlog::fmt_lib::format_to(inserter, SPDLOG_FMT_STRING("{:04X}: "), pos);
}
}
};
} // namespace fmt
}; // namespace fmt

View File

@ -51,13 +51,10 @@ public:
} // namespace spdlog
// Support for fmt formatting (e.g. "{:012.9}" or just "{}")
namespace fmt {
template <>
struct formatter<spdlog::stopwatch> : formatter<double> {
struct fmt::formatter<spdlog::stopwatch> : formatter<double> {
template <typename FormatContext>
auto format(const spdlog::stopwatch &sw, FormatContext &ctx) const -> decltype(ctx.out()) {
return formatter<double>::format(sw.elapsed().count(), ctx);
}
};
} // namespace fmt
}; // namespace fmt