mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-12 17:00:25 +08:00
Fixed some analizer warnings
This commit is contained in:
parent
b789fb52dd
commit
28ea21b241
@ -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 = high_resolution_clock::now() - start;
|
||||||
auto delta_d = duration_cast<duration<double>>(delta).count();
|
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));
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ void bench(int howmany, std::shared_ptr<spdlog::logger> log) {
|
|||||||
auto delta_d = duration_cast<duration<double>>(delta).count();
|
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(),
|
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) {
|
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 = high_resolution_clock::now() - start;
|
||||||
auto delta_d = duration_cast<duration<double>>(delta).count();
|
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(),
|
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)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -88,10 +88,8 @@ inline details::dump_info<It> to_hex(const It range_begin, const It range_end, s
|
|||||||
|
|
||||||
} // namespace spdlog
|
} // namespace spdlog
|
||||||
|
|
||||||
namespace fmt {
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct formatter<spdlog::details::dump_info<T>, char> {
|
struct fmt::formatter<spdlog::details::dump_info<T>, char> {
|
||||||
const char delimiter = ' ';
|
const char delimiter = ' ';
|
||||||
bool put_newlines = true;
|
bool put_newlines = true;
|
||||||
bool put_delimiters = 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);
|
spdlog::fmt_lib::format_to(inserter, SPDLOG_FMT_STRING("{:04X}: "), pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}; // namespace fmt
|
||||||
} // namespace fmt
|
|
||||||
|
@ -51,13 +51,10 @@ public:
|
|||||||
} // namespace spdlog
|
} // namespace spdlog
|
||||||
|
|
||||||
// Support for fmt formatting (e.g. "{:012.9}" or just "{}")
|
// Support for fmt formatting (e.g. "{:012.9}" or just "{}")
|
||||||
namespace fmt {
|
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct formatter<spdlog::stopwatch> : formatter<double> {
|
struct fmt::formatter<spdlog::stopwatch> : formatter<double> {
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const spdlog::stopwatch &sw, FormatContext &ctx) const -> decltype(ctx.out()) {
|
auto format(const spdlog::stopwatch &sw, FormatContext &ctx) const -> decltype(ctx.out()) {
|
||||||
return formatter<double>::format(sw.elapsed().count(), ctx);
|
return formatter<double>::format(sw.elapsed().count(), ctx);
|
||||||
}
|
}
|
||||||
};
|
}; // namespace fmt
|
||||||
} // namespace fmt
|
|
||||||
|
Loading…
Reference in New Issue
Block a user