From 20a4ec9b7df67eb3043ef8599660580b59dd894d Mon Sep 17 00:00:00 2001 From: pappeste Date: Fri, 18 Jun 2021 16:36:30 -0700 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFSandbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/EditorViewportWidget.h | 6 +++--- Code/Editor/ErrorReport.h | 2 +- Code/Editor/Objects/DisplayContextShared.inl | 10 +++++----- Code/Editor/Objects/EntityObject.h | 4 ++-- Code/Editor/Objects/ObjectLoader.h | 2 +- Code/Editor/Objects/ObjectManager.h | 2 +- Code/Editor/Objects/SelectionGroup.h | 2 +- Code/Editor/Plugins/PerforcePlugin/PasswordDlg.cpp | 2 +- Code/Editor/RenderHelpers/AxisHelperShared.inl | 2 +- Code/Editor/RenderViewport.cpp | 6 +++--- Code/Editor/RenderViewport.h | 6 +++--- Code/Editor/TrackView/TrackViewAnimNode.h | 2 +- Code/Editor/TrackView/TrackViewNode.h | 4 ++-- Code/Editor/TrackView/TrackViewSequenceManager.h | 2 +- Code/Editor/TrackView/TrackViewTrack.h | 2 +- Code/Editor/Undo/Undo.h | 4 ++-- Code/Editor/ViewManager.h | 2 +- Code/Legacy/CryCommon/UnicodeBinding.h | 2 +- 18 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Code/Editor/EditorViewportWidget.h b/Code/Editor/EditorViewportWidget.h index 1829995d02..b682de1cc3 100644 --- a/Code/Editor/EditorViewportWidget.h +++ b/Code/Editor/EditorViewportWidget.h @@ -258,19 +258,19 @@ public: m_relCameraRotX = 0; m_relCameraRotZ = 0; - uint32 numSample6 = m_arrAnimatedCharacterPath.size(); + uint32 numSample6 = static_cast(m_arrAnimatedCharacterPath.size()); for (uint32 i = 0; i < numSample6; i++) { m_arrAnimatedCharacterPath[i] = Vec3(ZERO); } - numSample6 = m_arrSmoothEntityPath.size(); + numSample6 = static_cast(m_arrSmoothEntityPath.size()); for (uint32 i = 0; i < numSample6; i++) { m_arrSmoothEntityPath[i] = Vec3(ZERO); } - uint32 numSample7 = m_arrRunStrafeSmoothing.size(); + uint32 numSample7 = static_cast(m_arrRunStrafeSmoothing.size()); for (uint32 i = 0; i < numSample7; i++) { m_arrRunStrafeSmoothing[i] = 0; diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h index dec5cd4fb8..2bef4105f8 100644 --- a/Code/Editor/ErrorReport.h +++ b/Code/Editor/ErrorReport.h @@ -105,7 +105,7 @@ public: bool IsEmpty() const; //! Get number of contained error records. - int GetErrorCount() const { return m_errors.size(); }; + int GetErrorCount() const { return static_cast(m_errors.size()); }; //! Get access to indexed error record. CErrorRecord& GetError(int i); //! Clear all error records. diff --git a/Code/Editor/Objects/DisplayContextShared.inl b/Code/Editor/Objects/DisplayContextShared.inl index 1791c22443..a602d8eca9 100644 --- a/Code/Editor/Objects/DisplayContextShared.inl +++ b/Code/Editor/Objects/DisplayContextShared.inl @@ -74,12 +74,12 @@ void DisplayContext::DrawTri(const Vec3& p1, const Vec3& p2, const Vec3& p3) void DisplayContext::DrawTriangles(const AZStd::vector& vertices, const ColorB& color) { - pRenderAuxGeom->DrawTriangles(vertices.begin(), vertices.size(), color); + pRenderAuxGeom->DrawTriangles(vertices.begin(), static_cast(vertices.size()), color); } void DisplayContext::DrawTrianglesIndexed(const AZStd::vector& vertices, const AZStd::vector& indices, const ColorB& color) { - pRenderAuxGeom->DrawTriangles(vertices.begin(), vertices.size(), indices.begin(), indices.size(), color); + pRenderAuxGeom->DrawTriangles(vertices.begin(), static_cast(vertices.size()), indices.begin(), static_cast(indices.size()), color); } ////////////////////////////////////////////////////////////////////////// @@ -862,7 +862,7 @@ void DisplayContext::DrawLine(const Vec3& p1, const Vec3& p2, const QColor& rgb1 ////////////////////////////////////////////////////////////////////////// void DisplayContext::DrawLines(const AZStd::vector& points, const ColorF& color) { - pRenderAuxGeom->DrawLines(points.begin(), points.size(), color, m_thickness); + pRenderAuxGeom->DrawLines(points.begin(), static_cast(points.size()), color, m_thickness); } ////////////////////////////////////////////////////////////////////////// @@ -1287,8 +1287,8 @@ void DisplayContext::Flush2D() uvs[3] = 0; uvt[3] = 0; - int nLabels = m_textureLabels.size(); - for (int i = 0; i < nLabels; i++) + const size_t nLabels = m_textureLabels.size(); + for (size_t i = 0; i < nLabels; i++) { STextureLabel& t = m_textureLabels[i]; float w2 = t.w * 0.5f; diff --git a/Code/Editor/Objects/EntityObject.h b/Code/Editor/Objects/EntityObject.h index 76bd71a1f1..34d3342ad4 100644 --- a/Code/Editor/Objects/EntityObject.h +++ b/Code/Editor/Objects/EntityObject.h @@ -163,7 +163,7 @@ public: ////////////////////////////////////////////////////////////////////////// //! Return number of event targets of Script. - int GetEventTargetCount() const { return m_eventTargets.size(); }; + int GetEventTargetCount() const { return static_cast(m_eventTargets.size()); }; CEntityEventTarget& GetEventTarget(int index) { return m_eventTargets[index]; }; //! Add new event target, returns index of created event target. //! Event targets are Always entities. @@ -176,7 +176,7 @@ public: // Entity Links. ////////////////////////////////////////////////////////////////////////// //! Return number of event targets of Script. - int GetEntityLinkCount() const { return m_links.size(); }; + int GetEntityLinkCount() const { return static_cast(m_links.size()); }; CEntityLink& GetEntityLink(int index) { return m_links[index]; }; virtual int AddEntityLink(const QString& name, GUID targetEntityId); virtual bool EntityLinkExists(const QString& name, GUID targetEntityId); diff --git a/Code/Editor/Objects/ObjectLoader.h b/Code/Editor/Objects/ObjectLoader.h index 350ffa10a9..ccfaeb78f0 100644 --- a/Code/Editor/Objects/ObjectLoader.h +++ b/Code/Editor/Objects/ObjectLoader.h @@ -70,7 +70,7 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING CBaseObject* LoadObject(const XmlNodeRef& objNode, CBaseObject* pPrevObject = NULL); ////////////////////////////////////////////////////////////////////////// - int GetLoadedObjectsCount() { return m_loadedObjects.size(); } + int GetLoadedObjectsCount() { return static_cast(m_loadedObjects.size()); } CBaseObject* GetLoadedObject(int nIndex) const { return m_loadedObjects[nIndex].pObject; } //! If true new loaded objects will be assigned new GUIDs. diff --git a/Code/Editor/Objects/ObjectManager.h b/Code/Editor/Objects/ObjectManager.h index f59f6c43b8..aa9faab0e4 100644 --- a/Code/Editor/Objects/ObjectManager.h +++ b/Code/Editor/Objects/ObjectManager.h @@ -58,7 +58,7 @@ public: class CBaseObjectsCache { public: - int GetObjectCount() const { return m_objects.size(); } + int GetObjectCount() const { return static_cast(m_objects.size()); } CBaseObject* GetObject(int nIndex) const { return m_objects[nIndex]; } void AddObject(CBaseObject* object); diff --git a/Code/Editor/Objects/SelectionGroup.h b/Code/Editor/Objects/SelectionGroup.h index 8f6feb32ad..600bce5f26 100644 --- a/Code/Editor/Objects/SelectionGroup.h +++ b/Code/Editor/Objects/SelectionGroup.h @@ -71,7 +71,7 @@ public: //! And save resulting objects to saveTo selection. void FilterParents(); //! Get number of child filtered objects. - int GetFilteredCount() const { return m_filtered.size(); } + int GetFilteredCount() const { return static_cast(m_filtered.size()); } CBaseObject* GetFilteredObject(int i) const { return m_filtered[i]; } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Editor/Plugins/PerforcePlugin/PasswordDlg.cpp b/Code/Editor/Plugins/PerforcePlugin/PasswordDlg.cpp index f1f742949c..6e9c0a42b0 100644 --- a/Code/Editor/Plugins/PerforcePlugin/PasswordDlg.cpp +++ b/Code/Editor/Plugins/PerforcePlugin/PasswordDlg.cpp @@ -53,7 +53,7 @@ namespace PerforceConnection setEnabled(false); - int numSettingsToGet = m_retrievedSettings.size(); + int numSettingsToGet = static_cast(m_retrievedSettings.size()); auto applySettingResultFunction = [this, &numSettingsToGet](AZStd::string setting, const SourceControlSettingInfo& info) -> void { diff --git a/Code/Editor/RenderHelpers/AxisHelperShared.inl b/Code/Editor/RenderHelpers/AxisHelperShared.inl index 9db4c82e84..2ceac98eae 100644 --- a/Code/Editor/RenderHelpers/AxisHelperShared.inl +++ b/Code/Editor/RenderHelpers/AxisHelperShared.inl @@ -546,7 +546,7 @@ bool CAxisHelper::HitTestForRotationCircle(const Matrix34& worldTM, IDisplayView Vec3 vShortestHitPos; float shortestDist = 3e11f; - for (int i = 0, iCount(vList.size()); i < iCount; ++i) + for (int i = 0, iCount(static_cast(vList.size())); i < iCount; ++i) { const Vec3& v0 = vList[i]; const Vec3& v1 = vList[(i + 1) % iCount]; diff --git a/Code/Editor/RenderViewport.cpp b/Code/Editor/RenderViewport.cpp index d268a57684..47e5106221 100644 --- a/Code/Editor/RenderViewport.cpp +++ b/Code/Editor/RenderViewport.cpp @@ -2342,7 +2342,7 @@ bool CRenderViewport::AddCameraMenuItems(QMenu* menu) AZ::EBusAggregateResults getCameraResults; Camera::CameraBus::BroadcastResult(getCameraResults, &Camera::CameraRequests::GetCameras); - const int numCameras = getCameraResults.values.size(); + const int numCameras = static_cast(getCameraResults.values.size()); // only enable if we're editing a sequence in Track View and have cameras in the level bool enableSequenceCameraMenu = (GetIEditor()->GetAnimation()->GetSequence() && numCameras); @@ -2354,7 +2354,7 @@ bool CRenderViewport::AddCameraMenuItems(QMenu* menu) connect(action, &QAction::triggered, this, &CRenderViewport::SetSequenceCamera); QVector additionalCameras; - additionalCameras.reserve(getCameraResults.values.size()); + additionalCameras.reserve(static_cast(getCameraResults.values.size())); for (const AZ::EntityId& entityId : getCameraResults.values) { @@ -2930,7 +2930,7 @@ void CRenderViewport::RenderSelectedRegion() // Draw volume dc.DepthWriteOff(); dc.CullOff(); - dc.pRenderAuxGeom->DrawTriangles(&verts[0], verts.size(), &inds[0], numInds, &colors[0]); + dc.pRenderAuxGeom->DrawTriangles(&verts[0], static_cast(verts.size()), &inds[0], numInds, &colors[0]); dc.CullOn(); dc.DepthWriteOn(); } diff --git a/Code/Editor/RenderViewport.h b/Code/Editor/RenderViewport.h index c66d56176e..d63f319276 100644 --- a/Code/Editor/RenderViewport.h +++ b/Code/Editor/RenderViewport.h @@ -275,19 +275,19 @@ public: m_relCameraRotX = 0; m_relCameraRotZ = 0; - uint32 numSample6 = m_arrAnimatedCharacterPath.size(); + uint32 numSample6 = static_cast(m_arrAnimatedCharacterPath.size()); for (uint32 i = 0; i < numSample6; i++) { m_arrAnimatedCharacterPath[i] = Vec3(ZERO); } - numSample6 = m_arrSmoothEntityPath.size(); + numSample6 = static_cast(m_arrSmoothEntityPath.size()); for (uint32 i = 0; i < numSample6; i++) { m_arrSmoothEntityPath[i] = Vec3(ZERO); } - uint32 numSample7 = m_arrRunStrafeSmoothing.size(); + uint32 numSample7 = static_cast(m_arrRunStrafeSmoothing.size()); for (uint32 i = 0; i < numSample7; i++) { m_arrRunStrafeSmoothing[i] = 0; diff --git a/Code/Editor/TrackView/TrackViewAnimNode.h b/Code/Editor/TrackView/TrackViewAnimNode.h index 475307ffa9..466e60bcf0 100644 --- a/Code/Editor/TrackView/TrackViewAnimNode.h +++ b/Code/Editor/TrackView/TrackViewAnimNode.h @@ -27,7 +27,7 @@ class QWidget; class CTrackViewAnimNodeBundle { public: - unsigned int GetCount() const { return m_animNodes.size(); } + unsigned int GetCount() const { return static_cast(m_animNodes.size()); } CTrackViewAnimNode* GetNode(const unsigned int index) { return m_animNodes[index]; } const CTrackViewAnimNode* GetNode(const unsigned int index) const { return m_animNodes[index]; } diff --git a/Code/Editor/TrackView/TrackViewNode.h b/Code/Editor/TrackView/TrackViewNode.h index 600a66877f..2c289049e9 100644 --- a/Code/Editor/TrackView/TrackViewNode.h +++ b/Code/Editor/TrackView/TrackViewNode.h @@ -123,7 +123,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 CTrackViewKeyHandle GetKey(unsigned int index) override { return m_keys[index]; } virtual void SelectKeys(const bool bSelected) override; @@ -174,7 +174,7 @@ public: CTrackViewNode* GetParentNode() const { return m_pParentNode; } // Children - unsigned int GetChildCount() const { return m_childNodes.size(); } + unsigned int GetChildCount() const { return static_cast(m_childNodes.size()); } CTrackViewNode* GetChild(unsigned int index) const { return m_childNodes[index].get(); } // Snap time value to prev/next key in sequence diff --git a/Code/Editor/TrackView/TrackViewSequenceManager.h b/Code/Editor/TrackView/TrackViewSequenceManager.h index b181cf54b1..21c10f009a 100644 --- a/Code/Editor/TrackView/TrackViewSequenceManager.h +++ b/Code/Editor/TrackView/TrackViewSequenceManager.h @@ -29,7 +29,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, SequenceType sequenceType); void DeleteSequence(CTrackViewSequence* pSequence); diff --git a/Code/Editor/TrackView/TrackViewTrack.h b/Code/Editor/TrackView/TrackViewTrack.h index 0c1f13274c..bbe81f6377 100644 --- a/Code/Editor/TrackView/TrackViewTrack.h +++ b/Code/Editor/TrackView/TrackViewTrack.h @@ -27,7 +27,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()); } CTrackViewTrack* GetTrack(const unsigned int index) { return m_tracks[index]; } const CTrackViewTrack* GetTrack(const unsigned int index) const { return m_tracks[index]; } diff --git a/Code/Editor/Undo/Undo.h b/Code/Editor/Undo/Undo.h index 3f943f7a82..594d3b3f3d 100644 --- a/Code/Editor/Undo/Undo.h +++ b/Code/Editor/Undo/Undo.h @@ -61,12 +61,12 @@ public: // Confetti: Get the size of m_undoObjects virtual int GetCount() const { - return m_undoObjects.size(); + return static_cast(m_undoObjects.size()); } virtual bool IsEmpty() const { return m_undoObjects.empty(); }; virtual void Undo(bool bUndo) { - for (int i = m_undoObjects.size() - 1; i >= 0; i--) + for (int i = static_cast(m_undoObjects.size() - 1); i >= 0; i--) { m_undoObjects[i]->Undo(bUndo); } diff --git a/Code/Editor/ViewManager.h b/Code/Editor/ViewManager.h index 22f9f6804f..434c38df2f 100644 --- a/Code/Editor/ViewManager.h +++ b/Code/Editor/ViewManager.h @@ -86,7 +86,7 @@ public: ////////////////////////////////////////////////////////////////////////// //! Get number of currently existing viewports. - virtual int GetViewCount() { return m_viewports.size(); }; + virtual int GetViewCount() { return static_cast(m_viewports.size()); }; //! Get viewport by index. //! @param index 0 <= index < GetViewportCount() virtual CViewport* GetView(int index) { return m_viewports[index]; } diff --git a/Code/Legacy/CryCommon/UnicodeBinding.h b/Code/Legacy/CryCommon/UnicodeBinding.h index 6bfa846035..e6e82aaf49 100644 --- a/Code/Legacy/CryCommon/UnicodeBinding.h +++ b/Code/Legacy/CryCommon/UnicodeBinding.h @@ -843,7 +843,7 @@ namespace Unicode { const size_t offset = Append ? out.size() : 0; length += offset; - out.resize(length); // resize() can't fail without exceptions, so assert instead. + out.resize(static_cast(length)); // resize() can't fail without exceptions, so assert instead. assert((out.size() == length) && "Buffer resize failed (out-of-memory?)"); const CharType* base = length ? out.data() : 0; ptr = const_cast(base + offset);