From f22783c78cd849436489367ed4f943d63e733a13 Mon Sep 17 00:00:00 2001 From: Pavel Artsishevsky Date: Sat, 30 Nov 2024 20:06:57 +0100 Subject: [PATCH] Fix static analyzer warnings Signed-off-by: Pavel Artsishevsky --- include/slimlog/logger.h | 2 +- include/slimlog/util/os.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/slimlog/logger.h b/include/slimlog/logger.h index 5879fc6..125e55a 100644 --- a/include/slimlog/logger.h +++ b/include/slimlog/logger.h @@ -165,7 +165,7 @@ class Logger { * @return \b true if the sink is enabled. * @return \b false if the sink is disabled. */ - auto sink_enabled(const std::shared_ptr>& sink) const -> bool + [[nodiscard]] auto sink_enabled(const std::shared_ptr>& sink) const -> bool { return m_sinks.sink_enabled(sink); } diff --git a/include/slimlog/util/os.h b/include/slimlog/util/os.h index e61c357..a22c97e 100644 --- a/include/slimlog/util/os.h +++ b/include/slimlog/util/os.h @@ -58,7 +58,7 @@ inline auto localtime_s(Args... /*unused*/) } // namespace Fallback struct LocalTime { - explicit LocalTime(const std::time_t& time) + explicit LocalTime(std::time_t time) : m_time(time) { } @@ -103,7 +103,7 @@ struct LocalTime { } private: - const std::time_t& m_time; + const std::time_t m_time; std::tm* m_tm{nullptr}; };