From 87ec1ab97b738eca6206cb3ce819f4471f2a2904 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 19 Aug 2019 12:06:29 +0300 Subject: [PATCH] Fixed clang warnings --- include/spdlog/sinks/syslog_sink.h | 5 +++-- include/spdlog/sinks/systemd_sink.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index 43ffef6b..fe868c32 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -73,7 +73,8 @@ protected: bool enable_formatting_ = false; private: - std::array syslog_levels_; + using levels_array = std::array; + levels_array syslog_levels_; // must store the ident because the man says openlog might use the pointer as // is and not a string copy const std::string ident_; @@ -83,7 +84,7 @@ private: // int syslog_prio_from_level(const details::log_msg &msg) const { - return syslog_levels_.at(static_cast(msg.level)); + return syslog_levels_.at(static_cast(msg.level)); } }; diff --git a/include/spdlog/sinks/systemd_sink.h b/include/spdlog/sinks/systemd_sink.h index a0d6e31e..c63cf723 100644 --- a/include/spdlog/sinks/systemd_sink.h +++ b/include/spdlog/sinks/systemd_sink.h @@ -38,7 +38,8 @@ public: systemd_sink &operator=(const systemd_sink &) = delete; protected: - std::array syslog_levels_; + using levels_array = std::array; + levels_array syslog_levels_; void sink_it_(const details::log_msg &msg) override { @@ -72,7 +73,7 @@ protected: int syslog_level(level::level_enum l) { - return syslog_levels_.at(static_cast(l)); + return syslog_levels_.at(static_cast(l)); } void flush_() override {}