mirror of
https://github.com/gabime/spdlog.git
synced 2026-04-10 11:34:29 +08:00
Fixd some clang-tidy warnings
This commit is contained in:
@@ -84,12 +84,12 @@ spdlog::log_clock::time_point now() noexcept {
|
||||
#endif
|
||||
}
|
||||
std::tm localtime(const std::time_t &time_tt) noexcept {
|
||||
std::tm* rv;
|
||||
std::tm tm;
|
||||
#ifdef _WIN32
|
||||
rv = ::localtime_s(&tm, &time_tt);
|
||||
std::tm tm;
|
||||
const auto *rv = ::localtime_s(&tm, &time_tt);
|
||||
#else
|
||||
rv = ::localtime_r(&time_tt, &tm);
|
||||
std::tm tm;
|
||||
const auto *rv = ::localtime_r(&time_tt, &tm);
|
||||
#endif
|
||||
return rv != nullptr ? tm : std::tm{};
|
||||
}
|
||||
@@ -548,7 +548,7 @@ std::string getenv(const char *field) {
|
||||
#endif
|
||||
#else // revert to getenv
|
||||
char *buf = ::getenv(field);
|
||||
return buf ? buf : std::string{};
|
||||
return buf != nullptr ? buf : std::string{};
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user