diff options
author | Matthias Maennich <matthias@maennich.net> | 2017-09-19 16:19:14 +0200 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-09-28 07:23:42 -0400 |
commit | 2033abff0dec29072ac070cb6fe1604e8c03f180 (patch) | |
tree | 494f28a1e19c405e5def2b5d5343fe75f26b65ad /Source | |
parent | 79b8c3802a430577a83ead5b0baab7038a813116 (diff) | |
download | cmake-2033abff0dec29072ac070cb6fe1604e8c03f180.tar.gz |
Fix minor clang-tidy findings
Fix issues diagnosed by clang-tidy
- modernize-use-bool-literals
- misc-string-integer-assignment
- performance-faster-string-find
- readability-redundant-string-cstr
- readability-delete-null-pointer
Signed-off-by: Matthias Maennich <matthias@maennich.net>
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CPack/cmCPackProductBuildGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmFindLibraryCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmInstalledFile.cxx | 4 |
4 files changed, 5 insertions, 7 deletions
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index ed4463c9e6..6a6dc828f7 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -190,7 +190,7 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage( cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem creating installer directory: " << scriptDir << std::endl); - return 0; + return false; } // if preflight, postflight, or postupgrade are set diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index b8b51ba459..758da2ce09 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -260,7 +260,7 @@ void cmFindLibraryHelper::RegexFromLiteral(std::string& out, out += "\\"; } #if defined(_WIN32) || defined(__APPLE__) - out += tolower(ch); + out += static_cast<char>(tolower(ch)); #else out += ch; #endif diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 29b06c354c..5dc595029e 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1471,7 +1471,7 @@ void cmGlobalXCodeGenerator::FilterConfigurationAttribute( return; } - std::string::size_type endVariant = attribute.find("]", beginVariant + 9); + std::string::size_type endVariant = attribute.find(']', beginVariant + 9); if (endVariant == std::string::npos) { // There is no terminating bracket. return; @@ -2894,7 +2894,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( std::string project_id = "PROJECT_"; project_id += root->GetProjectName(); this->RootObject->SetId( - this->GetOrCreateId(project_id.c_str(), this->RootObject->GetId())); + this->GetOrCreateId(project_id, this->RootObject->GetId())); group = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); this->RootObject->AddAttribute("mainGroup", diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx index c8144aac2b..3ffeabdb52 100644 --- a/Source/cmInstalledFile.cxx +++ b/Source/cmInstalledFile.cxx @@ -16,9 +16,7 @@ cmInstalledFile::cmInstalledFile() cmInstalledFile::~cmInstalledFile() { - if (NameExpression) { - delete NameExpression; - } + delete NameExpression; } cmInstalledFile::Property::Property() |