Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShen-Ta Hsieh <beststeve@secondstate.io>2022-07-21 15:24:01 +0300
committerShen-Ta Hsieh <beststeve@secondstate.io>2022-07-21 15:24:01 +0300
commit5f8877b665bfabc863e62f8611bb67a92cd349f4 (patch)
treeddd5a52fe9b4af8a59032895ffad29589b76cb0c /include
parent834840636cb52242d0fae2d6233c90067a4248dc (diff)
Explicitly casting level_enum to size_t.
See commit 2a4c34b8785137eba9da7eb4cbb28b4162218272
Diffstat (limited to 'include')
-rw-r--r--include/spdlog/sinks/wincolor_sink-inl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h
index be3d80a2..8311929e 100644
--- a/include/spdlog/sinks/wincolor_sink-inl.h
+++ b/include/spdlog/sinks/wincolor_sink-inl.h
@@ -45,7 +45,7 @@ template<typename ConsoleMutex>
void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::set_color(level::level_enum level, std::uint16_t color)
{
std::lock_guard<mutex_t> lock(mutex_);
- colors_[level] = color;
+ colors_[static_cast<size_t>(level)] = color;
}
template<typename ConsoleMutex>
@@ -66,7 +66,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg)
// before color range
print_range_(formatted, 0, msg.color_range_start);
// in color range
- auto orig_attribs = static_cast<WORD>(set_foreground_color_(colors_[msg.level]));
+ auto orig_attribs = static_cast<WORD>(set_foreground_color_(colors_[static_cast<size_t>(msg.level)]));
print_range_(formatted, msg.color_range_start, msg.color_range_end);
// reset to orig colors
::SetConsoleTextAttribute(static_cast<HANDLE>(out_handle_), orig_attribs);