summaryrefslogtreecommitdiffstats
path: root/Source/CPack/IFW
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-10 16:36:24 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-10 16:36:24 (GMT)
commita16bf141bc5d393b27d13d8235d95a1b034052c2 (patch)
tree59ecd625114f6e98065e7901f418a28fc540cd45 /Source/CPack/IFW
parentbd9e551c1a13f566e6ffe8cdd1262b7628ed5330 (diff)
downloadCMake-a16bf141bc5d393b27d13d8235d95a1b034052c2.zip
CMake-a16bf141bc5d393b27d13d8235d95a1b034052c2.tar.gz
CMake-a16bf141bc5d393b27d13d8235d95a1b034052c2.tar.bz2
Add missing braces around statements.
Apply fixits of clang-tidy's readability-braces-around-statements checker.
Diffstat (limited to 'Source/CPack/IFW')
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx24
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx3
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx15
-rw-r--r--Source/CPack/IFW/cmCPackIFWRepository.cxx13
4 files changed, 37 insertions, 18 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index c1ff526..b47d46e 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -345,18 +345,21 @@ cmCPackComponent* cmCPackIFWGenerator::GetComponent(
const std::string& projectName, const std::string& componentName)
{
ComponentsMap::iterator cit = Components.find(componentName);
- if (cit != Components.end())
+ if (cit != Components.end()) {
return &(cit->second);
+ }
cmCPackComponent* component =
cmCPackGenerator::GetComponent(projectName, componentName);
- if (!component)
+ if (!component) {
return component;
+ }
std::string name = GetComponentPackageName(component);
PackagesMap::iterator pit = Packages.find(name);
- if (pit != Packages.end())
+ if (pit != Packages.end()) {
return component;
+ }
cmCPackIFWPackage* package = &Packages[name];
package->Name = name;
@@ -387,13 +390,15 @@ cmCPackComponentGroup* cmCPackIFWGenerator::GetComponentGroup(
{
cmCPackComponentGroup* group =
cmCPackGenerator::GetComponentGroup(projectName, groupName);
- if (!group)
+ if (!group) {
return group;
+ }
std::string name = GetGroupPackageName(group);
PackagesMap::iterator pit = Packages.find(name);
- if (pit != Packages.end())
+ if (pit != Packages.end()) {
return group;
+ }
cmCPackIFWPackage* package = &Packages[name];
package->Name = name;
@@ -462,8 +467,9 @@ std::string cmCPackIFWGenerator::GetGroupPackageName(
cmCPackComponentGroup* group) const
{
std::string name;
- if (!group)
+ if (!group) {
return name;
+ }
if (cmCPackIFWPackage* package = GetGroupPackage(group)) {
return package->Name;
}
@@ -488,8 +494,9 @@ std::string cmCPackIFWGenerator::GetComponentPackageName(
cmCPackComponent* component) const
{
std::string name;
- if (!component)
+ if (!component) {
return name;
+ }
if (cmCPackIFWPackage* package = GetComponentPackage(component)) {
return package->Name;
}
@@ -534,8 +541,9 @@ cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
const std::string& repositoryName)
{
RepositoriesMap::iterator rit = Repositories.find(repositoryName);
- if (rit != Repositories.end())
+ if (rit != Repositories.end()) {
return &(rit->second);
+ }
cmCPackIFWRepository* repository = &Repositories[repositoryName];
repository->Name = repositoryName;
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index dfc509b..74f6da6 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -343,6 +343,7 @@ void cmCPackIFWInstaller::GeneratePackageFiles()
void cmCPackIFWInstaller::WriteGeneratedByToStrim(cmXMLWriter& xout)
{
- if (Generator)
+ if (Generator) {
Generator->WriteGeneratedByToStrim(xout);
+ }
}
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index ad153d1..c44e389 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -71,8 +71,9 @@ cmCPackIFWPackage::DependenceStruct::DependenceStruct(
std::string cmCPackIFWPackage::DependenceStruct::NameWithCompare() const
{
- if (Compare.Type == CompareNone)
+ if (Compare.Type == CompareNone) {
return Name;
+ }
std::string result = Name;
@@ -128,8 +129,9 @@ bool cmCPackIFWPackage::IsVersionEqual(const char* version)
std::string cmCPackIFWPackage::GetComponentName(cmCPackComponent* component)
{
- if (!component)
+ if (!component) {
return "";
+ }
const char* option =
GetOption("CPACK_IFW_COMPONENT_" +
cmsys::SystemTools::UpperCase(component->Name) + "_NAME");
@@ -189,8 +191,9 @@ int cmCPackIFWPackage::ConfigureFromOptions()
int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
{
- if (!component)
+ if (!component) {
return 0;
+ }
// Restore defaul configuration
DefaultConfiguration();
@@ -284,8 +287,9 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
{
- if (!group)
+ if (!group) {
return 0;
+ }
// Restore defaul configuration
DefaultConfiguration();
@@ -474,6 +478,7 @@ void cmCPackIFWPackage::GeneratePackageFile()
void cmCPackIFWPackage::WriteGeneratedByToStrim(cmXMLWriter& xout)
{
- if (Generator)
+ if (Generator) {
Generator->WriteGeneratedByToStrim(xout);
+ }
}
diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx
index 1838005..b8a10c6 100644
--- a/Source/CPack/IFW/cmCPackIFWRepository.cxx
+++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx
@@ -89,8 +89,9 @@ bool cmCPackIFWRepository::IsVersionEqual(const char* version)
bool cmCPackIFWRepository::ConfigureFromOptions()
{
// Name;
- if (Name.empty())
+ if (Name.empty()) {
return false;
+ }
std::string prefix =
"CPACK_IFW_REPOSITORY_" + cmsys::SystemTools::UpperCase(Name) + "_";
@@ -198,8 +199,9 @@ protected:
patched = true;
}
xout.EndElement();
- if (patched)
+ if (patched) {
return;
+ }
if (name == "Checksum") {
repository->WriteRepositoryUpdates(xout);
patched = true;
@@ -209,8 +211,10 @@ protected:
virtual void CharacterDataHandler(const char* data, int length)
{
std::string content(data, data + length);
- if (content == "" || content == " " || content == " " || content == "\n")
+ if (content == "" || content == " " || content == " " ||
+ content == "\n") {
return;
+ }
xout.Content(content);
}
};
@@ -332,6 +336,7 @@ void cmCPackIFWRepository::WriteRepositoryUpdates(cmXMLWriter& xout)
void cmCPackIFWRepository::WriteGeneratedByToStrim(cmXMLWriter& xout)
{
- if (Generator)
+ if (Generator) {
Generator->WriteGeneratedByToStrim(xout);
+ }
}