From 3b425affd34078aba4bd9b54aa1d22eb111525a3 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 21 Sep 2019 15:13:50 +0300 Subject: [PATCH] Fixed missing braces around initializer warnings about std::array initializations --- include/spdlog/details/os-inl.h | 4 ++-- include/spdlog/details/pattern_formatter-inl.h | 10 +++++----- include/spdlog/sinks/syslog_sink.h | 4 ++-- include/spdlog/sinks/systemd_sink.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h index 8252921e..d510d2ac 100644 --- a/include/spdlog/details/os-inl.h +++ b/include/spdlog/details/os-inl.h @@ -396,8 +396,8 @@ SPDLOG_INLINE bool is_color_terminal() SPDLOG_NOEXCEPT #ifdef _WIN32 return true; #else - static constexpr std::array Terms = { - "ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux", "msys", "putty", "rxvt", "screen", "vt100", "xterm"}; + static constexpr std::array Terms = {{ + "ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux", "msys", "putty", "rxvt", "screen", "vt100", "xterm"}}; const char *env_p = std::getenv("TERM"); if (env_p == nullptr) diff --git a/include/spdlog/details/pattern_formatter-inl.h b/include/spdlog/details/pattern_formatter-inl.h index 1f39bbb6..4b9c0ce3 100644 --- a/include/spdlog/details/pattern_formatter-inl.h +++ b/include/spdlog/details/pattern_formatter-inl.h @@ -152,7 +152,7 @@ static int to12h(const tm &t) } // Abbreviated weekday name -static std::array days{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; +static std::array days{{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}}; template class a_formatter : public flag_formatter @@ -171,7 +171,7 @@ public: }; // Full weekday name -static std::array full_days{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; +static std::array full_days{{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}}; template class A_formatter : public flag_formatter @@ -190,7 +190,7 @@ public: }; // Abbreviated month -static const std::array months{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"}; +static const std::array months{{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"}}; template class b_formatter : public flag_formatter @@ -209,8 +209,8 @@ public: }; // Full month name -static const std::array full_months{ - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; +static const std::array full_months{{ + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}}; template class B_formatter : public flag_formatter diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index fd5ed536..697ba241 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -22,13 +22,13 @@ class syslog_sink : public base_sink public: syslog_sink(std::string ident, int syslog_option, int syslog_facility, bool enable_formatting) : enable_formatting_{enable_formatting} - , syslog_levels_{/* spdlog::level::trace */ LOG_DEBUG, + , syslog_levels_{{/* spdlog::level::trace */ LOG_DEBUG, /* spdlog::level::debug */ LOG_DEBUG, /* spdlog::level::info */ LOG_INFO, /* spdlog::level::warn */ LOG_WARNING, /* spdlog::level::err */ LOG_ERR, /* spdlog::level::critical */ LOG_CRIT, - /* spdlog::level::off */ LOG_INFO} + /* spdlog::level::off */ LOG_INFO}} , ident_{std::move(ident)} { // set ident to be program name if empty diff --git a/include/spdlog/sinks/systemd_sink.h b/include/spdlog/sinks/systemd_sink.h index c63cf723..c45a9f66 100644 --- a/include/spdlog/sinks/systemd_sink.h +++ b/include/spdlog/sinks/systemd_sink.h @@ -23,13 +23,13 @@ class systemd_sink : public base_sink public: // systemd_sink() - : syslog_levels_{/* spdlog::level::trace */ LOG_DEBUG, + : syslog_levels_{{/* spdlog::level::trace */ LOG_DEBUG, /* spdlog::level::debug */ LOG_DEBUG, /* spdlog::level::info */ LOG_INFO, /* spdlog::level::warn */ LOG_WARNING, /* spdlog::level::err */ LOG_ERR, /* spdlog::level::critical */ LOG_CRIT, - /* spdlog::level::off */ LOG_INFO} + /* spdlog::level::off */ LOG_INFO}} {} ~systemd_sink() override {}