From ec24342b2b774cd8ad90088c56d3307a7950a50b Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 17 Jul 2019 21:57:30 +0200 Subject: [PATCH] Fix more warnings --- include/fmt/core.h | 6 +++--- include/fmt/format.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 0ee92fcf..981da4de 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1186,8 +1186,8 @@ template class basic_format_args { Constructs a `basic_format_args` object from a dynamic set of arguments. \endrst */ - basic_format_args(const format_arg* args, size_type count) - : types_(internal::is_unpacked_bit | count) { + basic_format_args(const format_arg* args, int count) + : types_(internal::is_unpacked_bit | internal::to_unsigned(count)) { set_data(args); } @@ -1201,7 +1201,7 @@ template class basic_format_args { int max_size() const { unsigned long long max_packed = internal::max_packed_args; - return static_cast( + return static_cast( is_packed() ? max_packed : types_ & ~internal::is_unpacked_bit); } }; diff --git a/include/fmt/format.h b/include/fmt/format.h index 464883c1..a9b27ff9 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1252,7 +1252,7 @@ class cstring_type_checker : public ErrorHandler { template void arg_map::init(const basic_format_args& args) { if (map_) return; - map_ = new entry[args.max_size()]; + map_ = new entry[internal::to_unsigned(args.max_size())]; if (args.is_packed()) { for (int i = 0;; ++i) { internal::type arg_type = args.type(i);