[dimcli] Fix build error C2220 (#7651)

This commit is contained in:
Lily 2019-08-14 05:48:21 +08:00 committed by Phil Christensen
parent 285f259be7
commit e6a21e1b42
3 changed files with 66 additions and 1 deletions

View File

@ -1,4 +1,4 @@
Source: dimcli
Version: 4.1.0
Version: 4.1.0-1
Homepage: https://github.com/gknowles/dimcli
Description: C++ command line parser toolkit

View File

@ -0,0 +1,63 @@
diff --git a/libs/dimcli/cli.cpp b/libs/dimcli/cli.cpp
index 9e67c12..c96bd24 100644
--- a/libs/dimcli/cli.cpp
+++ b/libs/dimcli/cli.cpp
@@ -388,8 +388,8 @@ GroupConfig const & Cli::Config::findGrpOrDie(Cli const & cli) {
***/
//===========================================================================
-Cli::OptBase::OptBase(string const & names, bool boolean)
- : m_bool{boolean}
+Cli::OptBase::OptBase(string const & names, bool in_boolean)
+ : m_bool{in_boolean}
, m_names{names}
{
// set m_fromName and assert if names is malformed
@@ -486,12 +486,12 @@ static bool includeName(
OptName const & name,
NameListType type,
Cli::OptBase const & opt,
- bool boolean,
+ bool in_boolean,
bool inverted
) {
if (name.opt != &opt)
return false;
- if (boolean) {
+ if (in_boolean) {
if (type == kNameEnable)
return !name.invert;
if (type == kNameDisable)
diff --git a/libs/dimcli/cli.h b/libs/dimcli/cli.h
index 2c1615c..3e4f405 100644
--- a/libs/dimcli/cli.h
+++ b/libs/dimcli/cli.h
@@ -818,7 +818,7 @@ public:
};
public:
- OptBase(std::string const & keys, bool boolean);
+ OptBase(std::string const & keys, bool in_boolean);
virtual ~OptBase() {}
//-----------------------------------------------------------------------
@@ -952,7 +952,7 @@ inline void Cli::OptBase::setValueDesc<DIMCLI_LIB_FILESYSTEM_PATH>() {
template <typename A, typename T>
class Cli::OptShim : public OptBase {
public:
- OptShim(std::string const & keys, bool boolean);
+ OptShim(std::string const & keys, bool in_boolean);
OptShim(OptShim const &) = delete;
OptShim & operator=(OptShim const &) = delete;
@@ -1100,8 +1100,8 @@ protected:
//===========================================================================
template <typename A, typename T>
-Cli::OptShim<A, T>::OptShim(std::string const & keys, bool boolean)
- : OptBase(keys, boolean)
+Cli::OptShim<A, T>::OptShim(std::string const & keys, bool in_boolean)
+ : OptBase(keys, in_boolean)
{
setValueDesc<T>();
}

View File

@ -6,6 +6,8 @@ vcpkg_from_github(
REF v4.1.0
SHA512 5de010b5abfda9e6996bba8c621e03ae0cf81dbc2f69cd859e2ebf7b1706c451f7f8e142299784646d89ca3c3e5803e8711215680b8bdb8eb663158bff3b4f3d
HEAD_REF master
PATCHES
fix-NameBoolean.patch
)
set(staticCrt OFF)
if(VCPKG_CRT_LINKAGE STREQUAL "static")