diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetCommon.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetCommon.cpp index af3aba49a3..fdc3053b5c 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetCommon.cpp +++ b/Code/Framework/AzCore/AzCore/Asset/AssetCommon.cpp @@ -213,7 +213,7 @@ namespace AZ void AssetData::Acquire() { - AZ_Assert(m_useCount >= 0, "AssetData has been deleted") + AZ_Assert(m_useCount >= 0, "AssetData has been deleted"); AcquireWeak(); ++m_useCount; diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp index 6ba69cffd5..98182a9568 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp +++ b/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp @@ -2132,7 +2132,7 @@ namespace AZ } else { - AZ_Warning("AssetManager", false, "Couldn't find handler for asset %s (%s)", asset.GetId().ToString().c_str(), asset.GetHint().c_str()) + AZ_Warning("AssetManager", false, "Couldn't find handler for asset %s (%s)", asset.GetId().ToString().c_str(), asset.GetHint().c_str()); } // Notify any dependent jobs. diff --git a/Code/Framework/AzCore/AzCore/Debug/Trace.h b/Code/Framework/AzCore/AzCore/Debug/Trace.h index 11545375e4..a1334d334e 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Trace.h +++ b/Code/Framework/AzCore/AzCore/Debug/Trace.h @@ -262,17 +262,17 @@ namespace AZ #else // !AZ_ENABLE_TRACING - #define AZ_Assert(...) AZ_UNUSED(__VA_ARGS__) - #define AZ_Error(...) AZ_UNUSED(__VA_ARGS__) - #define AZ_ErrorOnce(...) AZ_UNUSED(__VA_ARGS__) - #define AZ_Warning(...) AZ_UNUSED(__VA_ARGS__) - #define AZ_WarningOnce(...) AZ_UNUSED(__VA_ARGS__) - #define AZ_TracePrintf(...) AZ_UNUSED(__VA_ARGS__) - #define AZ_TracePrintfOnce(...) AZ_UNUSED(__VA_ARGS__) + #define AZ_Assert(...) AZ_UNUSED(__VA_ARGS__); + #define AZ_Error(...) AZ_UNUSED(__VA_ARGS__); + #define AZ_ErrorOnce(...) AZ_UNUSED(__VA_ARGS__); + #define AZ_Warning(...) AZ_UNUSED(__VA_ARGS__); + #define AZ_WarningOnce(...) AZ_UNUSED(__VA_ARGS__); + #define AZ_TracePrintf(...) AZ_UNUSED(__VA_ARGS__); + #define AZ_TracePrintfOnce(...) AZ_UNUSED(__VA_ARGS__); - #define AZ_Verify(...) AZ_UNUSED(__VA_ARGS__) - #define AZ_VerifyError(...) AZ_UNUSED(__VA_ARGS__) - #define AZ_VerifyWarning(...) AZ_UNUSED(__VA_ARGS__) + #define AZ_Verify(...) AZ_UNUSED(__VA_ARGS__); + #define AZ_VerifyError(...) AZ_UNUSED(__VA_ARGS__); + #define AZ_VerifyWarning(...) AZ_UNUSED(__VA_ARGS__); #endif // AZ_ENABLE_TRACING diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index e4e3141c11..5a35603d0a 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -222,7 +222,7 @@ namespace AZ int AddRefCount(int value) { - AZ_Assert(value == 1 || value == -1, "ModRefCount is only for incrementing or decrementing on copy or destruction of ExposedLambda") + AZ_Assert(value == 1 || value == -1, "ModRefCount is only for incrementing or decrementing on copy or destruction of ExposedLambda"); lua_rawgeti(m_lua, LUA_REGISTRYINDEX, m_refCountRegistryIndex); // Lua: refCount-old const int refCount = Internal::azlua_tointeger(m_lua, -1) + value; diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.cpp index 39132ddb52..7978b8104b 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.cpp @@ -293,7 +293,7 @@ namespace AZ } AZ_Assert(!keyValues.Empty(), "Intermediate array for associative container can't be empty " - "because an empty array would be stored as an empty default object.") + "because an empty array would be stored as an empty default object."); if (CanBeConvertedToObject(keyValues)) { diff --git a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp index f326b021e7..b74039c876 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp @@ -2300,7 +2300,7 @@ namespace AZ { if (classData->m_converter) { - AZ_Assert(false, "A deprecated element with a data converter was passed to CloneObject, this is not supported.") + AZ_Assert(false, "A deprecated element with a data converter was passed to CloneObject, this is not supported."); } // push a dummy node in the stack cloneData->m_parentStack.push_back(); diff --git a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp index cb666a7c02..71ffece892 100644 --- a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp +++ b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp @@ -109,12 +109,12 @@ namespace AZ::Internal { FixedValueString engineName; settingsRegistry.Get(engineName, engineMonikerKey); - AZ_Warning("SettingsRegistryMergeUtils",engineInfo.m_moniker == engineName, + AZ_Warning("SettingsRegistryMergeUtils", engineInfo.m_moniker == engineName, R"(The engine name key "%s" mapped to engine path "%s" within the global manifest of "%s")" R"( does not match the "engine_name" field "%s" in the engine.json)" "\n" "This engine should be re-registered.", engineInfo.m_moniker.c_str(), engineInfo.m_path.c_str(), engineManifestPath.c_str(), - engineName.c_str()) + engineName.c_str()); engineInfo.m_moniker = engineName; } } diff --git a/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp b/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp index 03ed3f6ebb..82a9175cf9 100644 --- a/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp +++ b/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp @@ -3464,7 +3464,7 @@ namespace AZ const SliceComponent::DataFlagsPerEntity* SliceComponent::GetCorrectBundleOfDataFlags(EntityId entityId) const { // It would be possible to search non-instantiated slices by crawling over lists, but we haven't needed the capability yet. - AZ_Assert(IsInstantiated(), "Data flag access is only permitted after slice is instantiated.") + AZ_Assert(IsInstantiated(), "Data flag access is only permitted after slice is instantiated."); if (IsInstantiated()) { diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/Platform_Windows.cpp b/Code/Framework/AzCore/Platform/Windows/AzCore/Platform_Windows.cpp index cc45b36c41..39cb9e8c10 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/Platform_Windows.cpp +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/Platform_Windows.cpp @@ -42,7 +42,7 @@ namespace AZ } else { - AZ_Error("System", false, "Failed to open HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\MachineGuid!") + AZ_Error("System", false, "Failed to open HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\MachineGuid!"); } wchar_t* hostname = machineInfo + wcslen(machineInfo); diff --git a/Code/Framework/AzCore/Tests/Patching.cpp b/Code/Framework/AzCore/Tests/Patching.cpp index ee887d66c2..29b25ebf28 100644 --- a/Code/Framework/AzCore/Tests/Patching.cpp +++ b/Code/Framework/AzCore/Tests/Patching.cpp @@ -2651,7 +2651,7 @@ namespace UnitTest if (!rootElement.GetChildData(AZ_CRC("InnerBaseStringField"), stringField)) { AZ_Error("PatchingTest", false, "Unable to retrieve 'InnerBaseStringField' data for %u version of the InnerObjectFieldConverterClass", - rootElement.GetVersion()) + rootElement.GetVersion()); return false; } diff --git a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp index 8db0c27475..5cd36ca05a 100644 --- a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp +++ b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp @@ -281,7 +281,7 @@ namespace AzFramework AZ_PROFILE_FUNCTION(AzCore); auto data = AZStd::get_if(&request->GetCommand()); - AZ_Assert(data, "Request doing reading in the RemoteStorageDrive didn't contain read data.") + AZ_Assert(data, "Request doing reading in the RemoteStorageDrive didn't contain read data."); HandleType file = InvalidHandle; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.cpp index 7acc7ad0d0..7b879e89b1 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.cpp @@ -303,7 +303,7 @@ VectorInput::~VectorInput() void VectorInput::setLabel(int index, const QString& label) { AZ_Warning("PropertyGrid", index < m_elementCount, - "This control handles only %i controls", m_elementCount) + "This control handles only %i controls", m_elementCount); if (index < m_elementCount) { m_elements[index]->setLabel(label); @@ -313,7 +313,7 @@ void VectorInput::setLabel(int index, const QString& label) void VectorInput::setLabelStyle(int index, const QString& qss) { AZ_Warning("PropertyGrid", index < m_elementCount, - "This control handles only %i controls", m_elementCount) + "This control handles only %i controls", m_elementCount); if (index < m_elementCount) { m_elements[index]->getLabelWidget()->setStyleSheet(qss); @@ -323,7 +323,7 @@ void VectorInput::setLabelStyle(int index, const QString& qss) void VectorInput::setValuebyIndex(double value, int elementIndex) { AZ_Warning("PropertyGrid", elementIndex < m_elementCount, - "This control handles only %i controls", m_elementCount) + "This control handles only %i controls", m_elementCount); if (elementIndex < m_elementCount) { m_elements[elementIndex]->setValue(value); diff --git a/Code/Framework/GFxFramework/GFxFramework/MaterialIO/Material.cpp b/Code/Framework/GFxFramework/GFxFramework/MaterialIO/Material.cpp index de035ed9b6..22843fa230 100644 --- a/Code/Framework/GFxFramework/GFxFramework/MaterialIO/Material.cpp +++ b/Code/Framework/GFxFramework/GFxFramework/MaterialIO/Material.cpp @@ -236,7 +236,7 @@ namespace AZ case TextureMapType::Bump: return m_normalMap; default: - AZ_Assert(false, "Invalid Texture map requested.") + AZ_Assert(false, "Invalid Texture map requested."); return m_empty; } } @@ -255,7 +255,7 @@ namespace AZ m_normalMap = texture; break; default: - AZ_Assert(false, "Invalid Texture map requested.") + AZ_Assert(false, "Invalid Texture map requested."); break; } } @@ -599,7 +599,7 @@ namespace AZ if (!materialNode) { - AZ_Assert(false, "Attempted to add material to invalid xml document.") + AZ_Assert(false, "Attempted to add material to invalid xml document."); return false; } diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaChunk.cpp b/Code/Framework/GridMate/GridMate/Replica/ReplicaChunk.cpp index ee42ff2ad0..d3db481ccd 100644 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaChunk.cpp +++ b/Code/Framework/GridMate/GridMate/Replica/ReplicaChunk.cpp @@ -351,7 +351,7 @@ namespace GridMate DataSetBase* dataset = descriptor->GetDataSet(this, i); if (!dataset) { - AZ_Assert(false, "How can we have a dirty dataset that doesn't exist?") + AZ_Assert(false, "How can we have a dirty dataset that doesn't exist?"); continue; } diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h b/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h index 03f813ac6c..be1a86b627 100644 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h +++ b/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h @@ -64,7 +64,7 @@ namespace GridMate // Create Callback AZStd::weak_ptr CreateCallback(AZ::u64 revision) { - AZ_Assert(IsAckEnabled(), "ACK disabled.") //Shouldn't happen + AZ_Assert(IsAckEnabled(), "ACK disabled."); //Shouldn't happen AZ_Assert(m_replicaRevision <= revision, "Cannot decrease replica revision"); if(!m_callback || m_callback->m_revision != revision) diff --git a/Code/Framework/GridMate/GridMate/Session/Session.cpp b/Code/Framework/GridMate/GridMate/Session/Session.cpp index b731d82b71..3dcb16b08d 100644 --- a/Code/Framework/GridMate/GridMate/Session/Session.cpp +++ b/Code/Framework/GridMate/GridMate/Session/Session.cpp @@ -1583,7 +1583,7 @@ GridSession::OnStateCreate(HSM& sm, const HSM::Event& e) // Bind member replica bool isAdded = AddMember(m_myMember); - AZ_Error("GridMate", isAdded, "Failed to add my replica, check the number of open slots!") + AZ_Error("GridMate", isAdded, "Failed to add my replica, check the number of open slots!"); if (!isAdded) { sm.Transition(SS_DELETE); diff --git a/Code/Framework/GridMate/GridMate/Session/Session.h b/Code/Framework/GridMate/GridMate/Session/Session.h index 5080570373..e075a0aa48 100644 --- a/Code/Framework/GridMate/GridMate/Session/Session.h +++ b/Code/Framework/GridMate/GridMate/Session/Session.h @@ -698,7 +698,7 @@ namespace GridMate static void* UserDataCopier(const void* sourceData, unsigned int sourceDataSize) { (void)sourceDataSize; - AZ_Assert(sizeof(T) == sourceDataSize, "Data size %d doesn't match the type size %d", sourceDataSize, sizeof(T)) + AZ_Assert(sizeof(T) == sourceDataSize, "Data size %d doesn't match the type size %d", sourceDataSize, sizeof(T)); return azcreate(T, (*static_cast(sourceData)), GridMateAllocatorMP, "UserDataCopier"); } template diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/AssetCreator.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/AssetCreator.h index 08d6292541..abdbe9cdce 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/AssetCreator.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/AssetCreator.h @@ -150,18 +150,22 @@ namespace AZ template template - void AssetCreator::ReportError(const char* format, Args... args) + void AssetCreator::ReportError([[maybe_unused]] const char* format, [[maybe_unused]] Args... args) { ++m_errorCount; +#if defined(AZ_ENABLE_TRACING) // disabling since it requires argument expansion in this context AZ_Error(m_assetClassName, false, format, args...); +#endif } template template - void AssetCreator::ReportWarning(const char* format, Args... args) + void AssetCreator::ReportWarning([[maybe_unused]] const char* format, [[maybe_unused]] Args... args) { ++m_warningCount; +#if defined(AZ_ENABLE_TRACING) // disabling since it requires argument expansion in this context AZ_Warning(m_assetClassName, false, format, args...); +#endif } template diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp index 9fc99e3ea4..1da16b44b6 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp @@ -1078,9 +1078,7 @@ namespace AZ template void ModelAssetBuilderComponent::ValidateStreamSize([[maybe_unused]] size_t expectedVertexCount, [[maybe_unused]] const AZStd::vector& bufferData, [[maybe_unused]] AZ::RHI::Format format, [[maybe_unused]] const char* streamName) const { -#if defined(AZ_ENABLE_TRACING) size_t actualVertexCount = (bufferData.size() * sizeof(T)) / RHI::GetFormatSize(format); -#endif AZ_Error(s_builderName, expectedVertexCount == actualVertexCount, "VertexStream '%s' does not match the expected vertex count. This typically means multiple sub-meshes have mis-matched vertex stream layouts (such as one having more uv sets than the other) but are assigned the same material in the dcc tool so they were merged.", streamName); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp index 44141f3ae3..f5812aae8b 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp @@ -70,11 +70,9 @@ namespace AZ::RPI { const Containers::SceneGraph& sceneGraph = scene.GetGraph(); -#if defined(AZ_ENABLE_TRACING) const auto baseMeshIt = AZStd::find(sceneGraph.GetContentStorage().cbegin(), sceneGraph.GetContentStorage().cend(), sourceMesh.m_meshData); const Containers::SceneGraph::NodeIndex baseMeshIndex = sceneGraph.ConvertToNodeIndex(baseMeshIt); const AZStd::string_view baseMeshName{sceneGraph.GetNodeName(baseMeshIndex).GetName(), sceneGraph.GetNodeName(baseMeshIndex).GetNameLength()}; -#endif // Get the blend shapes for the given mesh AZStd::unordered_map blendShapeInfos = GetBlendShapeInfos(scene, sourceMesh.m_meshData.get()); @@ -90,10 +88,8 @@ namespace AZ::RPI AZ_Assert(blendShapeData, "Node is expected to be a blend shape."); if (blendShapeData) { -#if defined(AZ_ENABLE_TRACING) const Containers::SceneGraph::NodeIndex morphMeshParentIndex = sceneGraph.GetNodeParent(sceneNodeIndex); const AZStd::string_view sourceMeshName{sceneGraph.GetNodeName(morphMeshParentIndex).GetName(), sceneGraph.GetNodeName(morphMeshParentIndex).GetNameLength()}; -#endif AZ_Assert(AZ::StringFunc::Equal(baseMeshName, sourceMeshName, /*bCaseSensitive=*/true), "Scene graph mesh node (%.*s) has a different name than the product mesh (%.*s).", diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialFunctor.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialFunctor.cpp index 3945560eb3..d08fa3e58e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialFunctor.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialFunctor.cpp @@ -419,9 +419,7 @@ namespace AZ { if (!materialPropertyDependencies.test(index.GetIndex())) { -#if defined(AZ_ENABLE_TRACING) const MaterialPropertyDescriptor* propertyDescriptor = materialPropertiesLayout.GetPropertyDescriptor(index); -#endif AZ_Error("MaterialFunctor", false, "Material functor accessing an unregistered material property '%s'.", propertyDescriptor ? propertyDescriptor->GetName().GetCStr() : ""); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/ScriptEventsNodePaletteTreeItemTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/ScriptEventsNodePaletteTreeItemTypes.cpp index da0e9c6045..704f67e034 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/ScriptEventsNodePaletteTreeItemTypes.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/ScriptEventsNodePaletteTreeItemTypes.cpp @@ -154,9 +154,7 @@ namespace ScriptCanvasEditor const ScriptEvents::ScriptEvent& definition = data->m_definition; -#if defined(AZ_ENABLE_TRACING) bool recategorize = previousDefinition ? definition.GetCategory().compare(previousDefinition->GetCategory()) != 0 : false; -#endif AZ_Warning("ScriptCanvas", !recategorize, "Unable to recategorize ScriptEvents events while open. Please close and re-open the Script Canvas Editor to see the new categorization"); if (definition.GetName().empty()) diff --git a/Gems/WhiteBox/Code/Source/Rendering/Atom/TangentSpaceHelper.cpp b/Gems/WhiteBox/Code/Source/Rendering/Atom/TangentSpaceHelper.cpp index 913778cc44..a43b48d3b9 100644 --- a/Gems/WhiteBox/Code/Source/Rendering/Atom/TangentSpaceHelper.cpp +++ b/Gems/WhiteBox/Code/Source/Rendering/Atom/TangentSpaceHelper.cpp @@ -73,9 +73,7 @@ namespace WhiteBox for (AZ::u32 i = 0; i < triangleCount; ++i) { -#if defined(AZ_ENABLE_TRACING) const auto& trianglePositions = trianglesPositions[i]; -#endif const auto& triangleUVs = trianglesUVs[i]; const auto& triangleEdges = trianglesEdges[i];