summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorPavel Solodovnikov <hellyeahdominate@gmail.com>2017-05-30 22:46:05 +0300
committerBrad King <brad.king@kitware.com>2017-06-01 14:19:52 -0400
commitdb2d46e2ddbdf1c5d942e70b341e085f84e79c13 (patch)
tree37d613c818fcf588664ea3ac6cacc83d9966b176 /Source
parent8b6f439ef20cf882b4f3deba48f34a01a98963d9 (diff)
downloadcmake-db2d46e2ddbdf1c5d942e70b341e085f84e79c13.tar.gz
Remove second arg: npos in substr usages
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx4
-rw-r--r--Source/CTest/cmParseBlanketJSCoverage.cxx4
-rw-r--r--Source/cmCTest.cxx5
-rw-r--r--Source/cmDependsC.cxx2
-rw-r--r--Source/cmFindCommon.cxx2
-rw-r--r--Source/cmGeneratorTarget.cxx2
-rw-r--r--Source/cmGlobalGenerator.cxx2
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx2
-rw-r--r--Source/cmRST.cxx2
-rw-r--r--Source/cmSystemTools.cxx3
11 files changed, 15 insertions, 17 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 3e113d31a7..d8e2753cf3 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -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 <"
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index beb2d01490..9697a38328 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -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(), '/', '\\');
diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx
index f7f3e4123a..83a7b75eb3 100644
--- a/Source/CTest/cmParseBlanketJSCoverage.cxx
+++ b/Source/CTest/cmParseBlanketJSCoverage.cxx
@@ -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
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 70257478fc..e2605561ae 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -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;
}
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index a404ae861d..2c464cc9ce 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -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;
}
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index b07a26a1ea..103e692356 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -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;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 6233ec6fa0..9a33becc5d 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -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) {
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 19597fdd5b..67e272ded6 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -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 =
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 146cfd0593..9b9d22cf59 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -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;
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index 12bbaf6379..5364f76f4b 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -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 = "";
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 54ec6b0a2e..f7192e0b68 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -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;