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:
Steve Pham
2021-08-30 13:10:41 -07:00
committed by GitHub
parent da6bdd5b43
commit fa0f2a1007
94 changed files with 150 additions and 130 deletions
@@ -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 };