diff --git a/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.cpp b/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.cpp index 39e5bd0f5f..315a8ebfef 100644 --- a/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.cpp +++ b/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.cpp @@ -1402,7 +1402,7 @@ void SplineWidget::mouseMoveEvent(QMouseEvent* event) QString tipText; bool boFoundTheSelectedKey(false); - for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) + for (int splineIndex = 0, endSpline = static_cast(m_splines.size()); splineIndex < endSpline; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; for (int i = 0; i < pSpline->GetKeyCount(); i++) @@ -1619,7 +1619,7 @@ bool AbstractSplineWidget::IsKeySelected(ISplineInterpolator* pSpline, int nKey, int AbstractSplineWidget::GetNumSelected() { int nSelected = 0; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { if (ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline) { @@ -1726,7 +1726,7 @@ AbstractSplineWidget::EHitCode AbstractSplineWidget::HitTest(const QPoint& point } // For each Spline... - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; ISplineInterpolator* pDetailSpline = m_splines[splineIndex].pDetailSpline; @@ -1867,7 +1867,7 @@ void AbstractSplineWidget::ScaleAmplitudeKeys(float time, float startValue, floa m_nHitKeyIndex = -1; m_nHitDimension = -1; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -1971,7 +1971,7 @@ void AbstractSplineWidget::TimeScaleKeys(float time, float startTime, float endT float affectedRangeMin = FLT_MAX; float affectedRangeMax = -FLT_MAX; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2078,7 +2078,7 @@ void AbstractSplineWidget::ValueScaleKeys(float startValue, float endValue) m_nHitKeyIndex = -1; m_nHitDimension = -1; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2119,7 +2119,7 @@ void AbstractSplineWidget::MoveSelectedKeys(Vec2 offset, bool copyKeys) float affectedRangeMin = FLT_MAX; float affectedRangeMax = -FLT_MAX; // For each spline... - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2241,7 +2241,7 @@ void AbstractSplineWidget::RemoveSelectedKeys() m_pHitDetailSpline = 0; m_nHitKeyIndex = -1; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2281,7 +2281,7 @@ void AbstractSplineWidget::RemoveSelectedKeyTimesImpl() StoreUndo(); SendNotifyEvent(SPLN_BEFORE_CHANGE); - for (int splineIndex = 0, end = m_splines.size(); splineIndex < end; ++splineIndex) + for (int splineIndex = 0, end = static_cast(m_splines.size()); splineIndex < end; ++splineIndex) { std::vector::iterator itTime = m_keyTimes.begin(), endTime = m_keyTimes.end(); for (int keyIndex = 0, endIndex = m_splines[splineIndex].pSpline->GetKeyCount(); keyIndex < endIndex; ) @@ -2319,7 +2319,7 @@ void AbstractSplineWidget::RedrawWindowAroundMarker() { UpdateKeyTimes(); std::vector::iterator itKeyTime = std::lower_bound(m_keyTimes.begin(), m_keyTimes.end(), KeyTime(m_fTimeMarker, 0)); - int keyTimeIndex = (itKeyTime != m_keyTimes.end() ? itKeyTime - m_keyTimes.begin() : m_keyTimes.size()); + int keyTimeIndex = static_cast(itKeyTime != m_keyTimes.end() ? itKeyTime - m_keyTimes.begin() : m_keyTimes.size()); int redrawRangeStart = (keyTimeIndex >= 2 ? aznumeric_cast(TimeToXOfs(m_keyTimes[keyTimeIndex - 2].time)) : m_rcSpline.left()); int redrawRangeEnd = (keyTimeIndex < int(m_keyTimes.size()) - 2 ? aznumeric_cast(TimeToXOfs(m_keyTimes[keyTimeIndex + 2].time)) : m_rcSpline.right()); @@ -2421,7 +2421,7 @@ void AbstractSplineWidget::ClearSelection() { ConditionalStoreUndo(); - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2465,7 +2465,7 @@ void AbstractSplineWidget::StoreUndo() if (UiAnimUndo::IsRecording() && !m_pCurrentUndo) { std::vector splines(m_splines.size()); - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { splines[splineIndex] = m_splines[splineIndex].pSpline; } @@ -2508,7 +2508,7 @@ void AbstractSplineWidget::DuplicateSelectedKeys() typedef std::vector KeysToAddContainer; KeysToAddContainer keysToInsert; - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2608,7 +2608,7 @@ void AbstractSplineWidget::KeyAll() ////////////////////////////////////////////////////////////////////////// void AbstractSplineWidget::SelectAll() { - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -2756,7 +2756,7 @@ void AbstractSplineWidget::SelectRectangle(const QRect& rc, bool bSelect) { std::swap(t0, t1); } - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; ISplineInterpolator* pDetailSpline = m_splines[splineIndex].pDetailSpline; @@ -2972,7 +2972,7 @@ void AbstractSplineWidget::ModifySelectedKeysFlags(int nRemoveFlags, int nAddFla SendNotifyEvent(SPLN_BEFORE_CHANGE); - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (int splineIndex = 0, splineCount = static_cast(m_splines.size()); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -3138,7 +3138,7 @@ void AbstractSplineWidget::GotoNextKey(bool previousKey) { bool boFoundTheSelectedKey(false); - for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) + for (int splineIndex = 0, endSpline = static_cast(m_splines.size()); splineIndex < endSpline; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; for (int i = 0; i < pSpline->GetKeyCount(); i++) @@ -3180,7 +3180,7 @@ void AbstractSplineWidget::GotoNextKey(bool previousKey) } else { - for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) + for (int splineIndex = 0, endSpline = static_cast(m_splines.size()); splineIndex < endSpline; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; @@ -3231,7 +3231,7 @@ void AbstractSplineWidget::RemoveAllKeysButThis() { std::vector keys; - for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) + for (int splineIndex = 0, endSpline = static_cast(m_splines.size()); splineIndex < endSpline; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; diff --git a/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.h b/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.h index 18ee7e173c..edb0cfa4e2 100644 --- a/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.h +++ b/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.h @@ -90,7 +90,7 @@ public: void AddSpline(ISplineInterpolator * pSpline, ISplineInterpolator * pDetailSpline, COLORREF anColorArray[4]); void RemoveSpline(ISplineInterpolator* pSpline); void RemoveAllSplines(); - int GetSplineCount() const { return m_splines.size(); } + int GetSplineCount() const { return static_cast(m_splines.size()); } ISplineInterpolator* GetSpline(int nIndex) const { return m_splines[nIndex].pSpline; } void SetTimeMarker(float fTime); diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewAnimNode.h b/Gems/LyShine/Code/Editor/Animation/UiAnimViewAnimNode.h index 40d9013392..72dc7344ec 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewAnimNode.h +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewAnimNode.h @@ -27,7 +27,7 @@ namespace AZ class CUiAnimViewAnimNodeBundle { public: - unsigned int GetCount() const { return m_animNodes.size(); } + unsigned int GetCount() const { return static_cast(m_animNodes.size()); } CUiAnimViewAnimNode* GetNode(const unsigned int index) { return m_animNodes[index]; } const CUiAnimViewAnimNode* GetNode(const unsigned int index) const { return m_animNodes[index]; } diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNode.h b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNode.h index 61833adcd6..5a82d1be7f 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNode.h +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNode.h @@ -121,7 +121,7 @@ public: virtual bool AreAllKeysOfSameType() const override { return m_bAllOfSameType; } - virtual unsigned int GetKeyCount() const override { return m_keys.size(); } + virtual unsigned int GetKeyCount() const override { return static_cast(m_keys.size()); } virtual CUiAnimViewKeyHandle GetKey(unsigned int index) override { return m_keys[index]; } virtual void SelectKeys(const bool bSelected) override; @@ -173,7 +173,7 @@ public: CUiAnimViewNode* GetParentNode() const { return m_pParentNode; } // Children - unsigned int GetChildCount() const { return m_childNodes.size(); } + unsigned int GetChildCount() const { return static_cast(m_childNodes.size()); } CUiAnimViewNode* GetChild(unsigned int index) const { return m_childNodes[index].get(); } // Snap time value to prev/next key in sequence diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequence.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequence.cpp index 7f7f8f7aaf..86554c2004 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequence.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequence.cpp @@ -1320,7 +1320,7 @@ void CUiAnimViewSequence::CloneSelectedKeys() std::vector selectedKeyTimes; for (size_t k = 0; k < selectedKeys.GetKeyCount(); ++k) { - CUiAnimViewKeyHandle skey = selectedKeys.GetKey(k); + CUiAnimViewKeyHandle skey = selectedKeys.GetKey(static_cast(k)); if (pTrack != skey.GetTrack()) { pTrack = skey.GetTrack(); @@ -1332,7 +1332,7 @@ void CUiAnimViewSequence::CloneSelectedKeys() // Now, do the actual cloning. for (size_t k = 0; k < selectedKeyTimes.size(); ++k) { - CUiAnimViewKeyHandle skey = selectedKeys.GetKey(k); + CUiAnimViewKeyHandle skey = selectedKeys.GetKey(static_cast(k)); skey = skey.GetTrack()->GetKeyByTime(selectedKeyTimes[k]); assert(skey.IsValid()); diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h index 61aecc9cd5..e26a1ceec3 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h @@ -36,7 +36,7 @@ public: virtual void OnEditorNotifyEvent(EEditorNotifyEvent event); - unsigned int GetCount() const { return m_sequences.size(); } + unsigned int GetCount() const { return static_cast(m_sequences.size()); } void CreateSequence(QString name); void DeleteSequence(CUiAnimViewSequence* pSequence); diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewTrack.h b/Gems/LyShine/Code/Editor/Animation/UiAnimViewTrack.h index 6d11f55247..a2e38edc51 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewTrack.h +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewTrack.h @@ -23,7 +23,7 @@ public: : m_bAllOfSameType(true) , m_bHasRotationTrack(false) {} - unsigned int GetCount() const { return m_tracks.size(); } + unsigned int GetCount() const { return static_cast(m_tracks.size()); } CUiAnimViewTrack* GetTrack(const unsigned int index) { return m_tracks[index]; } const CUiAnimViewTrack* GetTrack(const unsigned int index) const { return m_tracks[index]; } diff --git a/Gems/LyShine/Code/Editor/CanvasSizeToolbarSection.cpp b/Gems/LyShine/Code/Editor/CanvasSizeToolbarSection.cpp index 39fe3e9719..de9e5e63bc 100644 --- a/Gems/LyShine/Code/Editor/CanvasSizeToolbarSection.cpp +++ b/Gems/LyShine/Code/Editor/CanvasSizeToolbarSection.cpp @@ -493,7 +493,7 @@ void CanvasSizeToolbarSection::HandleIndexChanged() int CanvasSizeToolbarSection::GetCustomSizeIndex() { - return m_canvasSizePresets.size() - 1; + return static_cast(m_canvasSizePresets.size() - 1); } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Gems/LyShine/Code/Editor/HierarchyClipboard.cpp b/Gems/LyShine/Code/Editor/HierarchyClipboard.cpp index df65c677ef..41a29988e7 100644 --- a/Gems/LyShine/Code/Editor/HierarchyClipboard.cpp +++ b/Gems/LyShine/Code/Editor/HierarchyClipboard.cpp @@ -156,7 +156,7 @@ void HierarchyClipboard::CopySelectedItemsToClipboard(HierarchyWidget* widget, QMimeData* mimeData = pEditor->CreateQMimeData(); { // Concatenate all the data we need into a single QByteArray. - QByteArray data(xml.c_str(), xml.size()); + QByteArray data(xml.c_str(), static_cast(xml.size())); mimeData->setData(UICANVASEDITOR_MIMETYPE, data); } diff --git a/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp b/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp index 2bb1686a93..1d8de3598e 100644 --- a/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp +++ b/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp @@ -286,8 +286,8 @@ void SpriteBorderEditor::AddConfigureSection(QGridLayout* gridLayout, int& rowNu // Count the number of unique entries along each axis to determine number // of rows/cols contained within the spritesheet. - m_numRows = vSet.size() > 1 ? vSet.size() - 1 : 1; - m_numCols = uSet.size() > 1 ? uSet.size() - 1 : 1; + m_numRows = static_cast(vSet.size() > 1 ? vSet.size() - 1 : 1); + m_numCols = static_cast(uSet.size() > 1 ? uSet.size() - 1 : 1); // Text input fields displaying row/col information for auto-extracting // spritesheet cells diff --git a/Gems/LyShine/Code/Source/Animation/AnimNode.cpp b/Gems/LyShine/Code/Source/Animation/AnimNode.cpp index f7a6015a56..a87dae6fbd 100644 --- a/Gems/LyShine/Code/Source/Animation/AnimNode.cpp +++ b/Gems/LyShine/Code/Source/Animation/AnimNode.cpp @@ -62,7 +62,7 @@ void CUiAnimNode::Activate([[maybe_unused]] bool bActivate) ////////////////////////////////////////////////////////////////////////// int CUiAnimNode::GetTrackCount() const { - return m_tracks.size(); + return static_cast(m_tracks.size()); } const char* CUiAnimNode::GetParamName(const CUiAnimParamType& paramType) const diff --git a/Gems/LyShine/Code/Source/Animation/AnimSequence.cpp b/Gems/LyShine/Code/Source/Animation/AnimSequence.cpp index f1ecb4af9e..51e5e925ca 100644 --- a/Gems/LyShine/Code/Source/Animation/AnimSequence.cpp +++ b/Gems/LyShine/Code/Source/Animation/AnimSequence.cpp @@ -48,7 +48,7 @@ CUiAnimSequence::CUiAnimSequence(IUiAnimationSystem* pUiAnimationSystem, uint32 CUiAnimSequence::~CUiAnimSequence() { // clear reference to me from all my nodes - for (int i = m_nodes.size(); --i >= 0;) + for (int i = static_cast(m_nodes.size()); --i >= 0;) { if (m_nodes[i]) { @@ -144,7 +144,7 @@ const IUiAnimSequence* CUiAnimSequence::GetParentSequence() const ////////////////////////////////////////////////////////////////////////// int CUiAnimSequence::GetNodeCount() const { - return m_nodes.size(); + return static_cast(m_nodes.size()); } ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/LyShine/Code/Source/Animation/AnimTrack.h b/Gems/LyShine/Code/Source/Animation/AnimTrack.h index e2d6fd1069..f73cd7ede7 100644 --- a/Gems/LyShine/Code/Source/Animation/AnimTrack.h +++ b/Gems/LyShine/Code/Source/Animation/AnimTrack.h @@ -71,7 +71,7 @@ public: } //! Return number of keys in track. - virtual int GetNumKeys() const { return m_keys.size(); }; + virtual int GetNumKeys() const { return static_cast(m_keys.size()); }; //! Return true if keys exists in this track virtual bool HasKeys() const { return !m_keys.empty(); } @@ -517,7 +517,7 @@ inline int TUiAnimTrack::GetActiveKey(float time, KeyType* key) return -1; } - int nkeys = m_keys.size(); + int nkeys = static_cast(m_keys.size()); if (nkeys == 0) { m_lastTime = time; diff --git a/Gems/LyShine/Code/Source/Animation/AzEntityNode.cpp b/Gems/LyShine/Code/Source/Animation/AzEntityNode.cpp index ca435dadf9..49c38c8eb0 100644 --- a/Gems/LyShine/Code/Source/Animation/AzEntityNode.cpp +++ b/Gems/LyShine/Code/Source/Animation/AzEntityNode.cpp @@ -163,7 +163,7 @@ CUiAnimAzEntityNode::~CUiAnimAzEntityNode() ////////////////////////////////////////////////////////////////////////// unsigned int CUiAnimAzEntityNode::GetParamCount() const { - return CUiAnimAzEntityNode::GetParamCountStatic() + m_entityScriptPropertiesParamInfos.size(); + return static_cast(CUiAnimAzEntityNode::GetParamCountStatic() + m_entityScriptPropertiesParamInfos.size()); } ////////////////////////////////////////////////////////////////////////// @@ -190,7 +190,7 @@ CUiAnimParamType CUiAnimAzEntityNode::GetParamType(unsigned int nIndex) const ////////////////////////////////////////////////////////////////////////// int CUiAnimAzEntityNode::GetParamCountStatic() { - return s_nodeParams.size(); + return static_cast(s_nodeParams.size()); } ////////////////////////////////////////////////////////////////////////// @@ -680,7 +680,7 @@ IUiAnimTrack* CUiAnimAzEntityNode::CreateTrackForAzField(const UiAnimParamData& // this is a compound type, create a compound track // We only support compound tracks with 2, 3 or 4 subtracks - int numElements = classData->m_elements.size(); + int numElements = static_cast(classData->m_elements.size()); if (numElements < 2 || numElements > 4) { return nullptr; diff --git a/Gems/LyShine/Code/Source/Animation/BoolTrack.cpp b/Gems/LyShine/Code/Source/Animation/BoolTrack.cpp index 911c3a29ce..4582cd7be1 100644 --- a/Gems/LyShine/Code/Source/Animation/BoolTrack.cpp +++ b/Gems/LyShine/Code/Source/Animation/BoolTrack.cpp @@ -31,7 +31,7 @@ void UiBoolTrack::GetValue(float time, bool& value) CheckValid(); - int nkeys = m_keys.size(); + int nkeys = static_cast(m_keys.size()); if (nkeys < 1) { return; diff --git a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp index 5c897620c7..d61090f79d 100644 --- a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp +++ b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp @@ -296,7 +296,7 @@ IUiAnimSequence* UiAnimationSystem::GetSequence(int i) const ////////////////////////////////////////////////////////////////////////// int UiAnimationSystem::GetNumSequences() const { - return m_sequences.size(); + return static_cast(m_sequences.size()); } ////////////////////////////////////////////////////////////////////////// @@ -315,7 +315,7 @@ IUiAnimSequence* UiAnimationSystem::GetPlayingSequence(int i) const ////////////////////////////////////////////////////////////////////////// int UiAnimationSystem::GetNumPlayingSequences() const { - return m_playingSequences.size(); + return static_cast(m_playingSequences.size()); } ////////////////////////////////////////////////////////////////////////// @@ -327,7 +327,7 @@ void UiAnimationSystem::AddSequence(IUiAnimSequence* pSequence) ////////////////////////////////////////////////////////////////////////// bool UiAnimationSystem::IsCutScenePlaying() const { - const uint numPlayingSequences = m_playingSequences.size(); + const uint numPlayingSequences = static_cast(m_playingSequences.size()); for (uint i = 0; i < numPlayingSequences; ++i) { const IUiAnimSequence* pAnimSequence = m_playingSequences[i].sequence.get(); diff --git a/Gems/LyShine/Code/Source/RenderGraph.cpp b/Gems/LyShine/Code/Source/RenderGraph.cpp index 9ee26cdf8e..637dfbbbb8 100644 --- a/Gems/LyShine/Code/Source/RenderGraph.cpp +++ b/Gems/LyShine/Code/Source/RenderGraph.cpp @@ -1128,7 +1128,7 @@ namespace LyShine // walk the graph recursively to add up all of the data GetDebugInfoRenderNodeList(m_renderNodes, info, uniqueTextures); - info.m_numUniqueTextures = uniqueTextures.size(); + info.m_numUniqueTextures = static_cast(uniqueTextures.size()); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1183,7 +1183,7 @@ namespace LyShine const PrimitiveListRenderNode* primListRenderNode = static_cast(renderNode); IRenderer::DynUiPrimitiveList& primitives = primListRenderNode->GetPrimitives(); - info.m_numPrimitives += primitives.size(); + info.m_numPrimitives += static_cast(primitives.size()); { for (const IRenderer::DynUiPrimitive& primitive : primitives) { @@ -1367,7 +1367,7 @@ namespace LyShine } IRenderer::DynUiPrimitiveList& primitives = primListRenderNode->GetPrimitives(); - int numPrimitives = primitives.size(); + int numPrimitives = static_cast(primitives.size()); int numTriangles = 0; for (const IRenderer::DynUiPrimitive& primitive : primitives) { diff --git a/Gems/LyShine/Code/Source/Sprite.cpp b/Gems/LyShine/Code/Source/Sprite.cpp index 134768f814..b24c473e0f 100644 --- a/Gems/LyShine/Code/Source/Sprite.cpp +++ b/Gems/LyShine/Code/Source/Sprite.cpp @@ -273,7 +273,7 @@ void CSprite::Serialize(TSerialize ser) if (hasSpriteSheetCells && ser.BeginOptionalGroup("SpriteSheet", true)) { - const int numSpriteSheetCells = ser.IsReading() ? m_numSpriteSheetCellTags : GetSpriteSheetCells().size(); + const int numSpriteSheetCells = static_cast(ser.IsReading() ? m_numSpriteSheetCellTags : GetSpriteSheetCells().size()); for (int i = 0; i < numSpriteSheetCells; ++i) { ser.BeginOptionalGroup("Cell", true); diff --git a/Gems/LyShine/Code/Source/StringUtfUtils.h b/Gems/LyShine/Code/Source/StringUtfUtils.h index 74a27afe9f..f57deb1d3d 100644 --- a/Gems/LyShine/Code/Source/StringUtfUtils.h +++ b/Gems/LyShine/Code/Source/StringUtfUtils.h @@ -37,7 +37,7 @@ namespace LyShine // this function and use Unicode::CIterator<>::Position instead. wchar_t wcharString[2] = { static_cast(multiByteChar), 0 }; AZStd::string utf8String(CryStringUtils::WStrToUTF8(wcharString)); - int utf8Length = utf8String.length(); + int utf8Length = static_cast(utf8String.length()); return utf8Length; } diff --git a/Gems/LyShine/Code/Source/Tests/internal/test_UiTextComponent.cpp b/Gems/LyShine/Code/Source/Tests/internal/test_UiTextComponent.cpp index 3cd137b25f..bb8bc47556 100644 --- a/Gems/LyShine/Code/Source/Tests/internal/test_UiTextComponent.cpp +++ b/Gems/LyShine/Code/Source/Tests/internal/test_UiTextComponent.cpp @@ -2716,7 +2716,7 @@ namespace float newWidth; EBUS_EVENT_ID_RESULT(newWidth, testElemId, UiLayoutCellDefaultBus, GetTargetWidth, LyShine::UiLayoutCellUnspecifiedSize); - const int testStringLength = testString.length(); + const int testStringLength = static_cast(testString.length()); const int numGapsBetweenCharacters = testStringLength >= 1 ? testStringLength - 1 : 0; const float ems = characterSpacing * 0.001f; float expectedWidth = baseWidth + numGapsBetweenCharacters * ems * fontSize; diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp index 72d9f92d1f..6d2bc67eb0 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp @@ -705,7 +705,7 @@ AZStd::string UiCanvasComponent::GetUniqueChildName(AZ::EntityId parentEntityId, // Count trailing digits in base name int i; - for (i = baseName.length() - 1; i >= 0; i--) + for (i = static_cast(baseName.length() - 1); i >= 0; i--) { if (!isdigit(baseName[i])) { @@ -713,7 +713,7 @@ AZStd::string UiCanvasComponent::GetUniqueChildName(AZ::EntityId parentEntityId, } } int startDigitIndex = i + 1; - int numDigits = baseName.length() - startDigitIndex; + int numDigits = static_cast(baseName.length() - startDigitIndex); int suffix = 1; if (numDigits > 0) @@ -737,7 +737,7 @@ AZStd::string UiCanvasComponent::GetUniqueChildName(AZ::EntityId parentEntityId, AZStd::string suffixString = AZStd::string::format("%d", suffix); // Append leading zeros - int numLeadingZeros = (suffixString.length() < numDigits) ? numDigits - suffixString.length() : 0; + int numLeadingZeros = static_cast((suffixString.length() < numDigits) ? numDigits - suffixString.length() : 0); for (int zeroes = 0; zeroes < numLeadingZeros; zeroes++) { proposedChildName.push_back('0'); @@ -1978,7 +1978,7 @@ void UiCanvasComponent::GetDebugInfoNumElements(DebugInfoNumElements& info) cons info.m_numMaskElements = 0; info.m_numFaderElements = 0; info.m_numInteractableElements = 0; - info.m_numUpdateElements = UiCanvasUpdateNotificationBus::GetNumOfEventHandlers(GetEntityId()); + info.m_numUpdateElements = static_cast(UiCanvasUpdateNotificationBus::GetNumOfEventHandlers(GetEntityId())); DebugInfoCountChildren(m_rootElement, true, info); } diff --git a/Gems/LyShine/Code/Source/UiDynamicScrollBoxComponent.cpp b/Gems/LyShine/Code/Source/UiDynamicScrollBoxComponent.cpp index 30df88da2b..83c4a2d02a 100644 --- a/Gems/LyShine/Code/Source/UiDynamicScrollBoxComponent.cpp +++ b/Gems/LyShine/Code/Source/UiDynamicScrollBoxComponent.cpp @@ -1179,7 +1179,7 @@ void UiDynamicScrollBoxComponent::ResizeContentToFitElements() } else { - int numHeaders = m_sections.size(); + int numHeaders = static_cast(m_sections.size()); int numItems = m_numElements - numHeaders; newSize = numHeaders * m_prototypeElementSize[ElementType::SectionHeader] + numItems * m_prototypeElementSize[ElementType::Item]; } @@ -1201,7 +1201,7 @@ void UiDynamicScrollBoxComponent::ResizeContentToFitElements() } else { - int numHeaders = m_sections.size(); + int numHeaders = static_cast(m_sections.size()); int numItems = m_numElements - numHeaders; newSize = numHeaders * m_estimatedElementSize[ElementType::SectionHeader] + numItems * m_estimatedElementSize[ElementType::Item]; } @@ -1555,7 +1555,7 @@ float UiDynamicScrollBoxComponent::GetFixedSizeElementOffset(int index) const int numHeaders = 0; int numItems = 0; - int numSections = m_sections.size(); + int numSections = static_cast(m_sections.size()); if (numSections > 0) { if (index > m_sections[numSections - 1].m_headerElementIndex) diff --git a/Gems/LyShine/Code/Source/UiElementComponent.cpp b/Gems/LyShine/Code/Source/UiElementComponent.cpp index 388b280e9f..45ddea9877 100644 --- a/Gems/LyShine/Code/Source/UiElementComponent.cpp +++ b/Gems/LyShine/Code/Source/UiElementComponent.cpp @@ -142,7 +142,7 @@ void UiElementComponent::RenderElement(LyShine::IRenderGraph* renderGraph, bool if (m_renderControlInterface) { // give control of rendering this element and its children to the render control component on this element - m_renderControlInterface->Render(renderGraph, this, m_renderInterface, m_childElementComponents.size(), isInGame); + m_renderControlInterface->Render(renderGraph, this, m_renderInterface, static_cast(m_childElementComponents.size()), isInGame); } else { @@ -153,7 +153,7 @@ void UiElementComponent::RenderElement(LyShine::IRenderGraph* renderGraph, bool } // now render child elements - int numChildren = m_childElementComponents.size(); + int numChildren = static_cast(m_childElementComponents.size()); for (int i = 0; i < numChildren; ++i) { GetChildElementComponent(i)->RenderElement(renderGraph, isInGame); @@ -194,7 +194,7 @@ AZ::EntityId UiElementComponent::GetParentEntityId() //////////////////////////////////////////////////////////////////////////////////////////////////// int UiElementComponent::GetNumChildElements() { - return m_childEntityIdOrder.size(); + return static_cast(m_childEntityIdOrder.size()); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -236,7 +236,7 @@ UiElementInterface* UiElementComponent::GetChildElementInterface(int index) int UiElementComponent::GetIndexOfChild(const AZ::Entity* child) { AZ::EntityId childEntityId = child->GetId(); - int numChildren = m_childEntityIdOrder.size(); + int numChildren = static_cast(m_childEntityIdOrder.size()); for (int i = 0; i < numChildren; ++i) { if (m_childEntityIdOrder[i].m_entityId == childEntityId) @@ -251,7 +251,7 @@ int UiElementComponent::GetIndexOfChild(const AZ::Entity* child) //////////////////////////////////////////////////////////////////////////////////////////////////// int UiElementComponent::GetIndexOfChildByEntityId(AZ::EntityId childId) { - int numChildren = m_childEntityIdOrder.size(); + int numChildren = static_cast(m_childEntityIdOrder.size()); for (int i = 0; i < numChildren; ++i) { if (m_childEntityIdOrder[i].m_entityId == childId) @@ -266,7 +266,7 @@ int UiElementComponent::GetIndexOfChildByEntityId(AZ::EntityId childId) //////////////////////////////////////////////////////////////////////////////////////////////////// LyShine::EntityArray UiElementComponent::GetChildElements() { - int numChildren = m_childEntityIdOrder.size(); + int numChildren = static_cast(m_childEntityIdOrder.size()); LyShine::EntityArray children; children.reserve(numChildren); @@ -477,7 +477,7 @@ AZ::Entity* UiElementComponent::FindFrontmostChildContainingPoint(AZ::Vector2 po // this traverses all of the elements in reverse hierarchy order and returns the first one that // is containing the point. // If necessary, this could be optimized using a spatial partitioning data structure. - for (int i = m_childEntityIdOrder.size() - 1; !matchElem && i >= 0; i--) + for (int i = static_cast(m_childEntityIdOrder.size() - 1); !matchElem && i >= 0; i--) { AZ::EntityId child = m_childEntityIdOrder[i].m_entityId; @@ -602,7 +602,7 @@ AZ::EntityId UiElementComponent::FindInteractableToHandleEvent(AZ::Vector2 point EBUS_EVENT_ID_RESULT(isMasked, GetEntityId(), UiInteractionMaskBus, IsPointMasked, point); if (!isMasked) { - for (int i = m_childEntityIdOrder.size() - 1; !result.IsValid() && i >= 0; i--) + for (int i = static_cast(m_childEntityIdOrder.size() - 1); !result.IsValid() && i >= 0; i--) { result = GetChildElementComponent(i)->FindInteractableToHandleEvent(point); } @@ -674,7 +674,7 @@ AZ::Entity* UiElementComponent::FindChildByName(const LyShine::NameType& name) if (AreChildPointersValid()) { - int numChildren = m_childElementComponents.size(); + int numChildren = static_cast(m_childElementComponents.size()); for (int i = 0; i < numChildren; ++i) { AZ::Entity* childEntity = GetChildElementComponent(i)->GetEntity(); @@ -709,7 +709,7 @@ AZ::Entity* UiElementComponent::FindDescendantByName(const LyShine::NameType& na if (AreChildPointersValid()) { - int numChildren = m_childElementComponents.size(); + int numChildren = static_cast(m_childElementComponents.size()); for (int i = 0; i < numChildren; ++i) { UiElementComponent* childElementComponent = GetChildElementComponent(i); @@ -771,7 +771,7 @@ AZ::Entity* UiElementComponent::FindChildByEntityId(AZ::EntityId id) { AZ::Entity* matchElem = nullptr; - int numChildren = m_childEntityIdOrder.size(); + int numChildren = static_cast(m_childEntityIdOrder.size()); for (int i = 0; i < numChildren; ++i) { if (id == m_childEntityIdOrder[i].m_entityId) @@ -803,7 +803,7 @@ AZ::Entity* UiElementComponent::FindDescendantById(LyShine::ElementId id) if (AreChildPointersValid()) { - int numChildren = m_childEntityIdOrder.size(); + int numChildren = static_cast(m_childEntityIdOrder.size()); for (int i = 0; !match && i < numChildren; ++i) { match = GetChildElementComponent(i)->FindDescendantById(id); @@ -825,7 +825,7 @@ void UiElementComponent::FindDescendantElements(AZStd::function(m_childElementComponents.size()); for (int i = 0; i < numChildren; ++i) { UiElementComponent* childElementComponent = GetChildElementComponent(i); @@ -860,7 +860,7 @@ void UiElementComponent::CallOnDescendantElements(AZStd::function(m_childEntityIdOrder.size()); for (int i = 0; i < numChildren; ++i) { callFunction(m_childEntityIdOrder[i].m_entityId); @@ -1068,7 +1068,7 @@ void UiElementComponent::AddChild(AZ::Entity* child, AZ::Entity* insertBefore) if (insertBefore) { - int numChildren = m_childEntityIdOrder.size(); + int numChildren = static_cast(m_childEntityIdOrder.size()); for (int i = 0; i < numChildren; ++i) { if (m_childEntityIdOrder[i].m_entityId == insertBefore->GetId()) @@ -1696,7 +1696,7 @@ void UiElementComponent::OnPatchEnd(const AZ::DataPatchNodeInfo& patchInfo) // the lookupAddress is the same length as the "Children" address plus an index // check if the address is childrenAddress plus an extra element bool match = true; - for (int i = childrenAddress.size() - 1; i >= 0; --i) + for (int i = static_cast(childrenAddress.size() - 1); i >= 0; --i) { if (lookupAddress[i] != childrenAddress[i]) { @@ -1827,7 +1827,7 @@ void UiElementComponent::OnPatchEnd(const AZ::DataPatchNodeInfo& patchInfo) // This will sort all the entity order entries by sort index (primary) and entity id (secondary) which should never result in any collisions // This is used since slice data patching may create duplicate entries for the same sort index, missing indices and the like. // It should never result in multiple entity id entries since the serialization of this data uses a persistent id which is the entity id - int numChildren = m_childEntityIdOrder.size(); + int numChildren = static_cast(m_childEntityIdOrder.size()); if (numChildren > 0) { AZStd::sort(m_childEntityIdOrder.begin(), m_childEntityIdOrder.end()); diff --git a/Gems/LyShine/Code/Source/UiImageComponent.cpp b/Gems/LyShine/Code/Source/UiImageComponent.cpp index 901c13d594..1e48bdff51 100644 --- a/Gems/LyShine/Code/Source/UiImageComponent.cpp +++ b/Gems/LyShine/Code/Source/UiImageComponent.cpp @@ -699,7 +699,7 @@ const AZ::u32 UiImageComponent::GetImageIndexCount() { if (m_sprite) { - return m_sprite->GetSpriteSheetCells().size(); + return static_cast(m_sprite->GetSpriteSheetCells().size()); } return 0; @@ -2635,7 +2635,7 @@ LyShine::AZu32ComboBoxVec UiImageComponent::PopulateIndexStringList() const // There may not be a sprite loaded for this component if (m_sprite) { - const AZ::u32 numCells = m_sprite->GetSpriteSheetCells().size(); + const AZ::u32 numCells = static_cast(m_sprite->GetSpriteSheetCells().size()); if (numCells != 0) { diff --git a/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp b/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp index 33b73dfa63..086aed9f58 100644 --- a/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp +++ b/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp @@ -268,7 +268,7 @@ const AZ::u32 UiImageSequenceComponent::GetImageIndex() //////////////////////////////////////////////////////////////////////////////////////////////////// const AZ::u32 UiImageSequenceComponent::GetImageIndexCount() { - return m_spriteList.size(); + return static_cast(m_spriteList.size()); } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Gems/LyShine/Code/Source/UiLayoutColumnComponent.cpp b/Gems/LyShine/Code/Source/UiLayoutColumnComponent.cpp index f385a2eead..bd557ad64e 100644 --- a/Gems/LyShine/Code/Source/UiLayoutColumnComponent.cpp +++ b/Gems/LyShine/Code/Source/UiLayoutColumnComponent.cpp @@ -452,7 +452,7 @@ void UiLayoutColumnComponent::ApplyLayoutWidth(float availableWidth) // Get the child element cell widths UiLayoutHelpers::LayoutCellSizes layoutCells; UiLayoutHelpers::GetLayoutCellWidths(GetEntityId(), m_ignoreDefaultLayoutCells, layoutCells); - int numChildren = layoutCells.size(); + int numChildren = static_cast(layoutCells.size()); if (numChildren > 0) { // Set the child elements' transform properties based on the calculated child widths @@ -492,7 +492,7 @@ void UiLayoutColumnComponent::ApplyLayoutHeight(float availableHeight) // Get the child element cell heights UiLayoutHelpers::LayoutCellSizes layoutCells; UiLayoutHelpers::GetLayoutCellHeights(GetEntityId(), m_ignoreDefaultLayoutCells, layoutCells); - int numChildren = layoutCells.size(); + int numChildren = static_cast(layoutCells.size()); if (numChildren > 0) { // Calculate child heights diff --git a/Gems/LyShine/Code/Source/UiLayoutHelpers.cpp b/Gems/LyShine/Code/Source/UiLayoutHelpers.cpp index 5f53635ae8..49b1f59f97 100644 --- a/Gems/LyShine/Code/Source/UiLayoutHelpers.cpp +++ b/Gems/LyShine/Code/Source/UiLayoutHelpers.cpp @@ -434,7 +434,7 @@ namespace UiLayoutHelpers //////////////////////////////////////////////////////////////////////////////////////////////////// void CalculateElementSizes(const LayoutCellSizes& layoutCells, float availableSize, float spacing, AZStd::vector& sizesOut) { - int numElements = layoutCells.size(); + int numElements = static_cast(layoutCells.size()); availableSize -= (numElements - 1) * spacing; diff --git a/Gems/LyShine/Code/Source/UiLayoutRowComponent.cpp b/Gems/LyShine/Code/Source/UiLayoutRowComponent.cpp index 08770ebe83..3dcc8afdef 100644 --- a/Gems/LyShine/Code/Source/UiLayoutRowComponent.cpp +++ b/Gems/LyShine/Code/Source/UiLayoutRowComponent.cpp @@ -452,7 +452,7 @@ void UiLayoutRowComponent::ApplyLayoutWidth(float availableWidth) // Get the child element cell widths UiLayoutHelpers::LayoutCellSizes layoutCells; UiLayoutHelpers::GetLayoutCellWidths(GetEntityId(), m_ignoreDefaultLayoutCells, layoutCells); - int numChildren = layoutCells.size(); + int numChildren = static_cast(layoutCells.size()); if (numChildren > 0) { // Calculate child widths @@ -529,7 +529,7 @@ void UiLayoutRowComponent::ApplyLayoutHeight(float availableHeight) // Get the child element cell heights UiLayoutHelpers::LayoutCellSizes layoutCells; UiLayoutHelpers::GetLayoutCellHeights(GetEntityId(), m_ignoreDefaultLayoutCells, layoutCells); - int numChildren = layoutCells.size(); + int numChildren = static_cast(layoutCells.size()); if (numChildren > 0) { // Set the child elements' transform properties based on the calculated child heights diff --git a/Gems/LyShine/Code/Source/UiMarkupButtonComponent.cpp b/Gems/LyShine/Code/Source/UiMarkupButtonComponent.cpp index 8373ebf0d3..5df648cf5e 100644 --- a/Gems/LyShine/Code/Source/UiMarkupButtonComponent.cpp +++ b/Gems/LyShine/Code/Source/UiMarkupButtonComponent.cpp @@ -32,7 +32,7 @@ namespace { // Iterate through the clickable rects to find one that contains the point int clickableRectIndex = -1; - const int numClickableRects = clickableTextRects.size(); + const int numClickableRects = static_cast(clickableTextRects.size()); for (int i = 0; i < numClickableRects; ++i) { const auto& clickableRect = clickableTextRects[i]; diff --git a/Gems/LyShine/Code/Source/UiParticleEmitterComponent.cpp b/Gems/LyShine/Code/Source/UiParticleEmitterComponent.cpp index 860eaf0d78..9668ebf463 100644 --- a/Gems/LyShine/Code/Source/UiParticleEmitterComponent.cpp +++ b/Gems/LyShine/Code/Source/UiParticleEmitterComponent.cpp @@ -409,7 +409,7 @@ void UiParticleEmitterComponent::SetSpriteSheetCellIndex(int spriteSheetIndex) if (m_sprite) { - const AZ::u32 numCells = m_sprite->GetSpriteSheetCells().size(); + const AZ::u32 numCells = static_cast(m_sprite->GetSpriteSheetCells().size()); m_spriteSheetCellIndex = AZ::GetMin(numCells, m_spriteSheetCellIndex); m_spriteSheetCellEndIndex = AZ::GetMax(m_spriteSheetCellIndex, m_spriteSheetCellEndIndex); } @@ -428,7 +428,7 @@ void UiParticleEmitterComponent::SetSpriteSheetCellEndIndex(int spriteSheetEndIn if (m_sprite) { - const AZ::u32 numCells = m_sprite->GetSpriteSheetCells().size(); + const AZ::u32 numCells = static_cast(m_sprite->GetSpriteSheetCells().size()); m_spriteSheetCellEndIndex = AZ::GetMin(numCells, m_spriteSheetCellEndIndex); m_spriteSheetCellIndex = AZ::GetMin(m_spriteSheetCellIndex, m_spriteSheetCellEndIndex); } @@ -759,7 +759,7 @@ void UiParticleEmitterComponent::InGamePostActivate() //////////////////////////////////////////////////////////////////////////////////////////////////// void UiParticleEmitterComponent::Render(LyShine::IRenderGraph* renderGraph) { - AZ::u32 particlesToRender = AZ::GetMin(m_particleContainer.size(), m_particleBufferSize); + AZ::u32 particlesToRender = AZ::GetMin(static_cast(m_particleContainer.size()), m_particleBufferSize); if (particlesToRender == 0) { return; @@ -1943,7 +1943,7 @@ void UiParticleEmitterComponent::OnSpritePathnameChange() m_spriteSheetCellIndex = 0; if (IsSpriteTypeSpriteSheet()) { - m_spriteSheetCellEndIndex = m_sprite->GetSpriteSheetCells().size() - 1; + m_spriteSheetCellEndIndex = static_cast(m_sprite->GetSpriteSheetCells().size() - 1); } } @@ -2086,7 +2086,7 @@ UiParticleEmitterComponent::AZu32ComboBoxVec UiParticleEmitterComponent::Populat // There may not be a sprite loaded for this component if (m_sprite) { - const AZ::u32 numCells = m_sprite->GetSpriteSheetCells().size(); + const AZ::u32 numCells = static_cast(m_sprite->GetSpriteSheetCells().size()); if (numCells != 0) { diff --git a/Gems/LyShine/Code/Source/UiTextComponent.cpp b/Gems/LyShine/Code/Source/UiTextComponent.cpp index 025c22a895..d95b15622b 100644 --- a/Gems/LyShine/Code/Source/UiTextComponent.cpp +++ b/Gems/LyShine/Code/Source/UiTextComponent.cpp @@ -4413,7 +4413,7 @@ void UiTextComponent::HandleWidthOnlyShrinkToFitWithWrapping( { // Consider the sizes of all overflowing lines when calculating the // scale to reduce the number of times we need to iterate. - int numOverflowingLines = drawBatchLinesOut.batchLines.size() - maxLinesElementCanHold; + int numOverflowingLines = static_cast(drawBatchLinesOut.batchLines.size() - maxLinesElementCanHold); DrawBatchLineContainer::reverse_iterator riter; int overflowLineCount = 0; float overflowingLineSize = 0.0f; diff --git a/Gems/LyShine/Code/Source/UiTextComponentOffsetsSelector.cpp b/Gems/LyShine/Code/Source/UiTextComponentOffsetsSelector.cpp index b4e8a8d63e..24f2bff49c 100644 --- a/Gems/LyShine/Code/Source/UiTextComponentOffsetsSelector.cpp +++ b/Gems/LyShine/Code/Source/UiTextComponentOffsetsSelector.cpp @@ -92,7 +92,7 @@ void UiTextComponentOffsetsSelector::ParseBatchLine(const UiTextComponent::DrawB // on the same line or not. else if (!lastIndexFound) { - int substrLength = drawBatch.text.length() - firstIndexLineIndex; + int substrLength = static_cast(drawBatch.text.length() - firstIndexLineIndex); AZStd::string curSubstring(drawBatch.text.substr(firstIndexLineIndex, substrLength)); curLineWidth += drawBatch.font->GetTextSize(curSubstring.c_str(), false, m_fontContext).x; lineOffsetsStack.top()->right.SetX(AZStd::GetMax(lineOffsetsStack.top()->right.GetX(), curLineWidth)); diff --git a/Gems/LyShine/Code/Source/UiTextComponentOffsetsSelector.h b/Gems/LyShine/Code/Source/UiTextComponentOffsetsSelector.h index 1c98e53970..896e93a3be 100644 --- a/Gems/LyShine/Code/Source/UiTextComponentOffsetsSelector.h +++ b/Gems/LyShine/Code/Source/UiTextComponentOffsetsSelector.h @@ -29,7 +29,7 @@ struct UiTextComponentOffsetsSelector , m_firstIndex(firstIndex) , m_lastIndex(lastIndex) , m_lastIndexLineNumber(lastIndexLineNumber) - , m_numLines(m_drawBatchLines.batchLines.size()) + , m_numLines(static_cast(m_drawBatchLines.batchLines.size())) , m_indexIter(0) , m_numCharsSelected(0) , m_lineCounter(0) diff --git a/Gems/LyShine/Code/Source/UiTextInputComponent.cpp b/Gems/LyShine/Code/Source/UiTextInputComponent.cpp index e37d8787e1..6a02d94b1f 100644 --- a/Gems/LyShine/Code/Source/UiTextInputComponent.cpp +++ b/Gems/LyShine/Code/Source/UiTextInputComponent.cpp @@ -647,7 +647,7 @@ bool UiTextInputComponent::HandleKeyInputBegan(const AzFramework::InputChannel:: // Append text from clipboard textString.insert(m_textCursorPos, clipboardText); - m_textCursorPos += clipboardText.length(); + m_textCursorPos += static_cast(clipboardText.length()); m_textSelectionStartPos = m_textCursorPos; // If max length is set, remove extra characters