add default cases

Adding default case for cases where the compilation flag
-Wswitch-default is present on the command line when spdlog is
included in external projects.

Signed-off-by: Ryan Sherlock <ryan.m.sherlock@gmail.com>
This commit is contained in:
Ryan Sherlock 2021-03-19 15:57:06 +00:00 committed by Ryan Sherlock
parent 44e1f9f682
commit 3aee89c8fd
3 changed files with 8 additions and 0 deletions

View File

@ -1350,6 +1350,8 @@ FMT_CONSTEXPR_DECL FMT_INLINE auto visit_format_arg(
return vis(arg.value_.pointer);
case detail::type::custom_type:
return vis(typename basic_format_arg<Context>::handle(arg.value_.custom));
default:
break;
}
return vis(monostate());
}

View File

@ -2814,6 +2814,8 @@ FMT_CONSTEXPR const Char* parse_align(const Char* begin, const Char* end,
case '^':
align = align::center;
break;
default:
break;
}
if (align != align::none) {
if (p != begin) {
@ -2897,6 +2899,8 @@ FMT_CONSTEXPR const Char* parse_format_specs(const Char* begin, const Char* end,
handler.on_space();
++begin;
break;
default:
break;
}
if (begin == end) return begin;

View File

@ -106,6 +106,8 @@ SPDLOG_INLINE void ansicolor_sink<ConsoleMutex>::set_color_mode(color_mode mode)
case color_mode::never:
should_do_colors_ = false;
return;
default:
should_do_colors_ = false;
}
}