Clang 13: Fix build errors ...
... due to local variables only being written to (but never read). Signed-off-by: Daniel Edwards <dev@danieledwards.de>
This commit is contained in:
@@ -101,7 +101,7 @@ void CEditorPreferencesPage_AWS::SaveSettingsRegistryFile()
|
||||
return;
|
||||
}
|
||||
|
||||
bool saved{};
|
||||
[[maybe_unused]] bool saved{};
|
||||
constexpr auto configurationMode =
|
||||
AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY;
|
||||
if (AZ::IO::SystemFile outputFile; outputFile.Open(resolvedPath.data(), configurationMode))
|
||||
|
||||
@@ -1128,7 +1128,7 @@ void SEditorSettings::SaveSettingsRegistryFile()
|
||||
return;
|
||||
}
|
||||
|
||||
bool saved{};
|
||||
[[maybe_unused]] bool saved{};
|
||||
constexpr auto configurationMode = AZ::IO::SystemFile::SF_OPEN_CREATE
|
||||
| AZ::IO::SystemFile::SF_OPEN_CREATE_PATH
|
||||
| AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY;
|
||||
|
||||
@@ -745,7 +745,7 @@ namespace
|
||||
|
||||
void PySetActiveViewport(unsigned int viewportIndex)
|
||||
{
|
||||
bool success = false;
|
||||
[[maybe_unused]] bool success = false;
|
||||
CLayoutWnd* layout = GetIEditor()->GetViewManager()->GetLayout();
|
||||
if (layout)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace AZ
|
||||
|
||||
void Matrix3x4SetRowGeneric(Matrix3x4* thisPtr, ScriptDataContext& dc)
|
||||
{
|
||||
bool rowIsSet = false;
|
||||
[[maybe_unused]] bool rowIsSet = false;
|
||||
if (dc.GetNumArguments() >= 5)
|
||||
{
|
||||
if (dc.IsNumber(0))
|
||||
@@ -88,7 +88,7 @@ namespace AZ
|
||||
|
||||
void Matrix3x4SetColumnGeneric(Matrix3x4* thisPtr, ScriptDataContext& dc)
|
||||
{
|
||||
bool columnIsSet = false;
|
||||
[[maybe_unused]] bool columnIsSet = false;
|
||||
if (dc.GetNumArguments() >= 4)
|
||||
{
|
||||
if (dc.IsNumber(0))
|
||||
@@ -133,7 +133,7 @@ namespace AZ
|
||||
|
||||
void Matrix3x4SetTranslationGeneric(Matrix3x4* thisPtr, ScriptDataContext& dc)
|
||||
{
|
||||
bool translationIsSet = false;
|
||||
[[maybe_unused]] bool translationIsSet = false;
|
||||
|
||||
if (dc.GetNumArguments() == 3 &&
|
||||
dc.IsNumber(0) &&
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace AZ
|
||||
|
||||
// check open brace
|
||||
char c = *current++;
|
||||
bool has_open_brace = false;
|
||||
[[maybe_unused]] bool has_open_brace = false;
|
||||
if (c == '{')
|
||||
{
|
||||
c = *current++;
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace AZ
|
||||
|
||||
NameDictionary::~NameDictionary()
|
||||
{
|
||||
bool leaksDetected = false;
|
||||
[[maybe_unused]] bool leaksDetected = false;
|
||||
|
||||
for (const auto& keyValue : m_dictionary)
|
||||
{
|
||||
|
||||
@@ -642,7 +642,7 @@ namespace UnitTest
|
||||
char buffer[RandomStringBufferSize];
|
||||
|
||||
AZStd::sys_time_t newNameTime;
|
||||
AZStd::sys_time_t existingNameTime;
|
||||
[[maybe_unused]] AZStd::sys_time_t existingNameTime;
|
||||
AZStd::sys_time_t stringTime;
|
||||
|
||||
{
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace AzFramework::AssetBenchmark
|
||||
// Console command: Add the given list of assets to the list of assets to load with BenchmarkLoadAssetList
|
||||
void BenchmarkAddAssetsToList(const AZ::ConsoleCommandContainer& parameters)
|
||||
{
|
||||
bool allAssetsAdded = true;
|
||||
[[maybe_unused]] bool allAssetsAdded = true;
|
||||
|
||||
for (auto& assetName : parameters)
|
||||
{
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace UnitTest
|
||||
|
||||
TEST_P(Rotation, Permutation)
|
||||
{
|
||||
int expectedErrors = -1;
|
||||
[[maybe_unused]] int expectedErrors = -1;
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
|
||||
// Given an orientation derived from the look at points
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace AzQtComponents
|
||||
QColor color;
|
||||
QString colorName(m_namedVariables.value(name));
|
||||
|
||||
bool colorSet = false;
|
||||
[[maybe_unused]] bool colorSet = false;
|
||||
if (QColor::isValidColor(colorName))
|
||||
{
|
||||
color.setNamedColor(colorName);
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ namespace AzToolsFramework
|
||||
auto data = index.data(AssetBrowserModel::Roles::EntryRole);
|
||||
if (data.canConvert<const AssetBrowserEntry*>())
|
||||
{
|
||||
bool isEnabled = (option.state & QStyle::State_Enabled) != 0;
|
||||
[[maybe_unused]] bool isEnabled = (option.state & QStyle::State_Enabled) != 0;
|
||||
|
||||
QStyle* style = option.widget ? option.widget->style() : QApplication::style();
|
||||
|
||||
|
||||
@@ -506,7 +506,7 @@ namespace AzToolsFramework
|
||||
//Remove all Links owned by the Template from TemplateToLinkIdsMap.
|
||||
Template& templateToDelete = findTemplateResult->get();
|
||||
const Template::Links& linkIdsToDelete = templateToDelete.GetLinks();
|
||||
bool result;
|
||||
[[maybe_unused]] bool result;
|
||||
for (auto linkId : linkIdsToDelete)
|
||||
{
|
||||
result = RemoveLinkIdFromTemplateToLinkIdsMap(linkId);
|
||||
@@ -774,7 +774,7 @@ namespace AzToolsFramework
|
||||
}
|
||||
|
||||
Link& link = findLinkResult->get();
|
||||
bool result;
|
||||
[[maybe_unused]] bool result;
|
||||
result = RemoveLinkIdFromTemplateToLinkIdsMap(linkId, link);
|
||||
AZ_Assert(result,
|
||||
"Prefab - PrefabSystemComponent::RemoveLink - "
|
||||
|
||||
@@ -926,7 +926,7 @@ namespace AzToolsFramework
|
||||
const bool entityIsFromIgnoredSliceInstance = ignoreSliceInstance && ignoreSliceInstance->IsValid() && ignoreSliceInstance->GetReference()->GetSliceAsset().GetId() == instanceAddr.GetReference()->GetSliceAsset().GetId();
|
||||
if (!entityIsFromIgnoredSliceInstance)
|
||||
{
|
||||
bool foundTargetAncestor = false;
|
||||
[[maybe_unused]] bool foundTargetAncestor = false;
|
||||
|
||||
const AZ::SliceComponent::EntityList& entitiesInInstance = instanceAddr.GetInstance()->GetInstantiated()->m_entities;
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ namespace AzToolsFramework
|
||||
void PropertyEnumComboBoxCtrl::setValue(AZ::s64 value)
|
||||
{
|
||||
m_pComboBox->blockSignals(true);
|
||||
bool indexWasFound = false;
|
||||
[[maybe_unused]] bool indexWasFound = false;
|
||||
for (size_t enumValIndex = 0; enumValIndex < m_enumValues.size(); enumValIndex++)
|
||||
{
|
||||
if (m_enumValues[enumValIndex].first == value)
|
||||
|
||||
@@ -430,7 +430,7 @@ namespace UnitTest
|
||||
size_t nextIndex = 1;
|
||||
size_t slices = 0;
|
||||
size_t liveAllocs = 0;
|
||||
size_t totalAllocs = 0;
|
||||
[[maybe_unused]] size_t totalAllocs = 0;
|
||||
|
||||
auto cb = [&liveAllocs](void*, const AZ::Debug::AllocationInfo&, unsigned char)
|
||||
{
|
||||
|
||||
@@ -1952,8 +1952,8 @@ CarrierThread::ProcessConnections()
|
||||
|
||||
bool isHandshakeTimeOut = false;
|
||||
bool isConnectionTimeout = false;
|
||||
bool isBadTrafficConditions = false;
|
||||
bool isBadPackets = false;
|
||||
[[maybe_unused]] bool isBadTrafficConditions = false;
|
||||
[[maybe_unused]] bool isBadPackets = false;
|
||||
if (connection->m_isBadPackets)
|
||||
{
|
||||
isBadPackets = true;
|
||||
|
||||
@@ -544,7 +544,7 @@ void ApplicationManagerBase::InitConnectionManager()
|
||||
EBUS_EVENT(AssetProcessor::ConnectionBus, SendPerPlatform, 0, message, QString::fromUtf8(message.m_platform.c_str()));
|
||||
};
|
||||
|
||||
bool result = QObject::connect(GetAssetCatalog(), &AssetProcessor::AssetCatalog::SendAssetMessage, connectionAndChangeMessagesThreadContext, forwardMessageFunction, Qt::QueuedConnection);
|
||||
[[maybe_unused]] bool result = QObject::connect(GetAssetCatalog(), &AssetProcessor::AssetCatalog::SendAssetMessage, connectionAndChangeMessagesThreadContext, forwardMessageFunction, Qt::QueuedConnection);
|
||||
AZ_Assert(result, "Failed to connect to AssetCatalog signal");
|
||||
|
||||
//Application manager related stuff
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace AssetProcessor
|
||||
TNetResponse netResponse;
|
||||
netRequest.m_request = request;
|
||||
|
||||
AZ::u32 type;
|
||||
[[maybe_unused]] AZ::u32 type;
|
||||
QByteArray data;
|
||||
AZStd::binary_semaphore wait;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace O3DE::ProjectManager
|
||||
o3deUserPath /= AZ::SettingsRegistryInterface::RegistryFolder;
|
||||
o3deUserPath /= "ProjectManager.setreg";
|
||||
|
||||
bool saved = false;
|
||||
[[maybe_unused]] bool saved = false;
|
||||
constexpr auto configurationMode =
|
||||
AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ protected:
|
||||
|
||||
sceneCoreModule = AZ::DynamicModuleHandle::Create("SceneCore");
|
||||
AZ_Assert(sceneCoreModule, "SceneBuilder unit tests failed to create SceneCore module.");
|
||||
bool loaded = sceneCoreModule->Load(false);
|
||||
[[maybe_unused]] bool loaded = sceneCoreModule->Load(false);
|
||||
AZ_Assert(loaded, "SceneBuilder unit tests failed to load SceneCore module.");
|
||||
auto init = sceneCoreModule->GetFunction<AZ::InitializeDynamicModuleFunction>(AZ::InitializeDynamicModuleFunctionName);
|
||||
AZ_Assert(init, "SceneBuilder unit tests failed to find the initialization function the SceneCore module.");
|
||||
|
||||
Reference in New Issue
Block a user