diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorSystemComponent.cpp b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorSystemComponent.cpp index ad6cf216d7..1528e09169 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorSystemComponent.cpp +++ b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorSystemComponent.cpp @@ -17,7 +17,7 @@ namespace PythonCoverage { - static constexpr char* const LogCallSite = "PythonCoverageEditorSystemComponent"; + static constexpr const char* const LogCallSite = "PythonCoverageEditorSystemComponent"; void PythonCoverageEditorSystemComponent::Reflect(AZ::ReflectContext* context) { diff --git a/Code/Framework/AzCore/AzCore/std/function/function_base.h b/Code/Framework/AzCore/AzCore/std/function/function_base.h index b39a5cf81b..8ceba11239 100644 --- a/Code/Framework/AzCore/AzCore/std/function/function_base.h +++ b/Code/Framework/AzCore/AzCore/std/function/function_base.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #define AZSTD_FUNCTION_TARGET_FIX(x) @@ -591,8 +592,8 @@ namespace AZStd Internal::function_util::function_buffer type_result; type_result.type.type = aztypeid(Functor); - type_result.type.const_qualified = is_const::value; - type_result.type.volatile_qualified = is_volatile::value; + type_result.type.const_qualified = AZStd::is_const::value; + type_result.type.volatile_qualified = AZStd::is_volatile::value; vtable->manager(functor, type_result, Internal::function_util::check_functor_type_tag); return static_cast(type_result.obj_ptr); } @@ -608,7 +609,7 @@ namespace AZStd Internal::function_util::function_buffer type_result; type_result.type.type = aztypeid(Functor); type_result.type.const_qualified = true; - type_result.type.volatile_qualified = is_volatile::value; + type_result.type.volatile_qualified = AZStd::is_volatile::value; vtable->manager(functor, type_result, Internal::function_util::check_functor_type_tag); // GCC 2.95.3 gets the CV qualifiers wrong here, so we // can't do the static_cast that we should do. diff --git a/Code/Framework/AzCore/AzCore/std/function/function_template.h b/Code/Framework/AzCore/AzCore/std/function/function_template.h index 7f388c4006..8e389cb53d 100644 --- a/Code/Framework/AzCore/AzCore/std/function/function_template.h +++ b/Code/Framework/AzCore/AzCore/std/function/function_template.h @@ -359,7 +359,7 @@ namespace AZStd { functor.obj_ref.obj_ptr = (void*)&f.get(); functor.obj_ref.is_const_qualified = is_const::value; - functor.obj_ref.is_volatile_qualified = is_volatile::value; + functor.obj_ref.is_volatile_qualified = AZStd::is_volatile::value; return true; } else diff --git a/Code/Framework/AzCore/AzCore/std/parallel/binary_semaphore.h b/Code/Framework/AzCore/AzCore/std/parallel/binary_semaphore.h index f9d0cdbe4d..9496d7c18b 100644 --- a/Code/Framework/AzCore/AzCore/std/parallel/binary_semaphore.h +++ b/Code/Framework/AzCore/AzCore/std/parallel/binary_semaphore.h @@ -70,11 +70,11 @@ namespace AZStd bool try_acquire_until(const chrono::time_point& abs_time) { auto timeNow = chrono::system_clock::now(); - if (timeNow >= absTime) + if (timeNow >= abs_time) { return false; // we timed out already! } - auto deltaTime = absTime - timeNow; + auto deltaTime = abs_time - timeNow; auto timeToTry = chrono::duration_cast(deltaTime); return (WaitForSingleObject(m_event, aznumeric_cast(timeToTry.count())) == AZ_WAIT_OBJECT_0); } diff --git a/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/internal/condition_variable_WinAPI.h b/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/internal/condition_variable_WinAPI.h index 536144b814..4ac95139db 100644 --- a/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/internal/condition_variable_WinAPI.h +++ b/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/internal/condition_variable_WinAPI.h @@ -198,7 +198,7 @@ namespace AZStd AZ_FORCE_INLINE cv_status condition_variable_any::wait_for(Lock& lock, const chrono::duration& rel_time) { chrono::milliseconds toWait = rel_time; - EnterCriticalSection(&m_mutex); + EnterCriticalSection(static_cast(&m_mutex)); lock.unlock(); // We need to make sure we use CriticalSection based mutex. @@ -217,7 +217,7 @@ namespace AZStd returnCode = cv_status::timeout; } } - LeaveCriticalSection(&m_mutex); + LeaveCriticalSection(static_cast(&m_mutex)); lock.lock(); return returnCode; } diff --git a/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp b/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp index 4e4dfc1f89..b92dee44b6 100644 --- a/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp @@ -2100,8 +2100,8 @@ namespace UnitTest typename TypeParam::ContainerType container; container.emplace(-2352); container.emplace(3534); - container.emplace(1535408957); - container.emplace(3310556522); + container.emplace(535408957); + container.emplace(1310556522); container.emplace(55546193); container.emplace(1582); diff --git a/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp b/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp index 79abd71a70..ca7d5cba42 100644 --- a/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp @@ -1805,8 +1805,8 @@ namespace UnitTest typename TypeParam::ContainerType container; container.emplace(-2352); container.emplace(3534); - container.emplace(1535408957); - container.emplace(3310556522); + container.emplace(535408957); + container.emplace(1310556522); container.emplace(55546193); container.emplace(1582); diff --git a/Code/Tools/SceneAPI/SceneCore/Tests/Containers/Views/PairIteratorTests.cpp b/Code/Tools/SceneAPI/SceneCore/Tests/Containers/Views/PairIteratorTests.cpp index d80f54dfb5..2437d8557e 100644 --- a/Code/Tools/SceneAPI/SceneCore/Tests/Containers/Views/PairIteratorTests.cpp +++ b/Code/Tools/SceneAPI/SceneCore/Tests/Containers/Views/PairIteratorTests.cpp @@ -19,6 +19,18 @@ #include #include +// This test gives trouble with /permissive-, the following instantiation workarounds the missing resolution +namespace std +{ + template<> + void iter_swap( + AZ::SceneAPI::Containers::Views::PairIterator lhs, + AZ::SceneAPI::Containers::Views::PairIterator rhs) + { + AZStd::iter_swap(lhs, rhs); + } +} + namespace AZ { namespace SceneAPI diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Include/TestImpactFramework/TestImpactClientSequenceReport.h b/Code/Tools/TestImpactFramework/Runtime/Code/Include/TestImpactFramework/TestImpactClientSequenceReport.h index 1ddd1042e6..b39c2c8bcb 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Include/TestImpactFramework/TestImpactClientSequenceReport.h +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Include/TestImpactFramework/TestImpactClientSequenceReport.h @@ -368,7 +368,7 @@ namespace TestImpact const AZStd::vector& draftedTestRuns, TestRunReport&& selectedTestRunReport, TestRunReport&& draftedTestRunReport) - : SequenceReportBase( + : SequenceReportBase ( type, maxConcurrency, testTargetTimeout, @@ -397,57 +397,57 @@ namespace TestImpact // SequenceReport overrides ... AZStd::chrono::milliseconds GetDuration() const override { - return SequenceReportBase::GetDuration() + m_draftedTestRunReport.GetDuration(); + return GetDuration() + m_draftedTestRunReport.GetDuration(); } TestSequenceResult GetResult() const override { - return CalculateMultiTestSequenceResult({ SequenceReportBase::GetResult(), m_draftedTestRunReport.GetResult() }); + return CalculateMultiTestSequenceResult({ GetResult(), m_draftedTestRunReport.GetResult() }); } size_t GetTotalNumTestRuns() const override { - return SequenceReportBase::GetTotalNumTestRuns() + m_draftedTestRunReport.GetTotalNumTestRuns(); + return GetTotalNumTestRuns() + m_draftedTestRunReport.GetTotalNumTestRuns(); } size_t GetTotalNumPassingTests() const override { - return SequenceReportBase::GetTotalNumPassingTests() + m_draftedTestRunReport.GetTotalNumPassingTests(); + return GetTotalNumPassingTests() + m_draftedTestRunReport.GetTotalNumPassingTests(); } size_t GetTotalNumFailingTests() const override { - return SequenceReportBase::GetTotalNumFailingTests() + m_draftedTestRunReport.GetTotalNumFailingTests(); + return GetTotalNumFailingTests() + m_draftedTestRunReport.GetTotalNumFailingTests(); } size_t GetTotalNumDisabledTests() const override { - return SequenceReportBase::GetTotalNumDisabledTests() + m_draftedTestRunReport.GetTotalNumDisabledTests(); + return GetTotalNumDisabledTests() + m_draftedTestRunReport.GetTotalNumDisabledTests(); } size_t GetTotalNumPassingTestRuns() const override { - return SequenceReportBase::GetTotalNumPassingTestRuns() + m_draftedTestRunReport.GetNumPassingTestRuns(); + return GetTotalNumPassingTestRuns() + m_draftedTestRunReport.GetNumPassingTestRuns(); } size_t GetTotalNumFailingTestRuns() const override { - return SequenceReportBase::GetTotalNumFailingTestRuns() + m_draftedTestRunReport.GetNumFailingTestRuns(); + return GetTotalNumFailingTestRuns() + m_draftedTestRunReport.GetNumFailingTestRuns(); } size_t GetTotalNumExecutionFailureTestRuns() const override { - return SequenceReportBase::GetTotalNumExecutionFailureTestRuns() + m_draftedTestRunReport.GetNumExecutionFailureTestRuns(); + return GetTotalNumExecutionFailureTestRuns() + m_draftedTestRunReport.GetNumExecutionFailureTestRuns(); } size_t GetTotalNumTimedOutTestRuns() const override { - return SequenceReportBase::GetTotalNumTimedOutTestRuns() + m_draftedTestRunReport.GetNumTimedOutTestRuns(); + return GetTotalNumTimedOutTestRuns() + m_draftedTestRunReport.GetNumTimedOutTestRuns(); } size_t GetTotalNumUnexecutedTestRuns() const override { - return SequenceReportBase::GetTotalNumUnexecutedTestRuns() + m_draftedTestRunReport.GetNumUnexecutedTestRuns(); + return GetTotalNumUnexecutedTestRuns() + m_draftedTestRunReport.GetNumUnexecutedTestRuns(); } private: AZStd::vector m_draftedTestRuns; diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Include/TestImpactFramework/TestImpactRepoPath.h b/Code/Tools/TestImpactFramework/Runtime/Code/Include/TestImpactFramework/TestImpactRepoPath.h index 86f4a98b78..e784c43500 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Include/TestImpactFramework/TestImpactRepoPath.h +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Include/TestImpactFramework/TestImpactRepoPath.h @@ -26,11 +26,11 @@ namespace TestImpact constexpr RepoPath() = default; constexpr RepoPath(const RepoPath&) = default; constexpr RepoPath(RepoPath&&) noexcept = default; - constexpr RepoPath::RepoPath(const string_type& path) noexcept; - constexpr RepoPath::RepoPath(const string_view_type& path) noexcept; - constexpr RepoPath::RepoPath(const value_type* path) noexcept; - constexpr RepoPath::RepoPath(const AZ::IO::PathView& path); - constexpr RepoPath::RepoPath(const AZ::IO::Path& path); + constexpr RepoPath(const string_type& path) noexcept; + constexpr RepoPath(const string_view_type& path) noexcept; + constexpr RepoPath(const value_type* path) noexcept; + constexpr RepoPath(const AZ::IO::PathView& path); + constexpr RepoPath(const AZ::IO::Path& path); RepoPath& operator=(const RepoPath&) noexcept = default; RepoPath& operator=(const string_type&) noexcept; diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Platform/Windows/TestEngine/JobRunner/TestImpactWin32_TestTargetExtension.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/Platform/Windows/TestEngine/JobRunner/TestImpactWin32_TestTargetExtension.cpp index 57647bb118..68beae5a0a 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Platform/Windows/TestEngine/JobRunner/TestImpactWin32_TestTargetExtension.cpp +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/Platform/Windows/TestEngine/JobRunner/TestImpactWin32_TestTargetExtension.cpp @@ -14,8 +14,8 @@ namespace TestImpact { AZStd::string GetTestTargetExtension(const TestTarget* testTarget) { - static constexpr char* const standAloneExtension = ".exe"; - static constexpr char* const testRunnerExtension = ".dll"; + static constexpr const char* const standAloneExtension = ".exe"; + static constexpr const char* const testRunnerExtension = ".dll"; switch (const auto launchMethod = testTarget->GetLaunchMethod(); launchMethod) { diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.h index b0c8642d68..443ab3e73a 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.h @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/Gems/Blast/Code/Source/Family/DamageManager.h b/Gems/Blast/Code/Source/Family/DamageManager.h index af7bae096b..f56bd7bbdf 100644 --- a/Gems/Blast/Code/Source/Family/DamageManager.h +++ b/Gems/Blast/Code/Source/Family/DamageManager.h @@ -9,6 +9,7 @@ #include #include +#include namespace Blast { diff --git a/Gems/PhysX/Code/Tests/PhysXJointsTest.cpp b/Gems/PhysX/Code/Tests/PhysXJointsTest.cpp index ac5a99e29a..3a7eac0884 100644 --- a/Gems/PhysX/Code/Tests/PhysXJointsTest.cpp +++ b/Gems/PhysX/Code/Tests/PhysXJointsTest.cpp @@ -329,23 +329,23 @@ namespace PhysX if (auto* sceneInterface = AZ::Interface::Get()) { - jointHandle = sceneInterface->AddJoint(m_testSceneHandle, &jointConfiguration, m_parentBodyHandle, m_childBodyHandle); + jointHandle = sceneInterface->AddJoint(this->m_testSceneHandle, &jointConfiguration, this->m_parentBodyHandle, this->m_childBodyHandle); } EXPECT_NE(jointHandle, AzPhysics::InvalidJointHandle); // run physics to trigger the the move of parent body - TestUtils::UpdateScene(m_testSceneHandle, AzPhysics::SystemConfiguration::DefaultFixedTimestep, 1); + TestUtils::UpdateScene(this->m_testSceneHandle, AzPhysics::SystemConfiguration::DefaultFixedTimestep, 1); AZ::Vector3 childCurrentPos; if (auto* sceneInterface = AZ::Interface::Get()) { - auto* childBody = sceneInterface->GetSimulatedBodyFromHandle(m_testSceneHandle, m_childBodyHandle); + auto* childBody = sceneInterface->GetSimulatedBodyFromHandle(this->m_testSceneHandle, this->m_childBodyHandle); childCurrentPos = childBody->GetPosition(); } - EXPECT_GT(childCurrentPos.GetX(), m_childInitialPos.GetX()); + EXPECT_GT(childCurrentPos.GetX(), this->m_childInitialPos.GetX()); } #endif // ENABLE_JOINTS_TYPED_TEST_CASE } diff --git a/Gems/PhysX/Code/Tests/PhysXSceneTests.cpp b/Gems/PhysX/Code/Tests/PhysXSceneTests.cpp index 7baaa34ab5..a4db2e9f0e 100644 --- a/Gems/PhysX/Code/Tests/PhysXSceneTests.cpp +++ b/Gems/PhysX/Code/Tests/PhysXSceneTests.cpp @@ -171,7 +171,7 @@ namespace PhysX //invalid simulated body handle returns null nullBody = sceneInterface->GetSimulatedBodyFromHandle(AzPhysics::InvalidSceneHandle, AzPhysics::InvalidSimulatedBodyHandle); EXPECT_TRUE(nullBody == nullptr); - nullBody = sceneInterface->GetSimulatedBodyFromHandle(m_testSceneHandle, AzPhysics::SimulatedBodyHandle(2347892348, 9)); + nullBody = sceneInterface->GetSimulatedBodyFromHandle(m_testSceneHandle, AzPhysics::SimulatedBodyHandle(1347892348, 9)); EXPECT_TRUE(nullBody == nullptr); //get 1 simulated body, should not be null. diff --git a/Gems/WhiteBox/Code/Source/Core/WhiteBoxToolApi.cpp b/Gems/WhiteBox/Code/Source/Core/WhiteBoxToolApi.cpp index 7e96c83810..afba511603 100644 --- a/Gems/WhiteBox/Code/Source/Core/WhiteBoxToolApi.cpp +++ b/Gems/WhiteBox/Code/Source/Core/WhiteBoxToolApi.cpp @@ -29,6 +29,46 @@ #include #include +namespace OpenMesh +{ + // Overload methods need to be declared before including OpenMesh so their definitions are found + + inline AZ::Vector3 normalize(const AZ::Vector3& v) + { + AZ::Vector3 vret = v; + vret.Normalize(); + return vret; + } + + inline float dot(const AZ::Vector3& v1, const AZ::Vector3& v2) + { + return v1.Dot(v2); + } + + inline float norm(const AZ::Vector3& v) + { + return v.GetLength(); + } + + inline AZ::Vector3 cross(const AZ::Vector3& v1, const AZ::Vector3& v2) + { + return v1.Cross(v2); + } + + inline AZ::Vector3 vectorize(AZ::Vector3& v, float s) + { + v = AZ::Vector3(s); + return v; + } + + inline void newell_norm(AZ::Vector3& n, const AZ::Vector3& a, const AZ::Vector3& b) + { + n.SetX(n.GetX() + (a.GetY() * b.GetZ())); + n.SetY(n.GetY() + (a.GetZ() * b.GetX())); + n.SetZ(n.GetZ() + (a.GetX() * b.GetY())); + } +} + // OpenMesh includes AZ_PUSH_DISABLE_WARNING(4702, "-Wunknown-warning-option") // OpenMesh\Core\Utils\Property.hh has unreachable code #include @@ -82,40 +122,6 @@ namespace OpenMesh } }; - inline AZ::Vector3 normalize(AZ::Vector3& v) - { - v.Normalize(); - return v; - } - - inline float dot(const AZ::Vector3& v1, const AZ::Vector3& v2) - { - return v1.Dot(v2); - } - - inline float norm(const AZ::Vector3& v) - { - return v.GetLength(); - } - - inline AZ::Vector3 cross(const AZ::Vector3& v1, const AZ::Vector3& v2) - { - return v1.Cross(v2); - } - - inline AZ::Vector3 vectorize(AZ::Vector3& v, float s) - { - v = AZ::Vector3(s); - return v; - } - - inline void newell_norm(AZ::Vector3& n, const AZ::Vector3& a, const AZ::Vector3& b) - { - n.SetX(n.GetX() + (a.GetY() * b.GetZ())); - n.SetY(n.GetY() + (a.GetZ() * b.GetX())); - n.SetZ(n.GetZ() + (a.GetX() * b.GetY())); - } - template<> inline void vector_cast(const AZ::Vector3& src, OpenMesh::Vec3f& dst, GenProg::Int2Type<3> /*unused*/) { diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index 7c7120fe15..647ced54a2 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -33,6 +33,7 @@ ly_append_configurations_options( /nologo # Suppress Copyright and version number message /W4 # Warning level 4 /WX # Warnings as errors + /permissive- # Conformance with standard # Disabling some warnings /wd4201 # nonstandard extension used: nameless struct/union. This actually became part of the C++11 std, MS has an open issue: https://developercommunity.visualstudio.com/t/warning-level-4-generates-a-bogus-warning-c4201-no/103064