Remove second arg: npos in substr usages
This commit is contained in:
parent
8b6f439ef2
commit
db2d46e2dd
@ -811,8 +811,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
||||
for (fit = result.begin(); fit != diff; ++fit) {
|
||||
localFileName =
|
||||
cmSystemTools::RelativePath(InstallPrefix, fit->c_str());
|
||||
localFileName = localFileName.substr(
|
||||
localFileName.find_first_not_of('/'), std::string::npos);
|
||||
localFileName =
|
||||
localFileName.substr(localFileName.find_first_not_of('/'));
|
||||
Components[installComponent].Files.push_back(localFileName);
|
||||
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file <"
|
||||
<< localFileName << "> to component <"
|
||||
|
@ -76,7 +76,7 @@ int cmCPackNSISGenerator::PackageFiles()
|
||||
}
|
||||
|
||||
// Strip off the component part of the path.
|
||||
fileN = fileN.substr(pos + 1, std::string::npos);
|
||||
fileN = fileN.substr(pos + 1);
|
||||
}
|
||||
std::replace(fileN.begin(), fileN.end(), '/', '\\');
|
||||
|
||||
@ -106,7 +106,7 @@ int cmCPackNSISGenerator::PackageFiles()
|
||||
componentName = fileN.substr(0, slash);
|
||||
|
||||
// Strip off the component part of the path.
|
||||
fileN = fileN.substr(slash + 1, std::string::npos);
|
||||
fileN = fileN.substr(slash + 1);
|
||||
}
|
||||
}
|
||||
std::replace(fileN.begin(), fileN.end(), '/', '\\');
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
line.substr(begIndex + 3, endIndex - (begIndex + 4));
|
||||
return foundFileName;
|
||||
}
|
||||
return line.substr(begIndex, std::string::npos);
|
||||
return line.substr(begIndex);
|
||||
}
|
||||
bool ParseFile(std::string const& file)
|
||||
{
|
||||
@ -78,7 +78,7 @@ public:
|
||||
* only the value of the line coverage is captured
|
||||
*/
|
||||
std::string result = getValue(line, 1);
|
||||
result = result.substr(2, std::string::npos);
|
||||
result = result.substr(2);
|
||||
if (result == "\"\"") {
|
||||
// Empty quotation marks indicate that the
|
||||
// line is not executable
|
||||
|
@ -673,8 +673,7 @@ bool cmCTest::UpdateCTestConfiguration()
|
||||
continue;
|
||||
}
|
||||
std::string key = line.substr(0, cpos);
|
||||
std::string value =
|
||||
cmCTest::CleanString(line.substr(cpos + 1, std::string::npos));
|
||||
std::string value = cmCTest::CleanString(line.substr(cpos + 1));
|
||||
this->CTestConfiguration[key] = value;
|
||||
}
|
||||
fin.close();
|
||||
@ -2518,7 +2517,7 @@ void cmCTest::AddCTestConfigurationOverwrite(const std::string& overStr)
|
||||
return;
|
||||
}
|
||||
std::string key = overStr.substr(0, epos);
|
||||
std::string value = overStr.substr(epos + 1, std::string::npos);
|
||||
std::string value = overStr.substr(epos + 1);
|
||||
this->CTestConfigurationOverwrites[key] = value;
|
||||
}
|
||||
|
||||
|
@ -453,7 +453,7 @@ void cmDependsC::ParseTransform(std::string const& xform)
|
||||
return;
|
||||
}
|
||||
std::string name = xform.substr(0, pos);
|
||||
std::string value = xform.substr(pos + 4, std::string::npos);
|
||||
std::string value = xform.substr(pos + 4);
|
||||
this->TransformRules[name] = value;
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ void cmFindCommon::AddPathSuffix(std::string const& arg)
|
||||
return;
|
||||
}
|
||||
if (suffix[0] == '/') {
|
||||
suffix = suffix.substr(1, std::string::npos);
|
||||
suffix = suffix.substr(1);
|
||||
}
|
||||
if (suffix.empty()) {
|
||||
return;
|
||||
|
@ -5149,7 +5149,7 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const
|
||||
std::string lib = item;
|
||||
std::string::size_type pos = lib.find_first_not_of(" \t\r\n");
|
||||
if (pos != std::string::npos) {
|
||||
lib = lib.substr(pos, std::string::npos);
|
||||
lib = lib.substr(pos);
|
||||
}
|
||||
pos = lib.find_last_not_of(" \t\r\n");
|
||||
if (pos != std::string::npos) {
|
||||
|
@ -2730,7 +2730,7 @@ void cmGlobalGenerator::CheckRuleHashes(std::string const& pfile,
|
||||
}
|
||||
|
||||
// Get the filename.
|
||||
fname = line.substr(33, std::string::npos);
|
||||
fname = line.substr(33);
|
||||
|
||||
// Look for a hash for this file's rule.
|
||||
std::map<std::string, RuleHash>::const_iterator rhi =
|
||||
|
@ -79,7 +79,7 @@ static std::string cmSplitExtension(std::string const& in, std::string& base)
|
||||
std::string::size_type dot_pos = in.rfind('.');
|
||||
if (dot_pos != std::string::npos) {
|
||||
// Remove the extension first in case &base == &in.
|
||||
ext = in.substr(dot_pos, std::string::npos);
|
||||
ext = in.substr(dot_pos);
|
||||
base = in.substr(0, dot_pos);
|
||||
} else {
|
||||
base = in;
|
||||
|
@ -98,7 +98,7 @@ void cmRST::ProcessModule(std::istream& is)
|
||||
continue;
|
||||
}
|
||||
if (line.substr(0, 2) == "# ") {
|
||||
this->ProcessLine(line.substr(2, std::string::npos));
|
||||
this->ProcessLine(line.substr(2));
|
||||
continue;
|
||||
}
|
||||
rst = "";
|
||||
|
@ -2372,8 +2372,7 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
|
||||
// not being changed.
|
||||
rp[rp_count].Value = se[i]->Value.substr(0, prefix_len);
|
||||
rp[rp_count].Value += newRPath;
|
||||
rp[rp_count].Value +=
|
||||
se[i]->Value.substr(pos + oldRPath.length(), std::string::npos);
|
||||
rp[rp_count].Value += se[i]->Value.substr(pos + oldRPath.length());
|
||||
|
||||
if (!rp[rp_count].Value.empty()) {
|
||||
remove_rpath = false;
|
||||
|
Loading…
Reference in New Issue
Block a user