fixed warnings

This commit is contained in:
Jack Clarke 2019-05-07 17:04:48 +01:00
parent 3ea4c79137
commit 4448983ecf

View File

@ -504,7 +504,7 @@ class ArgumentParser {
void parse_args_internal(const std::vector<std::string>& aArguments) { void parse_args_internal(const std::vector<std::string>& aArguments) {
std::vector<char*> argv; std::vector<char*> argv;
for (const auto& arg : aArguments) for (const auto& arg : aArguments)
argv.push_back((char*)arg.data()); argv.push_back(const_cast<char*>(arg.data()));
argv.push_back(nullptr); argv.push_back(nullptr);
return parse_args_internal(int(argv.size()) - 1, argv.data()); return parse_args_internal(int(argv.size()) - 1, argv.data());
} }
@ -565,7 +565,7 @@ class ArgumentParser {
for (size_t j = 1; j < tCompoundArgument.size(); j++) { for (size_t j = 1; j < tCompoundArgument.size(); j++) {
std::string tArgument(1, tCompoundArgument[j]); std::string tArgument(1, tCompoundArgument[j]);
size_t tNumArgs = 0; size_t tNumArgs = 0;
std::map<std::string, std::shared_ptr<Argument>>::iterator tIterator = mArgumentMap.find("-" + tArgument); tIterator = mArgumentMap.find("-" + tArgument);
if (tIterator != mArgumentMap.end()) { if (tIterator != mArgumentMap.end()) {
auto tArgumentObject = tIterator->second; auto tArgumentObject = tIterator->second;
tNumArgs = tArgumentObject->mNumArgs; tNumArgs = tArgumentObject->mNumArgs;
@ -604,7 +604,7 @@ class ArgumentParser {
auto tArgument = mPositionalArguments[mNextPositionalArgument]; auto tArgument = mPositionalArguments[mNextPositionalArgument];
auto tCount = tArgument->mNumArgs - tArgument->mRawValues.size(); auto tCount = tArgument->mNumArgs - tArgument->mRawValues.size();
while (tCount > 0) { while (tCount > 0) {
std::map<std::string, std::shared_ptr<Argument>>::iterator tIterator = mArgumentMap.find(argv[i]); tIterator = mArgumentMap.find(argv[i]);
if (tIterator != mArgumentMap.end() || is_optional(argv[i])) { if (tIterator != mArgumentMap.end() || is_optional(argv[i])) {
i = i - 1; i = i - 1;
break; break;