mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 18:11:33 +08:00
Fixed missing braces around initializer warnings about std::array initializations
This commit is contained in:
parent
90801267ee
commit
3b425affd3
@ -396,8 +396,8 @@ SPDLOG_INLINE bool is_color_terminal() SPDLOG_NOEXCEPT
|
||||
#ifdef _WIN32
|
||||
return true;
|
||||
#else
|
||||
static constexpr std::array<const char *, 14> Terms = {
|
||||
"ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux", "msys", "putty", "rxvt", "screen", "vt100", "xterm"};
|
||||
static constexpr std::array<const char *, 14> 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)
|
||||
|
@ -152,7 +152,7 @@ static int to12h(const tm &t)
|
||||
}
|
||||
|
||||
// Abbreviated weekday name
|
||||
static std::array<const char *, 7> days{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
|
||||
static std::array<const char *, 7> days{{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}};
|
||||
|
||||
template<typename ScopedPadder>
|
||||
class a_formatter : public flag_formatter
|
||||
@ -171,7 +171,7 @@ public:
|
||||
};
|
||||
|
||||
// Full weekday name
|
||||
static std::array<const char *, 7> full_days{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
|
||||
static std::array<const char *, 7> full_days{{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}};
|
||||
|
||||
template<typename ScopedPadder>
|
||||
class A_formatter : public flag_formatter
|
||||
@ -190,7 +190,7 @@ public:
|
||||
};
|
||||
|
||||
// Abbreviated month
|
||||
static const std::array<const char *, 12> months{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"};
|
||||
static const std::array<const char *, 12> months{{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"}};
|
||||
|
||||
template<typename ScopedPadder>
|
||||
class b_formatter : public flag_formatter
|
||||
@ -209,8 +209,8 @@ public:
|
||||
};
|
||||
|
||||
// Full month name
|
||||
static const std::array<const char *, 12> full_months{
|
||||
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
|
||||
static const std::array<const char *, 12> full_months{{
|
||||
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}};
|
||||
|
||||
template<typename ScopedPadder>
|
||||
class B_formatter : public flag_formatter
|
||||
|
@ -22,13 +22,13 @@ class syslog_sink : public base_sink<Mutex>
|
||||
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
|
||||
|
@ -23,13 +23,13 @@ class systemd_sink : public base_sink<Mutex>
|
||||
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 {}
|
||||
|
Loading…
Reference in New Issue
Block a user