More fixes

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-09-08 16:50:57 -07:00
parent d58bda5bbf
commit f414cd3966
23 changed files with 37 additions and 45 deletions
@@ -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;
@@ -2132,7 +2132,7 @@ namespace AZ
}
else
{
AZ_Warning("AssetManager", false, "Couldn't find handler for asset %s (%s)", asset.GetId().ToString<AZStd::string>().c_str(), asset.GetHint().c_str())
AZ_Warning("AssetManager", false, "Couldn't find handler for asset %s (%s)", asset.GetId().ToString<AZStd::string>().c_str(), asset.GetHint().c_str());
}
// Notify any dependent jobs.
+10 -10
View File
@@ -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
@@ -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;
@@ -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))
{
@@ -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();
@@ -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;
}
}
@@ -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())
{
@@ -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);
+1 -1
View File
@@ -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;
}
@@ -281,7 +281,7 @@ namespace AzFramework
AZ_PROFILE_FUNCTION(AzCore);
auto data = AZStd::get_if<FileRequest::ReadData>(&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;
@@ -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);
@@ -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;
}
@@ -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;
}
@@ -64,7 +64,7 @@ namespace GridMate
// Create Callback
AZStd::weak_ptr<TargetCallbackBase> 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)
@@ -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);
@@ -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<const T*>(sourceData)), GridMateAllocatorMP, "UserDataCopier");
}
template<class T>
@@ -150,18 +150,22 @@ namespace AZ
template<typename AssetDataT>
template<typename ... Args>
void AssetCreator<AssetDataT>::ReportError(const char* format, Args... args)
void AssetCreator<AssetDataT>::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<typename AssetDataT>
template<typename ... Args>
void AssetCreator<AssetDataT>::ReportWarning(const char* format, Args... args)
void AssetCreator<AssetDataT>::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<typename AssetDataT>
@@ -1078,9 +1078,7 @@ namespace AZ
template<typename T>
void ModelAssetBuilderComponent::ValidateStreamSize([[maybe_unused]] size_t expectedVertexCount, [[maybe_unused]] const AZStd::vector<T>& 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);
}
@@ -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<AZStd::string, SourceBlendShapeInfo> 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).",
@@ -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() : "<unknown>");
}
@@ -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())
@@ -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];