Fix some warnings (#1667)

* Fix sign-conversion warning

* Add missing "extern template" declarations for non-header-only build

* Use typed enums to fix Wsigned-enum-bitfield warnings

* Consolidate FMT_HEADER_ONLY code
This commit is contained in:
peterbell10
2020-05-07 14:14:07 +01:00
committed by GitHub
parent 1c86a99e8f
commit 44639b11fe
2 changed files with 25 additions and 3 deletions

View File

@@ -507,7 +507,7 @@ OutputIt basic_printf_context<OutputIt, Char>::format() {
auto str_end = str + specs.precision;
auto nul = std::find(str, str_end, Char());
arg = internal::make_arg<basic_printf_context>(basic_string_view<Char>(
str, nul != str_end ? nul - str : specs.precision));
str, internal::to_unsigned(nul != str_end ? nul - str : specs.precision)));
}
if (specs.alt && visit_format_arg(internal::is_zero_int(), arg))
specs.alt = false;