Fix unused warnings release (#3677)
* Release build fix for Windows * Release build fix for Android * Release build fix for Windows * Release build fix for Android * Release build fix for Linux * Release build fix for Mac * Release build fix for iOS Signed-off-by: Steve Pham <spham@amazon.com>
This commit is contained in:
@@ -153,6 +153,7 @@ namespace AZ
|
||||
// behavior, we would need to rework the way filters work as well as the code in AssetSerializer.cpp to pass down
|
||||
// the loadParams.m_assetLoadFilterCB that was passed into the AddDependentAssets() methods to use as the dependent
|
||||
// asset filter instead of this lambda function.
|
||||
AZ_UNUSED(handledAssetDependencyList); // Prevent unused warning in release builds
|
||||
AZ_Assert(AZStd::find(handledAssetDependencyList.begin(), handledAssetDependencyList.end(), filterInfo.m_assetId) !=
|
||||
handledAssetDependencyList.end(),
|
||||
"Dependent Asset ID (%s) is expected to load, but the Asset Catalog has no dependency recorded. "
|
||||
|
||||
@@ -1478,7 +1478,7 @@ namespace AZ
|
||||
|
||||
// Resolve the asset handler and account for the new asset instance.
|
||||
{
|
||||
AssetHandlerMap::iterator handlerIt = m_handlers.find(newData->GetType());
|
||||
[[maybe_unused]] AssetHandlerMap::iterator handlerIt = m_handlers.find(newData->GetType());
|
||||
AZ_Assert(
|
||||
handlerIt != m_handlers.end(), "No handler was registered for this asset [type:%s id:%s]!",
|
||||
newData->GetType().ToString<AZ::OSString>().c_str(), newData->GetId().ToString<AZ::OSString>().c_str());
|
||||
@@ -1869,7 +1869,7 @@ namespace AZ
|
||||
{
|
||||
AZStd::scoped_lock<AZStd::recursive_mutex> requestLock(m_activeBlockingRequestMutex);
|
||||
|
||||
auto inserted = m_activeBlockingRequests.insert(AZStd::make_pair(assetId, blockingRequest));
|
||||
[[maybe_unused]] auto inserted = m_activeBlockingRequests.insert(AZStd::make_pair(assetId, blockingRequest));
|
||||
AZ_Assert(inserted.second, "Failed to track blocking request for asset %s", assetId.ToString<AZStd::string>().c_str());
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,10 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
#if AZ_STREAMER_ADD_EXTRA_PROFILING_INFO
|
||||
static constexpr char DecompBoundName[] = "Decompression bound";
|
||||
static constexpr char ReadBoundName[] = "Read bound";
|
||||
#endif // AZ_STREAMER_ADD_EXTRA_PROFILING_INFO
|
||||
|
||||
bool FullFileDecompressor::DecompressionInformation::IsProcessing() const
|
||||
{
|
||||
|
||||
@@ -14,8 +14,10 @@
|
||||
|
||||
namespace AZ::IO
|
||||
{
|
||||
#if AZ_STREAMER_ADD_EXTRA_PROFILING_INFO
|
||||
static constexpr char SchedulerName[] = "Scheduler";
|
||||
static constexpr char ImmediateReadsName[] = "Immediate reads";
|
||||
#endif // AZ_STREAMER_ADD_EXTRA_PROFILING_INFO
|
||||
|
||||
Scheduler::Scheduler(AZStd::shared_ptr<StreamStackEntry> streamStack, u64 memoryAlignment, u64 sizeAlignment, u64 granularity)
|
||||
{
|
||||
@@ -337,7 +339,7 @@ namespace AZ::IO
|
||||
AZStd::chrono::system_clock::time_point now = AZStd::chrono::system_clock::now();
|
||||
auto visitor = [this, now](auto&& args) -> void
|
||||
#else
|
||||
auto visitor = [this](auto&& args) -> void
|
||||
auto visitor = [](auto&& args) -> void
|
||||
#endif
|
||||
{
|
||||
using Command = AZStd::decay_t<decltype(args)>;
|
||||
|
||||
@@ -17,10 +17,11 @@ namespace AZ
|
||||
namespace IO
|
||||
{
|
||||
static constexpr char ContextName[] = "Context";
|
||||
#if AZ_STREAMER_ADD_EXTRA_PROFILING_INFO
|
||||
static constexpr char PredictionAccuracyName[] = "Prediction accuracy (ms)";
|
||||
static constexpr char LatePredictionName[] = "Early completions";
|
||||
static constexpr char MissedDeadlinesName[] = "Missed deadlines";
|
||||
|
||||
#endif // AZ_STREAMER_ADD_EXTRA_PROFILING_INFO
|
||||
StreamerContext::~StreamerContext()
|
||||
{
|
||||
for (FileRequest* entry : m_internalRecycleBin)
|
||||
|
||||
@@ -511,7 +511,7 @@ AZ::OverrunDetectionSchemaImpl::OverrunDetectionSchemaImpl(const OverrunDetectio
|
||||
{
|
||||
m_platformAllocator.reset(new Internal::PlatformOverrunDetectionSchema);
|
||||
|
||||
auto info = m_platformAllocator->GetSystemInformation();
|
||||
[[maybe_unused]] auto info = m_platformAllocator->GetSystemInformation();
|
||||
AZ_Assert(info.m_pageSize == Internal::ODS_PAGE_SIZE, "System page size %d does not equal expected page size %d", info.m_pageSize, Internal::ODS_PAGE_SIZE);
|
||||
AZ_Assert(info.m_minimumAllocationSize == Internal::ODS_ALLOCATION_SIZE, "System minimum allocation size %d does not equal expected size %d", info.m_minimumAllocationSize, Internal::ODS_ALLOCATION_SIZE);
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace AZ
|
||||
{
|
||||
Internal::NameData* nameData = keyValue.second;
|
||||
const int useCount = keyValue.second->m_useCount;
|
||||
const bool hadCollision = keyValue.second->m_hashCollision;
|
||||
[[maybe_unused]] const bool hadCollision = keyValue.second->m_hashCollision;
|
||||
|
||||
if (useCount == 0)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace AZ
|
||||
|
||||
if (!overwriteExisting)
|
||||
{
|
||||
auto emplaceResult = m_context->m_handledTypesMap.try_emplace(uuid, serializer);
|
||||
[[maybe_unused]] auto emplaceResult = m_context->m_handledTypesMap.try_emplace(uuid, serializer);
|
||||
AZ_Assert(
|
||||
emplaceResult.second,
|
||||
"Couldn't register Json serializer %s. Another serializer (%s) has already been registered for the same Uuid (%s).",
|
||||
|
||||
@@ -1520,6 +1520,7 @@ namespace AZ
|
||||
{
|
||||
if (m_writeElementResultStack.empty())
|
||||
{
|
||||
AZ_UNUSED(classData); // Prevent unused warning in release builds
|
||||
AZ_Error("Serialize", false, "CloseElement is attempted to be called without a corresponding WriteElement when writing class %s", classData->m_name);
|
||||
return true;
|
||||
}
|
||||
@@ -1581,6 +1582,7 @@ namespace AZ
|
||||
{
|
||||
if (m_writeElementResultStack.empty())
|
||||
{
|
||||
AZ_UNUSED(classData); // Prevent unused warning in release builds
|
||||
AZ_Error("Serialize", false, "CloseElement is attempted to be called without a corresponding WriteElement when writing class %s", classData->m_name);
|
||||
return true;
|
||||
}
|
||||
@@ -1644,6 +1646,7 @@ namespace AZ
|
||||
{
|
||||
if (m_writeElementResultStack.empty())
|
||||
{
|
||||
AZ_UNUSED(classData); // Prevent unused warning in release builds
|
||||
AZ_Error("Serialize", false, "CloseElement is attempted to be called without a corresponding WriteElement when writing class %s", classData->m_name);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3839,6 +3839,7 @@ namespace AZ
|
||||
{
|
||||
if (instance->GetId() == existingInstance.GetId())
|
||||
{
|
||||
AZ_UNUSED(sliceReference); // Prevent unused warning in release builds
|
||||
AZ_Warning("Slice", false, "Multiple slice instances with the same ID from slice %s were found. The last instance found has been loaded.",
|
||||
sliceReference.GetSliceAsset().GetHint().c_str());
|
||||
return true;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace AZ
|
||||
timespec wait;
|
||||
wait.tv_sec = 0;
|
||||
wait.tv_nsec = 5000;
|
||||
int result = ::gethostuuid(hostId, &wait);
|
||||
[[maybe_unused]] int result = ::gethostuuid(hostId, &wait);
|
||||
AZ_Error("System", result == 0, "gethostuuid() failed with code %d", result);
|
||||
Sha1 hash;
|
||||
AZ::u32 digest[5] = { 0 };
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
#include <cctype>
|
||||
#include <stdio.h>
|
||||
|
||||
static const char* s_azFrameworkWarningWindow = "AzFramework";
|
||||
[[maybe_unused]] static const char* s_azFrameworkWarningWindow = "AzFramework";
|
||||
|
||||
namespace AzFramework
|
||||
{
|
||||
@@ -602,7 +602,7 @@ namespace AzFramework
|
||||
|
||||
void Application::SetRootPath(RootPathType type, const char* source)
|
||||
{
|
||||
const size_t sourceLen = strlen(source);
|
||||
[[maybe_unused]] const size_t sourceLen = strlen(source);
|
||||
|
||||
// Copy the source path to the intended root path and correct the path separators as well
|
||||
switch (type)
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace AzFramework::AssetBenchmark
|
||||
AZStd::thread benchmarkThread([assetList = AZStd::move(sourceAssetList), loadBlocking]()
|
||||
{
|
||||
// Define the set of loading stats to track
|
||||
const size_t initialRequests = assetList.size();
|
||||
[[maybe_unused]] const size_t initialRequests = assetList.size();
|
||||
size_t previouslyLoadedAssets = 0;
|
||||
size_t newlyLoadedAssets = 0;
|
||||
size_t loadErrors = 0;
|
||||
|
||||
@@ -24,9 +24,9 @@ namespace AZ
|
||||
namespace IO
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
const char* const NetworkFileIOChannel = "NetworkFileIO";
|
||||
[[maybe_unused]] const char* const NetworkFileIOChannel = "NetworkFileIO";
|
||||
#ifndef REMOTEFILEIO_IS_NETWORKFILEIO
|
||||
const char* const RemoteFileIOChannel = "RemoteFileIO";
|
||||
[[maybe_unused]] const char* const RemoteFileIOChannel = "RemoteFileIO";
|
||||
#ifdef REMOTEFILEIO_SYNC_CHECK
|
||||
const char* const RemoteFileCacheChannel = "RemoteFileCache";
|
||||
#endif
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace AzFramework
|
||||
//trying to connect, if any error occurs start the disconnect thread
|
||||
void AssetProcessorConnection::ConnectThread()
|
||||
{
|
||||
static constexpr char ConnectThreadWindow[] = "AssetProcessorConnection::ConnectThread";
|
||||
[[maybe_unused]] static constexpr char ConnectThreadWindow[] = "AssetProcessorConnection::ConnectThread";
|
||||
|
||||
//check for join before doing an op
|
||||
if (m_connectThread.m_join)
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace AzFramework
|
||||
const AZ::Frustum::PlaneId planeId3)
|
||||
{
|
||||
AZ::Vector3 corner = AZ::Vector3::CreateZero();
|
||||
const auto intersectionOkay = AZ::ShapeIntersection::IntersectThreePlanes(
|
||||
[[maybe_unused]] const auto intersectionOkay = AZ::ShapeIntersection::IntersectThreePlanes(
|
||||
frustum.GetPlane(planeId1), frustum.GetPlane(planeId2), frustum.GetPlane(planeId3), corner);
|
||||
AZ_Assert(intersectionOkay, "Plane intersection of Frustum failed");
|
||||
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ namespace AzFramework
|
||||
m_packedSensorDataArray = new float[packedSensorDataLength];
|
||||
|
||||
// create the java instance
|
||||
bool ret = m_motionSensorManager->CreateInstance("(Landroid/app/Activity;)V", AZ::Android::Utils::GetActivityRef());
|
||||
[[maybe_unused]] bool ret = m_motionSensorManager->CreateInstance("(Landroid/app/Activity;)V", AZ::Android::Utils::GetActivityRef());
|
||||
AZ_Assert(ret, "Failed to create the MotionSensorManager Java instance.");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -128,7 +128,7 @@ namespace AzFramework
|
||||
});
|
||||
|
||||
// create the java instance
|
||||
bool ret = m_keyboardHandler->CreateInstance("(Landroid/app/Activity;)V", AZ::Android::Utils::GetActivityRef());
|
||||
[[maybe_unused]] bool ret = m_keyboardHandler->CreateInstance("(Landroid/app/Activity;)V", AZ::Android::Utils::GetActivityRef());
|
||||
AZ_Assert(ret, "Failed to create the KeyboardHandler Java instance.");
|
||||
|
||||
// Connect to the raw input notifications bus
|
||||
|
||||
+2
-2
@@ -78,7 +78,7 @@ namespace AzFramework
|
||||
FD_ZERO(&set);
|
||||
FD_SET(handle->GetHandle(), &set);
|
||||
|
||||
int numReady = select(handle->GetHandle() + 1, &set, NULL, NULL, NULL);
|
||||
[[maybe_unused]] int numReady = select(handle->GetHandle() + 1, &set, NULL, NULL, NULL);
|
||||
|
||||
// if numReady == -1 and errno == EINTR then the child process died unexpectedly and
|
||||
// the handle was closed. Not something to assert about in regards to trying to read
|
||||
@@ -87,7 +87,7 @@ namespace AzFramework
|
||||
// dead and return any error codes the child may have written to the error stream.
|
||||
AZ_Assert(numReady != -1 || errno == EINTR, "Could not determine if any data is available for reading due to an error. Errno: %d", errno);
|
||||
|
||||
const bool wasSet = FD_ISSET(handle->GetHandle(), &set);
|
||||
[[maybe_unused]] const bool wasSet = FD_ISSET(handle->GetHandle(), &set);
|
||||
AZ_Assert(wasSet, "handle was not set when we selected it for read");
|
||||
|
||||
return 0;
|
||||
|
||||
+2
-2
@@ -75,7 +75,7 @@ namespace AzFramework
|
||||
FD_ZERO(&set);
|
||||
FD_SET(handle->GetHandle(), &set);
|
||||
|
||||
int numReady = select(handle->GetHandle() + 1, &set, NULL, NULL, NULL);
|
||||
[[maybe_unused]] int numReady = select(handle->GetHandle() + 1, &set, NULL, NULL, NULL);
|
||||
|
||||
// if numReady == -1 and errno == EINTR then the child process died unexpectedly and
|
||||
// the handle was closed. Not something to assert about in regards to trying to read
|
||||
@@ -84,7 +84,7 @@ namespace AzFramework
|
||||
// dead and return any error codes the child may have written to the error stream.
|
||||
AZ_Assert(numReady != -1 || errno == EINTR, "Could not determine if any data is available for reading due to an error. Errno: %d", errno);
|
||||
|
||||
const bool wasSet = FD_ISSET(handle->GetHandle(), &set);
|
||||
[[maybe_unused]] const bool wasSet = FD_ISSET(handle->GetHandle(), &set);
|
||||
AZ_Assert(wasSet, "handle was not set when we selected it for read");
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -181,10 +181,10 @@ namespace AzToolsFramework
|
||||
PrefabDomUtils::ApplyPatches(sourceTemplateDomCopy, targetTemplatePrefabDom.GetAllocator(), patchesReference->get());
|
||||
linkedInstanceDom.CopyFrom(sourceTemplateDomCopy, targetTemplatePrefabDom.GetAllocator());
|
||||
|
||||
PrefabDomValueReference sourceTemplateName =
|
||||
[[maybe_unused]] PrefabDomValueReference sourceTemplateName =
|
||||
PrefabDomUtils::FindPrefabDomValue(sourceTemplateDomCopy, PrefabDomUtils::SourceName);
|
||||
AZ_Assert(sourceTemplateName && sourceTemplateName->get().IsString(), "A valid source template name couldn't be found");
|
||||
PrefabDomValueReference targetTemplateName =
|
||||
[[maybe_unused]] PrefabDomValueReference targetTemplateName =
|
||||
PrefabDomUtils::FindPrefabDomValue(targetTemplatePrefabDom, PrefabDomUtils::SourceName);
|
||||
AZ_Assert(targetTemplateName && targetTemplateName->get().IsString(), "A valid target template name couldn't be found");
|
||||
|
||||
|
||||
@@ -1259,12 +1259,12 @@ namespace AzToolsFramework
|
||||
auto& containerEntity = *containerEntityPtr.release();
|
||||
auto editorPrefabComponent = containerEntity.FindComponent<EditorPrefabComponent>();
|
||||
containerEntity.Deactivate();
|
||||
const bool editorPrefabComponentRemoved = containerEntity.RemoveComponent(editorPrefabComponent);
|
||||
[[maybe_unused]] const bool editorPrefabComponentRemoved = containerEntity.RemoveComponent(editorPrefabComponent);
|
||||
AZ_Assert(editorPrefabComponentRemoved, "Remove EditorPrefabComponent failed.");
|
||||
delete editorPrefabComponent;
|
||||
containerEntity.Activate();
|
||||
|
||||
const bool containerEntityAdded = parentInstance.AddEntity(containerEntity);
|
||||
[[maybe_unused]] const bool containerEntityAdded = parentInstance.AddEntity(containerEntity);
|
||||
AZ_Assert(containerEntityAdded, "Add target Instance's container entity to its parent Instance failed.");
|
||||
|
||||
EntityIdList entityIds;
|
||||
@@ -1281,7 +1281,7 @@ namespace AzToolsFramework
|
||||
[&](AZStd::unique_ptr<AZ::Entity> entityPtr)
|
||||
{
|
||||
auto& entity = *entityPtr.release();
|
||||
const bool entityAdded = parentInstance.AddEntity(entity);
|
||||
[[maybe_unused]] const bool entityAdded = parentInstance.AddEntity(entity);
|
||||
AZ_Assert(entityAdded, "Add target Instance's entity to its parent Instance failed.");
|
||||
|
||||
entityIds.emplace_back(entity.GetId());
|
||||
|
||||
@@ -783,7 +783,7 @@ namespace AzToolsFramework
|
||||
|
||||
PrefabDomValue& instance = instanceIterator->value;
|
||||
AZ_Assert(instance.IsObject(), "Nested instance DOM provided is not a valid JSON object.");
|
||||
PrefabDomValueReference sourceTemplateName = PrefabDomUtils::FindPrefabDomValue(instance, PrefabDomUtils::SourceName);
|
||||
[[maybe_unused]] PrefabDomValueReference sourceTemplateName = PrefabDomUtils::FindPrefabDomValue(instance, PrefabDomUtils::SourceName);
|
||||
AZ_Assert(sourceTemplateName, "Couldn't find source template name in the DOM of the nested instance while creating a link.");
|
||||
AZ_Assert(
|
||||
sourceTemplateName->get() == sourceTemplate.GetFilePath().c_str(),
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace AzToolsFramework
|
||||
instanceDom.CopyFrom(instanceDomRef->get(), instanceDom.GetAllocator());
|
||||
|
||||
//apply the patch to the template within the target
|
||||
AZ::JsonSerializationResult::ResultCode result = PrefabDomUtils::ApplyPatches(instanceDom, instanceDom.GetAllocator(), patch);
|
||||
[[maybe_unused]] AZ::JsonSerializationResult::ResultCode result = PrefabDomUtils::ApplyPatches(instanceDom, instanceDom.GetAllocator(), patch);
|
||||
|
||||
AZ_Error(
|
||||
"Prefab",
|
||||
|
||||
@@ -2525,7 +2525,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
// This is an approximate measurement of how much this slice proliferates within the currently-loaded level.
|
||||
// Down the line we'll actually query the asset DB's dependency tree, summing up instances.
|
||||
|
||||
AZ_UNUSED(levelSlice); // Prevent unused warning in release builds
|
||||
AZ_Warning("SlicePush", levelSlice, "SlicePushWidget::CalculateReferenceCount could not find root slice, displayed counts will be inaccurate!");
|
||||
size_t instanceCount = 0;
|
||||
AZ::Data::AssetBus::EnumerateHandlersId(assetId,
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace UnitTest
|
||||
|
||||
//apply the patch
|
||||
PrefabDom& templateDomReference = m_prefabSystemComponent->FindTemplateDom(nestedTemplateId);
|
||||
AZ::JsonSerializationResult::ResultCode result =
|
||||
[[maybe_unused]] AZ::JsonSerializationResult::ResultCode result =
|
||||
PrefabDomUtils::ApplyPatches(templateDomReference, templateDomReference.GetAllocator(), patch);
|
||||
|
||||
AZ_Error("Prefab", result.GetOutcome() == AZ::JsonSerializationResult::Outcomes::Success,
|
||||
|
||||
@@ -1452,7 +1452,7 @@ void CarrierThread::NotifyRateUpdate(ThreadConnection* conn)
|
||||
float rtt = lifetime.m_rtt > 1.f ? lifetime.m_rtt : 100.f; //For unknown RTT use conservative 100ms to avoid buffer bloat
|
||||
//Note: using lifetime RTT as stand-in for smoothed RTT
|
||||
float ratef = (1010 * (cState.m_congestionWindow)) / rtt; //Add 10% to allow rate increases until buffer fills up
|
||||
constexpr float max_rate = azlossy_cast<float>(0x7FFFFFFF);
|
||||
[[maybe_unused]] constexpr float max_rate = azlossy_cast<float>(0x7FFFFFFF);
|
||||
AZ_Assert(ratef <= max_rate, " ratef %f > 0x7FFFFFFF", ratef);
|
||||
bytesPerSecond = static_cast<AZ::u32>(ratef);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user