summaryrefslogtreecommitdiffstats
path: root/Source/cmVSSetupHelper.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-11-22 19:11:07 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2022-11-29 17:39:45 (GMT)
commit4deab0a75c0da66938c230a446af5ecd6f3c5ca3 (patch)
treeda2a018bdb2564934dbea62c60111c5f55c5dbce /Source/cmVSSetupHelper.cxx
parent714a466eeb42809fa56d78d6aef6cde70d938af5 (diff)
downloadCMake-4deab0a75c0da66938c230a446af5ecd6f3c5ca3.zip
CMake-4deab0a75c0da66938c230a446af5ecd6f3c5ca3.tar.gz
CMake-4deab0a75c0da66938c230a446af5ecd6f3c5ca3.tar.bz2
clang-tidy: fix `readability-braces-around-statements` lints
Diffstat (limited to 'Source/cmVSSetupHelper.cxx')
-rw-r--r--Source/cmVSSetupHelper.cxx27
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
index db85e86..e4cbe49 100644
--- a/Source/cmVSSetupHelper.cxx
+++ b/Source/cmVSSetupHelper.cxx
@@ -104,8 +104,9 @@ cmVSSetupAPIHelper::~cmVSSetupAPIHelper()
setupHelper = nullptr;
setupConfig2 = nullptr;
setupConfig = nullptr;
- if (SUCCEEDED(comInitialized))
+ if (SUCCEEDED(comInitialized)) {
CoUninitialize();
+ }
}
bool cmVSSetupAPIHelper::SetVSInstance(std::string const& vsInstallLocation,
@@ -176,8 +177,9 @@ bool cmVSSetupAPIHelper::CheckInstalledComponent(
bool cmVSSetupAPIHelper::GetVSInstanceInfo(
SmartCOMPtr<ISetupInstance2> pInstance, VSInstanceInfo& vsInstanceInfo)
{
- if (pInstance == nullptr)
+ if (pInstance == nullptr) {
return false;
+ }
InstanceState state;
if (FAILED(pInstance->GetState(&state))) {
@@ -229,8 +231,9 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(
SmartCOMPtr<ISetupPackageReference> package = nullptr;
if (FAILED(ppData[i]->QueryInterface(IID_ISetupPackageReference,
(void**)&package)) ||
- package == nullptr)
+ package == nullptr) {
continue;
+ }
bool win10SDKInstalled = false;
bool win81SDkInstalled = false;
@@ -368,8 +371,9 @@ bool cmVSSetupAPIHelper::EnumerateVSInstancesWithCOM(
std::vector<VSInstanceInfo>& VSInstances)
{
if (initializationFailure || setupConfig == nullptr ||
- setupConfig2 == nullptr || setupHelper == nullptr)
+ setupConfig2 == nullptr || setupHelper == nullptr) {
return false;
+ }
SmartCOMPtr<IEnumSetupInstances> enumInstances = nullptr;
if (FAILED(
@@ -391,8 +395,9 @@ bool cmVSSetupAPIHelper::EnumerateVSInstancesWithCOM(
VSInstanceInfo instanceInfo;
bool isInstalled = GetVSInstanceInfo(instance2, instanceInfo);
instance = instance2 = nullptr;
- if (isInstalled)
+ if (isInstalled) {
VSInstances.push_back(instanceInfo);
+ }
}
return true;
}
@@ -410,8 +415,9 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
cmSystemTools::GetEnv("WindowsSdkDir_81", envWindowsSdkDir81);
cmSystemTools::GetEnv("VisualStudioVersion", envVSVersion);
cmSystemTools::GetEnv("VSINSTALLDIR", envVsInstallDir);
- if (envVSVersion.empty() || envVsInstallDir.empty())
+ if (envVSVersion.empty() || envVsInstallDir.empty()) {
return false;
+ }
chosenInstanceInfo.VSInstallLocation = envVsInstallDir;
chosenInstanceInfo.Version = envVSVersion;
@@ -508,11 +514,13 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
int cmVSSetupAPIHelper::ChooseVSInstance(
const std::vector<VSInstanceInfo>& vecVSInstances)
{
- if (vecVSInstances.empty())
+ if (vecVSInstances.empty()) {
return -1;
+ }
- if (vecVSInstances.size() == 1)
+ if (vecVSInstances.size() == 1) {
return 0;
+ }
unsigned int chosenIndex = 0;
for (unsigned int i = 1; i < vecVSInstances.size(); i++) {
@@ -586,8 +594,9 @@ bool cmVSSetupAPIHelper::LoadSpecifiedVSInstanceFromDisk()
bool cmVSSetupAPIHelper::Initialize()
{
- if (initializationFailure)
+ if (initializationFailure) {
return false;
+ }
if (FAILED(comInitialized)) {
initializationFailure = true;