mirror of
https://gitee.com/openharmony/third_party_benchmark
synced 2024-11-23 07:20:12 +00:00
Fix MSVC warning. (#935)
This fixes the Visual Studio 2019 warning: `C4244: '=': conversion from 'int' to 'char', possible loss of data` When implicitly casting the return value of tolower() (int) to char. Fixes: #932
This commit is contained in:
parent
e5ea03ce07
commit
8982e1ee6a
@ -217,8 +217,8 @@ bool IsTruthyFlagValue(const std::string& value) {
|
||||
!(v == '0' || v == 'f' || v == 'F' || v == 'n' || v == 'N');
|
||||
} else if (!value.empty()) {
|
||||
std::string value_lower(value);
|
||||
std::transform(value_lower.begin(), value_lower.end(),
|
||||
value_lower.begin(), ::tolower);
|
||||
std::transform(value_lower.begin(), value_lower.end(), value_lower.begin(),
|
||||
[](char c) { return static_cast<char>(::tolower(c)); });
|
||||
return !(value_lower == "false" || value_lower == "no" ||
|
||||
value_lower == "off");
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user