Fix MSVC warnings
This commit is contained in:
parent
a201c61977
commit
e0d6f630f8
@ -1518,7 +1518,7 @@ class ArgVisitor {
|
||||
case Arg::NONE:
|
||||
case Arg::NAMED_ARG:
|
||||
FMT_ASSERT(false, "invalid argument type");
|
||||
return Result();
|
||||
break;
|
||||
case Arg::INT:
|
||||
return FMT_DISPATCH(visit_int(arg.int_value));
|
||||
case Arg::UINT:
|
||||
@ -1546,6 +1546,7 @@ class ArgVisitor {
|
||||
case Arg::CUSTOM:
|
||||
return FMT_DISPATCH(visit_custom(arg.custom));
|
||||
}
|
||||
return Result();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -164,7 +164,8 @@ class WidthHandler : public ArgVisitor<WidthHandler, unsigned> {
|
||||
spec_.align_ = ALIGN_LEFT;
|
||||
width = 0 - width;
|
||||
}
|
||||
if (width > std::numeric_limits<int>::max())
|
||||
unsigned int_max = std::numeric_limits<int>::max();
|
||||
if (width > int_max)
|
||||
FMT_THROW(FormatError("number is too big"));
|
||||
return static_cast<unsigned>(width);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user