Merge branch 'master' of git://github.com/jarro2783/cxxopts
This commit is contained in:
commit
6c82f30c32
@ -551,7 +551,7 @@ namespace cxxopts
|
|||||||
// if we got to here, then `t` is a positive number that fits into
|
// 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`.
|
// `R`. So to avoid MSVC C4146, we first cast it to `R`.
|
||||||
// See https://github.com/jarro2783/cxxopts/issues/62 for more details.
|
// 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>
|
template <typename R, typename T>
|
||||||
@ -611,7 +611,7 @@ namespace cxxopts
|
|||||||
throw_or_mimic<argument_incorrect_type>(text);
|
throw_or_mimic<argument_incorrect_type>(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
US next = result * base + digit;
|
const US next = static_cast<US>(result * base + digit);
|
||||||
if (result > next)
|
if (result > next)
|
||||||
{
|
{
|
||||||
throw_or_mimic<argument_incorrect_type>(text);
|
throw_or_mimic<argument_incorrect_type>(text);
|
||||||
|
|||||||
@ -9,7 +9,7 @@ class Argv {
|
|||||||
|
|
||||||
Argv(std::initializer_list<const char*> args)
|
Argv(std::initializer_list<const char*> args)
|
||||||
: m_argv(new char*[args.size()])
|
: m_argv(new char*[args.size()])
|
||||||
, m_argc(args.size())
|
, m_argc(static_cast<int>(args.size()))
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
auto iter = args.begin();
|
auto iter = args.begin();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user