summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-12-10 15:49:34 (GMT)
committerBrad King <brad.king@kitware.com>2016-12-12 19:04:16 (GMT)
commit88da3d68c2d205688762fd6a7e84fd730533e844 (patch)
tree59c1b137d9e25fc2b8afb2a75eb01ffff6d00f16 /Source/cmCoreTryCompile.cxx
parent58c66393cfb999f23bfb6ff72122ecbc531434c0 (diff)
downloadCMake-88da3d68c2d205688762fd6a7e84fd730533e844.zip
CMake-88da3d68c2d205688762fd6a7e84fd730533e844.tar.gz
CMake-88da3d68c2d205688762fd6a7e84fd730533e844.tar.bz2
clang-tidy: apply misc-suspicious-string-compare fixes
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index e0b3120..f12c9e8 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -806,18 +806,13 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
cmsys::Directory dir;
dir.Load(binDir);
- size_t fileNum;
std::set<std::string> deletedFiles;
- for (fileNum = 0; fileNum < dir.GetNumberOfFiles(); ++fileNum) {
- if (strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)), ".") &&
- strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)), "..")) {
-
- if (deletedFiles.find(dir.GetFile(
- static_cast<unsigned long>(fileNum))) == deletedFiles.end()) {
- deletedFiles.insert(dir.GetFile(static_cast<unsigned long>(fileNum)));
- std::string fullPath = binDir;
- fullPath += "/";
- fullPath += dir.GetFile(static_cast<unsigned long>(fileNum));
+ for (unsigned long i = 0; i < dir.GetNumberOfFiles(); ++i) {
+ const char* fileName = dir.GetFile(i);
+ if (strcmp(fileName, ".") != 0 && strcmp(fileName, "..") != 0) {
+ if (deletedFiles.insert(fileName).second) {
+ std::string const fullPath =
+ std::string(binDir).append("/").append(fileName);
if (cmSystemTools::FileIsDirectory(fullPath)) {
this->CleanupFiles(fullPath.c_str());
cmSystemTools::RemoveADirectory(fullPath);