diff --git a/Code/Editor/Geometry/TriMesh.cpp b/Code/Editor/Geometry/TriMesh.cpp index 737886cabc..8e85de3904 100644 --- a/Code/Editor/Geometry/TriMesh.cpp +++ b/Code/Editor/Geometry/TriMesh.cpp @@ -677,11 +677,11 @@ void CTriMesh::GetEdgesByVertex(MeshElementsArray& inVertices, MeshElementsArray std::sort(inVertices.begin(), inVertices.end()); for (int i = 0; i < GetEdgeCount(); i++) { - if (stl::binary_find(inVertices.begin(), inVertices.end(), pEdges[i].v[0]) != inVertices.end()) + if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pEdges[i].v[0])) != inVertices.end()) { outEdges.push_back(i); } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), pEdges[i].v[1]) != inVertices.end()) + else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pEdges[i].v[1])) != inVertices.end()) { outEdges.push_back(i); } @@ -696,15 +696,15 @@ void CTriMesh::GetFacesByVertex(MeshElementsArray& inVertices, MeshElementsArray std::sort(inVertices.begin(), inVertices.end()); for (int i = 0; i < GetFacesCount(); i++) { - if (stl::binary_find(inVertices.begin(), inVertices.end(), pFaces[i].v[0]) != inVertices.end()) + if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[0])) != inVertices.end()) { outFaces.push_back(i); } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), pFaces[i].v[1]) != inVertices.end()) + else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[1])) != inVertices.end()) { outFaces.push_back(i); } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), pFaces[i].v[2]) != inVertices.end()) + else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[2])) != inVertices.end()) { outFaces.push_back(i); } diff --git a/Code/Editor/Objects/EntityObject.cpp b/Code/Editor/Objects/EntityObject.cpp index 0f4a17f3ba..77fab543f9 100644 --- a/Code/Editor/Objects/EntityObject.cpp +++ b/Code/Editor/Objects/EntityObject.cpp @@ -1283,7 +1283,7 @@ void CEntityObject::UpdateVisibility(bool bVisible) CBaseObject::UpdateVisibility(bVisible); bool bVisibleWithSpec = bVisible && !IsHiddenBySpec(); - if (bVisibleWithSpec != m_bVisible) + if (bVisibleWithSpec != static_cast(m_bVisible)) { m_bVisible = bVisibleWithSpec; } diff --git a/Code/Editor/TrackView/TrackViewDialog.cpp b/Code/Editor/TrackView/TrackViewDialog.cpp index 331daf6730..309d776b81 100644 --- a/Code/Editor/TrackView/TrackViewDialog.cpp +++ b/Code/Editor/TrackView/TrackViewDialog.cpp @@ -1559,7 +1559,7 @@ void CTrackViewDialog::OnAddSelectedNode() selectedEntitiesCount, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntitiesCount); // check to make sure all nodes were added and notify user if they weren't - if (addedNodes.GetCount() != selectedEntitiesCount) + if (addedNodes.GetCount() != static_cast(selectedEntitiesCount)) { IMovieSystem* movieSystem = GetIEditor()->GetMovieSystem(); diff --git a/Code/Editor/TrackView/TrackViewNodes.cpp b/Code/Editor/TrackView/TrackViewNodes.cpp index 16baa72709..550d36af83 100644 --- a/Code/Editor/TrackView/TrackViewNodes.cpp +++ b/Code/Editor/TrackView/TrackViewNodes.cpp @@ -1113,7 +1113,7 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point) selectedEntitiesCount, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntitiesCount); // check to make sure all nodes were added and notify user if they weren't - if (addedNodes.GetCount() != selectedEntitiesCount) + if (addedNodes.GetCount() != static_cast(selectedEntitiesCount)) { IMovieSystem* movieSystem = GetIEditor()->GetMovieSystem(); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp index 3d8cbc7480..bbb54abb48 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp @@ -188,7 +188,7 @@ namespace AZ s32 numAvailableSlots = CalculateAvailableRequestSlots(); status.m_numAvailableSlots = AZStd::min(status.m_numAvailableSlots, numAvailableSlots); status.m_isIdle = status.m_isIdle && - numAvailableSlots == m_numBlocks && + static_cast(numAvailableSlots) == m_numBlocks && m_delayedSections.empty(); } diff --git a/Code/Framework/AzCore/Tests/Math/SimdMathTests.cpp b/Code/Framework/AzCore/Tests/Math/SimdMathTests.cpp index b05a95dbce..4570d79b83 100644 --- a/Code/Framework/AzCore/Tests/Math/SimdMathTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/SimdMathTests.cpp @@ -94,7 +94,7 @@ namespace UnitTest float testStoreValues[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; VectorType::StoreUnaligned(testStoreValues, result); - for (int32_t i = 0; i < VectorType::ElementCount; ++i) + for (uint32_t i = 0; i < VectorType::ElementCount; ++i) { if (i == replaceIndex) { diff --git a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp index a3d2103650..a0dda9f692 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp @@ -235,7 +235,7 @@ namespace AZ::IO::ArchiveInternal return 0; } - if (nReadBytes != nTotal) + if (static_cast(nReadBytes) != nTotal) { AZ_Warning("Archive", false, "FRead did not read expected number of byte from file, only %zu of %lld bytes read", nTotal, nReadBytes); nTotal = (size_t)nReadBytes; @@ -1791,11 +1791,11 @@ namespace AZ::IO AZ_Assert(m_pZip, "ZipFile is nullptr"); AZ_Assert(m_pFileEntry && m_pZip->IsOwnerOf(m_pFileEntry), "ZipFile is not owner of m_pFileEntry"); - if (nDataSize != m_pFileEntry->desc.lSizeUncompressed && bDecompress) + if (static_cast(nDataSize) != m_pFileEntry->desc.lSizeUncompressed && bDecompress) { return false; } - else if (nDataSize != m_pFileEntry->desc.lSizeCompressed && !bDecompress) + else if (static_cast(nDataSize) != m_pFileEntry->desc.lSizeCompressed && !bDecompress) { return false; } diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp index b3b2328222..4111328224 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp @@ -104,7 +104,7 @@ namespace AZ::IO::ZipDir::ZipDirStructuresInternal if (*pReturnCode == Z_BUF_ERROR) { // As long as we consumed something, keep going. Only fail permanently if we've stalled. - if (nAvailIn != pZStream->avail_in || nAvailOut != pZStream->avail_out) + if (nAvailIn != static_cast(pZStream->avail_in) || nAvailOut != static_cast(pZStream->avail_out)) { *pReturnCode = Z_OK; } diff --git a/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpUvMapImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpUvMapImporter.cpp index fc0ac15244..9e0d788896 100644 --- a/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpUvMapImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpUvMapImporter.cpp @@ -88,7 +88,7 @@ namespace AZ AZ_Error( Utilities::ErrorWindow, meshesPerTextureCoordinateIndex[texCoordIndex] == 0 || - meshesPerTextureCoordinateIndex[texCoordIndex] == currentNode->mNumMeshes, + meshesPerTextureCoordinateIndex[texCoordIndex] == static_cast(currentNode->mNumMeshes), "Texture coordinate index %d for node %s is not on all meshes on this node. " "Placeholder arbitrary texture values will be generated to allow the data to process, but the source art " "needs to be fixed to correct this. All meshes on this node should have the same number of texture coordinate channels.", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/DdsLoader.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/DdsLoader.cpp index c1d2d7bf19..b9054a9911 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/DdsLoader.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/DdsLoader.cpp @@ -90,7 +90,7 @@ namespace ImageProcessingAtom for (i; i < ePixelFormat_Count; i++) { const PixelFormatInfo* info = CPixelFormats::GetInstance().GetPixelFormatInfo((EPixelFormat)i); - if (info->d3d10Format == dxgiFormat) + if (static_cast(info->d3d10Format) == dxgiFormat) { eFormat = (EPixelFormat)i; break; @@ -509,7 +509,7 @@ namespace ImageProcessingAtom for (i; i < ePixelFormat_Count; i++) { const PixelFormatInfo* info = CPixelFormats::GetInstance().GetPixelFormatInfo((EPixelFormat)i); - if (info->d3d10Format == dxgiFormat) + if (static_cast(info->d3d10Format) == dxgiFormat) { format = (EPixelFormat)i; break; diff --git a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BlendColorGradingLutsPass.cpp b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BlendColorGradingLutsPass.cpp index da680d80cf..fe5db0b441 100644 --- a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BlendColorGradingLutsPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/BlendColorGradingLutsPass.cpp @@ -353,7 +353,7 @@ namespace AZ } // If the number of source LUTs have changed, the shader variant will need to be updated - if (m_numSourceLuts != current) + if (m_numSourceLuts != static_cast(current)) { m_numSourceLuts = current; m_needToUpdateShaderVariant = true; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp index ffe5ec408a..1bd6067116 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp @@ -132,7 +132,7 @@ namespace MaterialEditor QSize newDeviceSize = m_materialViewport->size(); AZ_Warning( - "Material Editor", newDeviceSize.width() == width && newDeviceSize.height() == height, + "Material Editor", static_cast(newDeviceSize.width()) == width && static_cast(newDeviceSize.height()) == height, "Resizing the window did not give the expected frame size. Requested %d x %d but got %d x %d.", width, height, newDeviceSize.width(), newDeviceSize.height()); } diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp index a29815f08c..b10edfae2e 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp @@ -1480,7 +1480,7 @@ bool AZ::FFont::UpdateTexture() return false; } - if (m_fontTexture->GetWidth() != m_fontImage->GetDescriptor().m_size.m_width || m_fontTexture->GetHeight() != m_fontImage->GetDescriptor().m_size.m_height) + if (m_fontTexture->GetWidth() != static_cast(m_fontImage->GetDescriptor().m_size.m_width) || m_fontTexture->GetHeight() != static_cast(m_fontImage->GetDescriptor().m_size.m_height)) { AZ_Assert(false, "AtomFont::FFont:::UpdateTexture size mismatch between texture and image!"); return false; diff --git a/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp b/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp index b65e690f1b..cdd7d937e3 100644 --- a/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp +++ b/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp @@ -138,7 +138,7 @@ namespace AudioControls for (int i = 0; i < size; ++i) { QListWidgetItem* listItem = m_connectionList->item(i); - if (listItem && listItem->data(eMDR_ID).toInt() == middlewareControl->GetId()) + if (listItem && listItem->data(eMDR_ID).toInt() == static_cast(middlewareControl->GetId())) { m_connectionList->clearSelection(); listItem->setSelected(true); diff --git a/Gems/EditorPythonBindings/Code/Source/PythonMarshalComponent.cpp b/Gems/EditorPythonBindings/Code/Source/PythonMarshalComponent.cpp index d1b59e7ecc..af21420b62 100644 --- a/Gems/EditorPythonBindings/Code/Source/PythonMarshalComponent.cpp +++ b/Gems/EditorPythonBindings/Code/Source/PythonMarshalComponent.cpp @@ -795,7 +795,7 @@ namespace EditorPythonBindings } } - AZ_Warning("python", PyDict_Size(pyObj.ptr()) == mapDataContainer->Size(mapInstance.m_address), "Python Dict size:%d does not match the size of the unordered_map:%d", pos, mapDataContainer->Size(mapInstance.m_address)); + AZ_Warning("python", static_cast(PyDict_Size(pyObj.ptr())) == mapDataContainer->Size(mapInstance.m_address), "Python Dict size:%d does not match the size of the unordered_map:%d", pos, mapDataContainer->Size(mapInstance.m_address)); outValue.m_value = mapInstance.m_address; outValue.m_typeId = mapInstance.m_typeId; outValue.m_traits = traits; diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp index ea9a1d380f..4c22afac76 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp @@ -145,7 +145,7 @@ namespace UnitTest { for (AZ::u32 x = 0; x < width; ++x) { - if ((x == pixelX) && (y == pixelY)) + if ((x == static_cast(pixelX)) && (y == static_cast(pixelY))) { m_imageData->m_imageData.push_back(pixelValue); } diff --git a/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp b/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp index f53da64110..04f655123c 100644 --- a/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp +++ b/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp @@ -310,7 +310,7 @@ void SpriteBorderEditor::AddConfigureSection(QGridLayout* gridLayout, int& rowNu int newNumCols = numColsLineEdit->text().toInt(&colConversionSuccess); const bool positiveInputs = newNumRows > 0 && newNumCols > 0; - const bool valueChanged = m_numRows != newNumRows || m_numCols != newNumCols; + const bool valueChanged = m_numRows != static_cast(newNumRows) || m_numCols != static_cast(newNumCols); // This number of cells is just nearly unusable in the sprite editor UI. Supporting // more would likely require reworking of UX/UI and even implementation. diff --git a/Gems/LyShine/Code/Source/UiTextComponent.cpp b/Gems/LyShine/Code/Source/UiTextComponent.cpp index a996a489cc..ef9c3d4bb7 100644 --- a/Gems/LyShine/Code/Source/UiTextComponent.cpp +++ b/Gems/LyShine/Code/Source/UiTextComponent.cpp @@ -2068,7 +2068,7 @@ int UiTextComponent::GetFontEffect() //////////////////////////////////////////////////////////////////////////////////////////////////// void UiTextComponent::SetFontEffect(int effectIndex) { - if (m_fontEffectIndex != effectIndex) + if (m_fontEffectIndex != static_cast(effectIndex)) { m_fontEffectIndex = effectIndex; diff --git a/Gems/LyShine/Code/Source/UiTextInputComponent.cpp b/Gems/LyShine/Code/Source/UiTextInputComponent.cpp index 0d9fc09063..df2d85eb74 100644 --- a/Gems/LyShine/Code/Source/UiTextInputComponent.cpp +++ b/Gems/LyShine/Code/Source/UiTextInputComponent.cpp @@ -63,7 +63,7 @@ namespace //! \brief Given a UTF8 string and index, return the raw string buffer index that maps to the UTF8 index. int GetCharArrayIndexFromUtf8CharIndex(const AZStd::string& utf8String, const uint utf8Index) { - int utfIndexIter = 0; + uint utfIndexIter = 0; int rawIndex = 0; const AZStd::string::size_type stringLength = utf8String.length(); diff --git a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ClothComponentMesh.cpp b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ClothComponentMesh.cpp index 5a7564d72a..3d291e2e85 100644 --- a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ClothComponentMesh.cpp +++ b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ClothComponentMesh.cpp @@ -525,7 +525,7 @@ namespace NvCloth const int numVertices = subMeshInfo.m_numVertices; const int firstVertex = subMeshInfo.m_verticesFirstIndex; - if (subMesh.GetVertexCount() != numVertices) + if (subMesh.GetVertexCount() != static_cast(numVertices)) { AZ_Error("ClothComponentMesh", false, "Render mesh to be modified doesn't have the same number of vertices (%d) as the cloth's submesh (%d).", diff --git a/Gems/ScriptedEntityTweener/Code/Source/ScriptedEntityTweenerTask.h b/Gems/ScriptedEntityTweener/Code/Source/ScriptedEntityTweenerTask.h index 91528c08c0..a0d453c593 100644 --- a/Gems/ScriptedEntityTweener/Code/Source/ScriptedEntityTweenerTask.h +++ b/Gems/ScriptedEntityTweener/Code/Source/ScriptedEntityTweenerTask.h @@ -150,7 +150,7 @@ namespace ScriptedEntityTweener bool IsTimelineIdValid(int timelineId) { - return timelineId != AnimationProperties::InvalidTimelineId; + return timelineId != static_cast(AnimationProperties::InvalidTimelineId); } bool InitializeSubtask(ScriptedEntityTweenerSubtask& subtask, const AZStd::pair initData, AnimationParameters params); diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index 161783caa1..12bd2fb8f2 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -39,7 +39,6 @@ ly_append_configurations_options( # Disabling these warnings while they get fixed /wd4245 # conversion, signed/unsigned mismatch - /wd4389 # comparison, signed/unsigned mismatch # Enabling warnings that are disabled by default from /W4 # https://docs.microsoft.com/en-us/cpp/preprocessor/compiler-warnings-that-are-off-by-default?view=vs-2019