mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-21 14:40:26 -06:00
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>
This commit is contained in:
committed by
Brad King
parent
79b8c3802a
commit
2033abff0d
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -16,9 +16,7 @@ cmInstalledFile::cmInstalledFile()
|
||||
|
||||
cmInstalledFile::~cmInstalledFile()
|
||||
{
|
||||
if (NameExpression) {
|
||||
delete NameExpression;
|
||||
}
|
||||
delete NameExpression;
|
||||
}
|
||||
|
||||
cmInstalledFile::Property::Property()
|
||||
|
||||
Reference in New Issue
Block a user