summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-10-24 14:46:18 (GMT)
committerSean McBride <sean@rogue-research.com>2021-12-01 16:17:39 (GMT)
commit29ffa5f48c68bfbfb03222e230f91010c2677ae7 (patch)
tree0843b6484704ff346743b653146037ab227e7d52
parent29c80aec94b3607f3aae82170f0b3d0804de2aea (diff)
downloadCMake-29ffa5f48c68bfbfb03222e230f91010c2677ae7.zip
CMake-29ffa5f48c68bfbfb03222e230f91010c2677ae7.tar.gz
CMake-29ffa5f48c68bfbfb03222e230f91010c2677ae7.tar.bz2
Source: fix -Wextra-semi-stmt warnings
-rw-r--r--Source/cmCMakePresetsFile.cxx46
-rw-r--r--Source/cmCMakePresetsFileInternal.h4
-rw-r--r--Source/cmake.cxx2
3 files changed, 26 insertions, 26 deletions
diff --git a/Source/cmCMakePresetsFile.cxx b/Source/cmCMakePresetsFile.cxx
index 538b668..4a0742a 100644
--- a/Source/cmCMakePresetsFile.cxx
+++ b/Source/cmCMakePresetsFile.cxx
@@ -18,7 +18,7 @@
#include "cmSystemTools.h"
#define CHECK_EXPAND(out, field, expanders, version) \
- { \
+ do { \
switch (ExpandMacros(field, expanders, version)) { \
case ExpandMacroResult::Error: \
return false; \
@@ -28,7 +28,7 @@
case ExpandMacroResult::Ok: \
break; \
} \
- }
+ } while (false)
namespace {
enum class CycleStatus
@@ -96,7 +96,7 @@ ReadFileResult VisitPreset(
return ReadFileResult::INVALID_PRESET;
}
- CHECK_OK(preset.VisitPresetBeforeInherit())
+ CHECK_OK(preset.VisitPresetBeforeInherit());
for (auto const& i : preset.Inherits) {
auto parent = presets.find(i);
@@ -114,7 +114,7 @@ ReadFileResult VisitPreset(
return result;
}
- CHECK_OK(preset.VisitPresetInherit(parentPreset))
+ CHECK_OK(preset.VisitPresetInherit(parentPreset));
for (auto const& v : parentPreset.Environment) {
preset.Environment.insert(v);
@@ -129,7 +129,7 @@ ReadFileResult VisitPreset(
preset.ConditionEvaluator.reset();
}
- CHECK_OK(preset.VisitPresetAfterInherit(file.GetVersion(preset)))
+ CHECK_OK(preset.VisitPresetAfterInherit(file.GetVersion(preset)));
cycleStatus[preset.Name] = CycleStatus::Verified;
return ReadFileResult::READ_OK;
@@ -195,7 +195,7 @@ bool ExpandMacros(const cmCMakePresetsFile& file,
const std::vector<MacroExpander>& macroExpanders)
{
std::string binaryDir = preset.BinaryDir;
- CHECK_EXPAND(out, binaryDir, macroExpanders, file.GetVersion(preset))
+ CHECK_EXPAND(out, binaryDir, macroExpanders, file.GetVersion(preset));
if (!binaryDir.empty()) {
if (!cmSystemTools::FileIsFullPath(binaryDir)) {
@@ -207,7 +207,7 @@ bool ExpandMacros(const cmCMakePresetsFile& file,
if (!preset.InstallDir.empty()) {
std::string installDir = preset.InstallDir;
- CHECK_EXPAND(out, installDir, macroExpanders, file.GetVersion(preset))
+ CHECK_EXPAND(out, installDir, macroExpanders, file.GetVersion(preset));
if (!cmSystemTools::FileIsFullPath(installDir)) {
installDir = cmStrCat(file.SourceDir, '/', installDir);
@@ -218,14 +218,14 @@ bool ExpandMacros(const cmCMakePresetsFile& file,
if (!preset.ToolchainFile.empty()) {
std::string toolchain = preset.ToolchainFile;
- CHECK_EXPAND(out, toolchain, macroExpanders, file.GetVersion(preset))
+ CHECK_EXPAND(out, toolchain, macroExpanders, file.GetVersion(preset));
out->ToolchainFile = toolchain;
}
for (auto& variable : out->CacheVariables) {
if (variable.second) {
CHECK_EXPAND(out, variable.second->Value, macroExpanders,
- file.GetVersion(preset))
+ file.GetVersion(preset));
}
}
@@ -237,12 +237,12 @@ bool ExpandMacros(const cmCMakePresetsFile& file, const BuildPreset& preset,
const std::vector<MacroExpander>& macroExpanders)
{
for (auto& target : out->Targets) {
- CHECK_EXPAND(out, target, macroExpanders, file.GetVersion(preset))
+ CHECK_EXPAND(out, target, macroExpanders, file.GetVersion(preset));
}
for (auto& nativeToolOption : out->NativeToolOptions) {
CHECK_EXPAND(out, nativeToolOption, macroExpanders,
- file.GetVersion(preset))
+ file.GetVersion(preset));
}
return true;
@@ -258,15 +258,15 @@ bool ExpandMacros(const cmCMakePresetsFile& file, const TestPreset& preset,
if (out->Output) {
CHECK_EXPAND(out, out->Output->OutputLogFile, macroExpanders,
- file.GetVersion(preset))
+ file.GetVersion(preset));
}
if (out->Filter) {
if (out->Filter->Include) {
CHECK_EXPAND(out, out->Filter->Include->Name, macroExpanders,
- file.GetVersion(preset))
+ file.GetVersion(preset));
CHECK_EXPAND(out, out->Filter->Include->Label, macroExpanders,
- file.GetVersion(preset))
+ file.GetVersion(preset));
if (out->Filter->Include->Index) {
CHECK_EXPAND(out, out->Filter->Include->Index->IndexFile,
@@ -276,24 +276,24 @@ bool ExpandMacros(const cmCMakePresetsFile& file, const TestPreset& preset,
if (out->Filter->Exclude) {
CHECK_EXPAND(out, out->Filter->Exclude->Name, macroExpanders,
- file.GetVersion(preset))
+ file.GetVersion(preset));
CHECK_EXPAND(out, out->Filter->Exclude->Label, macroExpanders,
- file.GetVersion(preset))
+ file.GetVersion(preset));
if (out->Filter->Exclude->Fixtures) {
CHECK_EXPAND(out, out->Filter->Exclude->Fixtures->Any, macroExpanders,
- file.GetVersion(preset))
+ file.GetVersion(preset));
CHECK_EXPAND(out, out->Filter->Exclude->Fixtures->Setup,
- macroExpanders, file.GetVersion(preset))
+ macroExpanders, file.GetVersion(preset));
CHECK_EXPAND(out, out->Filter->Exclude->Fixtures->Cleanup,
- macroExpanders, file.GetVersion(preset))
+ macroExpanders, file.GetVersion(preset));
}
}
}
if (out->Execution) {
CHECK_EXPAND(out, out->Execution->ResourceSpecFile, macroExpanders,
- file.GetVersion(preset))
+ file.GetVersion(preset));
}
return true;
@@ -898,9 +898,9 @@ cmCMakePresetsFile::ReadProjectPresetsInternal(bool allowNoFiles)
: ReadFileResult::FILE_NOT_FOUND;
}
- CHECK_OK(ComputePresetInheritance(this->ConfigurePresets, *this))
- CHECK_OK(ComputePresetInheritance(this->BuildPresets, *this))
- CHECK_OK(ComputePresetInheritance(this->TestPresets, *this))
+ CHECK_OK(ComputePresetInheritance(this->ConfigurePresets, *this));
+ CHECK_OK(ComputePresetInheritance(this->BuildPresets, *this));
+ CHECK_OK(ComputePresetInheritance(this->TestPresets, *this));
for (auto& it : this->ConfigurePresets) {
if (!ExpandMacros(*this, it.second.Unexpanded, it.second.Expanded)) {
diff --git a/Source/cmCMakePresetsFileInternal.h b/Source/cmCMakePresetsFileInternal.h
index 3269276..afb00ce 100644
--- a/Source/cmCMakePresetsFileInternal.h
+++ b/Source/cmCMakePresetsFileInternal.h
@@ -5,11 +5,11 @@
#include "cmCMakePresetsFile.h"
#define CHECK_OK(expr) \
- { \
+ do { \
auto _result = expr; \
if (_result != ReadFileResult::READ_OK) \
return _result; \
- }
+ } while (false)
namespace cmCMakePresetsFileInternal {
enum class ExpandMacroResult
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index fda7900..8c6a2ec 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -205,7 +205,7 @@ cmake::cmake(Role role, cmState::Mode mode, cmState::ProjectKind projectKind)
exts.ordered.reserve(extList.size());
for (cm::string_view ext : extList) {
exts.ordered.emplace_back(ext);
- };
+ }
// Fill unordered set
exts.unordered.insert(exts.ordered.begin(), exts.ordered.end());
};