Merge branch 'master' of git://github.com/jarro2783/cxxopts

This commit is contained in:
Wolfgang Gahr 2020-01-25 12:13:44 +01:00
commit 6c82f30c32
2 changed files with 3 additions and 3 deletions

View File

@ -551,7 +551,7 @@ namespace cxxopts
// if we got to here, then `t` is a positive number that fits into
// `R`. So to avoid MSVC C4146, we first cast it to `R`.
// See https://github.com/jarro2783/cxxopts/issues/62 for more details.
return -static_cast<R>(t-1)-1;
return static_cast<R>(-static_cast<R>(t-1)-1);
}
template <typename R, typename T>
@ -611,7 +611,7 @@ namespace cxxopts
throw_or_mimic<argument_incorrect_type>(text);
}
US next = result * base + digit;
const US next = static_cast<US>(result * base + digit);
if (result > next)
{
throw_or_mimic<argument_incorrect_type>(text);

View File

@ -9,7 +9,7 @@ class Argv {
Argv(std::initializer_list<const char*> args)
: m_argv(new char*[args.size()])
, m_argc(args.size())
, m_argc(static_cast<int>(args.size()))
{
int i = 0;
auto iter = args.begin();