diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.h b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.h index 0abf7d295c..9bd34f3f7c 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.h +++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.h @@ -122,7 +122,7 @@ protected: public: //! Get number of child nodes. - int GetChildCount() const { return m_childs.size(); }; + int GetChildCount() const { return static_cast(m_childs.size()); }; //! Get Child by id. ReflectedPropertyItem* GetChild(int index) const { return m_childs[index]; } PropertyType GetType() const { return m_type; } diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp index 874868b5bc..ead320367e 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp @@ -803,7 +803,7 @@ void SandboxIntegrationManager::SetupLayerContextMenu(QMenu* menu) menu->addSeparator(); - const int selectedLayerCount = layersInSelection.size(); + const int selectedLayerCount = static_cast(layersInSelection.size()); QString saveTitle = QObject::tr("Save layer"); if(selectedLayerCount > 1) { diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp index 50d111d9b3..02d2174fb8 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp @@ -259,7 +259,7 @@ QVariant OutlinerListModel::dataForName(const QModelIndex& index, int role) cons if (highlightTextIndex >= 0) { const QString BACKGROUND_COLOR{ "#707070" }; - label.insert(highlightTextIndex + m_filterString.length(), ""); + label.insert(static_cast(highlightTextIndex + m_filterString.length()), ""); label.insert(highlightTextIndex, ""); } } while(highlightTextIndex > 0); diff --git a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp index 5c80813590..caba8b5ae7 100644 --- a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp @@ -51,7 +51,7 @@ protected: TEST_F(AWSScriptBehaviorsComponentTest, Reflect) { - int oldEBusNum = m_behaviorContext->m_ebuses.size(); + int oldEBusNum = static_cast(m_behaviorContext->m_ebuses.size()); m_componentDescriptor.reset(AWSScriptBehaviorsComponent::CreateDescriptor()); m_componentDescriptor->Reflect(m_serializeContext.get()); m_componentDescriptor->Reflect(m_behaviorContext.get()); diff --git a/Gems/Atom/Feature/Common/Code/Source/AuxGeom/DynamicPrimitiveProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/AuxGeom/DynamicPrimitiveProcessor.cpp index 08b3821b41..ea726dd914 100644 --- a/Gems/Atom/Feature/Common/Code/Source/AuxGeom/DynamicPrimitiveProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/AuxGeom/DynamicPrimitiveProcessor.cpp @@ -196,13 +196,13 @@ namespace AZ { const size_t sourceByteSize = source.size() * sizeof(AuxGeomIndex); - RHI::Ptr dynamicBuffer = RPI::DynamicDrawInterface::Get()->GetDynamicBuffer(sourceByteSize); + RHI::Ptr dynamicBuffer = RPI::DynamicDrawInterface::Get()->GetDynamicBuffer(static_cast(sourceByteSize)); if (!dynamicBuffer) { AZ_WarningOnce("AuxGeom", false, "Failed to allocate dynamic buffer of size %d.", sourceByteSize); return false; - } - dynamicBuffer->Write(source.data(), sourceByteSize); + } + dynamicBuffer->Write(source.data(), static_cast(sourceByteSize)); group.m_indexBufferView = dynamicBuffer->GetIndexBufferView(RHI::IndexFormat::Uint32); return true; } @@ -211,13 +211,13 @@ namespace AZ { const size_t sourceByteSize = source.size() * sizeof(AuxGeomDynamicVertex); - RHI::Ptr dynamicBuffer = RPI::DynamicDrawInterface::Get()->GetDynamicBuffer(sourceByteSize); + RHI::Ptr dynamicBuffer = RPI::DynamicDrawInterface::Get()->GetDynamicBuffer(static_cast(sourceByteSize)); if (!dynamicBuffer) { AZ_WarningOnce("AuxGeom", false, "Failed to allocate dynamic buffer of size %d.", sourceByteSize); return false; - } - dynamicBuffer->Write(source.data(), sourceByteSize); + } + dynamicBuffer->Write(source.data(), static_cast(sourceByteSize)); group.m_streamBufferViews[0] = dynamicBuffer->GetStreamBufferView(sizeof(AuxGeomDynamicVertex)); return true; } diff --git a/Gems/BarrierInput/Code/Source/BarrierInputClient.cpp b/Gems/BarrierInput/Code/Source/BarrierInputClient.cpp index b1ca6cb7d7..495ef88467 100644 --- a/Gems/BarrierInput/Code/Source/BarrierInputClient.cpp +++ b/Gems/BarrierInput/Code/Source/BarrierInputClient.cpp @@ -54,7 +54,7 @@ namespace BarrierInput int ReadU8() { int ret = data[0]; data += 1; return ret; } void Eat(int len) { data += len; } - void InsertString(const char* str) { int len = strlen(str); memcpy(end, str, len); end += len; } + void InsertString(const char* str) { int len = static_cast(strlen(str)); memcpy(end, str, len); end += len; } void InsertU32(int a) { end[0] = a >> 24; end[1] = a >> 16; end[2] = a >> 8; end[3] = a; end += 4; } void InsertU16(int a) { end[0] = a >> 8; end[1] = a; end += 2; } void InsertU8(int a) { end[0] = a; end += 1; } @@ -93,7 +93,7 @@ namespace BarrierInput stream.InsertString("Barrier"); stream.InsertU16(1); stream.InsertU16(4); - stream.InsertU32(pContext->GetClientScreenName().length()); + stream.InsertU32(static_cast(pContext->GetClientScreenName().length())); stream.InsertString(pContext->GetClientScreenName().c_str()); stream.ClosePacket(); return barrierSendFunc(pContext, stream.GetBuffer(), stream.GetLength()); @@ -268,7 +268,7 @@ namespace BarrierInput int i; for (i = 0; i < numPackets; ++i) { - const int len = strlen(s_packets[i].pattern); + const int len = static_cast(strlen(s_packets[i].pattern)); if (packetLength >= len && memcmp(stream.GetData(), s_packets[i].pattern, len) == 0) { bool bDone = false; diff --git a/Gems/Camera/Code/Source/ViewportCameraSelectorWindow.cpp b/Gems/Camera/Code/Source/ViewportCameraSelectorWindow.cpp index 9644aa76f9..f664d78c0e 100644 --- a/Gems/Camera/Code/Source/ViewportCameraSelectorWindow.cpp +++ b/Gems/Camera/Code/Source/ViewportCameraSelectorWindow.cpp @@ -102,7 +102,7 @@ namespace Camera int CameraListModel::rowCount([[maybe_unused]] const QModelIndex& parent) const { - return m_cameraItems.size(); + return static_cast(m_cameraItems.size()); } QVariant CameraListModel::data(const QModelIndex& index, int role) const diff --git a/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp index 223a3e14f2..68198c491a 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp @@ -401,7 +401,7 @@ namespace LmbrCentral // 2 verts for each segment // loops == sides // 2 loops per segment - const AZ::u32 segments = segmentCount * spline->GetSegmentGranularity(); + const AZ::u32 segments = static_cast(segmentCount * spline->GetSegmentGranularity()); const AZ::u32 totalEndSegments = capSegments * 2 * 2 * 2 * 2; const AZ::u32 totalSegments = segments * 2 * 2 * 2; const AZ::u32 totalLoops = 2 * sides * segments * 2; diff --git a/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp b/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp index c882252d50..412e53d0da 100644 --- a/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp +++ b/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp @@ -161,7 +161,7 @@ namespace PhysX // Add it to the list otherwise sourceSceneMaterialNames.push_back(materialName); - AZ::u16 newIndex = sourceSceneMaterialNames.size() - 1; + AZ::u16 newIndex = static_cast(sourceSceneMaterialNames.size() - 1); materialIndexByName[materialName] = newIndex; return newIndex;