Fix more warnings

This commit is contained in:
Victor Zverovich 2019-07-17 21:57:30 +02:00
parent 230b24944c
commit ec24342b2b
2 changed files with 4 additions and 4 deletions

View File

@ -1186,8 +1186,8 @@ template <typename Context> 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 <typename Context> class basic_format_args {
int max_size() const {
unsigned long long max_packed = internal::max_packed_args;
return static_cast<size_type>(
return static_cast<int>(
is_packed() ? max_packed : types_ & ~internal::is_unpacked_bit);
}
};

View File

@ -1252,7 +1252,7 @@ class cstring_type_checker : public ErrorHandler {
template <typename Context>
void arg_map<Context>::init(const basic_format_args<Context>& 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);