summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-11-08 14:44:37 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-11-08 14:44:37 (GMT)
commit4ec359bd6256e870d9b233fd5cd105e452a62300 (patch)
tree8796899aeb1436d6a6f0b4e2d5f28db8dc40d2d1
parent049b10e2f621800f0b8da1918784dad7a049d6a8 (diff)
parent0cd654c8e23b19311bae876ada4ad5b432c1ad1b (diff)
downloadCMake-4ec359bd6256e870d9b233fd5cd105e452a62300.zip
CMake-4ec359bd6256e870d9b233fd5cd105e452a62300.tar.gz
CMake-4ec359bd6256e870d9b233fd5cd105e452a62300.tar.bz2
Merge topic 'clang-tidy'
0cd654c8 cmGeneratorTarget: Correctly set FortranModuleDirectoryCreated bac93dcf cmGeneratorTarget: Don't assing a bool to a string 1e994985 cmGlobalNinjaGenerator: Suppress clang-tidy warning 5ae3966d cmCTestSubmitHandler: Remove redundant c_str() 443180fb cmCPluginAPI: Fix clang-tidy findings
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx2
-rw-r--r--Source/cmCPluginAPI.cxx8
-rw-r--r--Source/cmGeneratorTarget.cxx2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx4
4 files changed, 8 insertions, 8 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index d21471d..d10f7ad 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -926,7 +926,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
return false;
}
size_t fileSize = static_cast<size_t>(st.st_size);
- FILE* fp = cmsys::SystemTools::Fopen(local_file.c_str(), "rb");
+ FILE* fp = cmsys::SystemTools::Fopen(local_file, "rb");
if (!fp) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
" Cannot open file: " << local_file << std::endl);
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index b70074e..d1f8446 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -408,7 +408,7 @@ char CCONV* cmExpandVariablesInString(void* arg, const char* source,
std::string result = mf->ExpandVariablesInString(
barf, (escapeQuotes ? true : false), (atOnly ? true : false));
char* res = static_cast<char*>(malloc(result.size() + 1));
- if (result.size()) {
+ if (!result.empty()) {
strcpy(res, result.c_str());
}
res[result.size()] = '\0';
@@ -570,7 +570,7 @@ void* CCONV cmAddSource(void* arg, void* arg2)
rsf->GetProperties() = osf->Properties;
for (std::vector<std::string>::iterator i = osf->Depends.begin();
i != osf->Depends.end(); ++i) {
- rsf->AddDepend(i->c_str());
+ rsf->AddDepend(*i);
}
// Create the proxy for the real source file.
@@ -676,7 +676,7 @@ void CCONV cmSourceFileSetName(void* arg, const char* name, const char* dir,
std::string hname = pathname;
if (cmSystemTools::FileExists(hname.c_str())) {
sf->SourceName = cmSystemTools::GetFilenamePath(name);
- if (sf->SourceName.size() > 0) {
+ if (!sf->SourceName.empty()) {
sf->SourceName += "/";
}
sf->SourceName += cmSystemTools::GetFilenameWithoutLastExtension(name);
@@ -756,7 +756,7 @@ void CCONV cmSourceFileSetName2(void* arg, const char* name, const char* dir,
fname += ".";
fname += ext;
}
- sf->FullPath = cmSystemTools::CollapseFullPath(fname.c_str(), dir);
+ sf->FullPath = cmSystemTools::CollapseFullPath(fname, dir);
cmSystemTools::ConvertToUnixSlashes(sf->FullPath);
sf->SourceExtension = ext;
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index ca056c0..f5db7f6 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3945,9 +3945,9 @@ std::string cmGeneratorTarget::GetFortranModuleDirectory(
std::string const& working_dir) const
{
if (!this->FortranModuleDirectoryCreated) {
- this->FortranModuleDirectory = true;
this->FortranModuleDirectory =
this->CreateFortranModuleDirectory(working_dir);
+ this->FortranModuleDirectoryCreated = true;
}
return this->FortranModuleDirectory;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 830ab7f..22de7c4 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -130,7 +130,7 @@ std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit)
std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path)
{
- std::string result = path;
+ std::string result = path; // NOLINT(clang-tidy)
#ifdef _WIN32
if (this->IsGCCOnWindows())
std::replace(result.begin(), result.end(), '\\', '/');
@@ -283,7 +283,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(
bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps,
const cmNinjaDeps& orderOnly)
{
- std::string cmd = command;
+ std::string cmd = command; // NOLINT(clang-tidy)
#ifdef _WIN32
if (cmd.empty())
// TODO Shouldn't an empty command be handled by ninja?