Setting /permissive- to make MSVC more "standard" (#3701)

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
monroegm-disable-blank-issue-2
Esteban Papp 4 years ago committed by GitHub
parent 2bf83ad9fb
commit 39cf45e544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,7 +17,7 @@
namespace PythonCoverage namespace PythonCoverage
{ {
static constexpr char* const LogCallSite = "PythonCoverageEditorSystemComponent"; static constexpr const char* const LogCallSite = "PythonCoverageEditorSystemComponent";
void PythonCoverageEditorSystemComponent::Reflect(AZ::ReflectContext* context) void PythonCoverageEditorSystemComponent::Reflect(AZ::ReflectContext* context)
{ {

@ -19,6 +19,7 @@
#include <AzCore/std/typetraits/is_member_pointer.h> #include <AzCore/std/typetraits/is_member_pointer.h>
#include <AzCore/std/typetraits/is_const.h> #include <AzCore/std/typetraits/is_const.h>
#include <AzCore/std/typetraits/remove_cvref.h> #include <AzCore/std/typetraits/remove_cvref.h>
#include <AzCore/std/typetraits/is_volatile.h>
#include <AzCore/std/createdestroy.h> #include <AzCore/std/createdestroy.h>
#define AZSTD_FUNCTION_TARGET_FIX(x) #define AZSTD_FUNCTION_TARGET_FIX(x)
@ -591,8 +592,8 @@ namespace AZStd
Internal::function_util::function_buffer type_result; Internal::function_util::function_buffer type_result;
type_result.type.type = aztypeid(Functor); type_result.type.type = aztypeid(Functor);
type_result.type.const_qualified = is_const<Functor>::value; type_result.type.const_qualified = AZStd::is_const<Functor>::value;
type_result.type.volatile_qualified = is_volatile<Functor>::value; type_result.type.volatile_qualified = AZStd::is_volatile<Functor>::value;
vtable->manager(functor, type_result, Internal::function_util::check_functor_type_tag); vtable->manager(functor, type_result, Internal::function_util::check_functor_type_tag);
return static_cast<Functor*>(type_result.obj_ptr); return static_cast<Functor*>(type_result.obj_ptr);
} }
@ -608,7 +609,7 @@ namespace AZStd
Internal::function_util::function_buffer type_result; Internal::function_util::function_buffer type_result;
type_result.type.type = aztypeid(Functor); type_result.type.type = aztypeid(Functor);
type_result.type.const_qualified = true; type_result.type.const_qualified = true;
type_result.type.volatile_qualified = is_volatile<Functor>::value; type_result.type.volatile_qualified = AZStd::is_volatile<Functor>::value;
vtable->manager(functor, type_result, Internal::function_util::check_functor_type_tag); vtable->manager(functor, type_result, Internal::function_util::check_functor_type_tag);
// GCC 2.95.3 gets the CV qualifiers wrong here, so we // GCC 2.95.3 gets the CV qualifiers wrong here, so we
// can't do the static_cast that we should do. // can't do the static_cast that we should do.

@ -359,7 +359,7 @@ namespace AZStd
{ {
functor.obj_ref.obj_ptr = (void*)&f.get(); functor.obj_ref.obj_ptr = (void*)&f.get();
functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value; functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value;
functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value; functor.obj_ref.is_volatile_qualified = AZStd::is_volatile<FunctionObj>::value;
return true; return true;
} }
else else

@ -70,11 +70,11 @@ namespace AZStd
bool try_acquire_until(const chrono::time_point<Clock, Duration>& abs_time) bool try_acquire_until(const chrono::time_point<Clock, Duration>& abs_time)
{ {
auto timeNow = chrono::system_clock::now(); auto timeNow = chrono::system_clock::now();
if (timeNow >= absTime) if (timeNow >= abs_time)
{ {
return false; // we timed out already! return false; // we timed out already!
} }
auto deltaTime = absTime - timeNow; auto deltaTime = abs_time - timeNow;
auto timeToTry = chrono::duration_cast<chrono::milliseconds>(deltaTime); auto timeToTry = chrono::duration_cast<chrono::milliseconds>(deltaTime);
return (WaitForSingleObject(m_event, aznumeric_cast<DWORD>(timeToTry.count())) == AZ_WAIT_OBJECT_0); return (WaitForSingleObject(m_event, aznumeric_cast<DWORD>(timeToTry.count())) == AZ_WAIT_OBJECT_0);
} }

@ -198,7 +198,7 @@ namespace AZStd
AZ_FORCE_INLINE cv_status condition_variable_any::wait_for(Lock& lock, const chrono::duration<Rep, Period>& rel_time) AZ_FORCE_INLINE cv_status condition_variable_any::wait_for(Lock& lock, const chrono::duration<Rep, Period>& rel_time)
{ {
chrono::milliseconds toWait = rel_time; chrono::milliseconds toWait = rel_time;
EnterCriticalSection(&m_mutex); EnterCriticalSection(static_cast<LPCRITICAL_SECTION>(&m_mutex));
lock.unlock(); lock.unlock();
// We need to make sure we use CriticalSection based mutex. // We need to make sure we use CriticalSection based mutex.
@ -217,7 +217,7 @@ namespace AZStd
returnCode = cv_status::timeout; returnCode = cv_status::timeout;
} }
} }
LeaveCriticalSection(&m_mutex); LeaveCriticalSection(static_cast<LPCRITICAL_SECTION>(&m_mutex));
lock.lock(); lock.lock();
return returnCode; return returnCode;
} }

@ -2100,8 +2100,8 @@ namespace UnitTest
typename TypeParam::ContainerType container; typename TypeParam::ContainerType container;
container.emplace(-2352); container.emplace(-2352);
container.emplace(3534); container.emplace(3534);
container.emplace(1535408957); container.emplace(535408957);
container.emplace(3310556522); container.emplace(1310556522);
container.emplace(55546193); container.emplace(55546193);
container.emplace(1582); container.emplace(1582);

@ -1805,8 +1805,8 @@ namespace UnitTest
typename TypeParam::ContainerType container; typename TypeParam::ContainerType container;
container.emplace(-2352); container.emplace(-2352);
container.emplace(3534); container.emplace(3534);
container.emplace(1535408957); container.emplace(535408957);
container.emplace(3310556522); container.emplace(1310556522);
container.emplace(55546193); container.emplace(55546193);
container.emplace(1582); container.emplace(1582);

@ -19,6 +19,18 @@
#include <SceneAPI/SceneCore/Containers/Views/PairIterator.h> #include <SceneAPI/SceneCore/Containers/Views/PairIterator.h>
#include <SceneAPI/SceneCore/Tests/Containers/Views/IteratorTestsBase.h> #include <SceneAPI/SceneCore/Tests/Containers/Views/IteratorTestsBase.h>
// This test gives trouble with /permissive-, the following instantiation workarounds the missing resolution
namespace std
{
template<>
void iter_swap(
AZ::SceneAPI::Containers::Views::PairIterator<int*, int*, std::random_access_iterator_tag> lhs,
AZ::SceneAPI::Containers::Views::PairIterator<int*, int*, std::random_access_iterator_tag> rhs)
{
AZStd::iter_swap(lhs, rhs);
}
}
namespace AZ namespace AZ
{ {
namespace SceneAPI namespace SceneAPI

@ -368,7 +368,7 @@ namespace TestImpact
const AZStd::vector<AZStd::string>& draftedTestRuns, const AZStd::vector<AZStd::string>& draftedTestRuns,
TestRunReport&& selectedTestRunReport, TestRunReport&& selectedTestRunReport,
TestRunReport&& draftedTestRunReport) TestRunReport&& draftedTestRunReport)
: SequenceReportBase( : SequenceReportBase<PolicyStateType> (
type, type,
maxConcurrency, maxConcurrency,
testTargetTimeout, testTargetTimeout,
@ -397,57 +397,57 @@ namespace TestImpact
// SequenceReport overrides ... // SequenceReport overrides ...
AZStd::chrono::milliseconds GetDuration() const override AZStd::chrono::milliseconds GetDuration() const override
{ {
return SequenceReportBase::GetDuration() + m_draftedTestRunReport.GetDuration(); return GetDuration() + m_draftedTestRunReport.GetDuration();
} }
TestSequenceResult GetResult() const override TestSequenceResult GetResult() const override
{ {
return CalculateMultiTestSequenceResult({ SequenceReportBase::GetResult(), m_draftedTestRunReport.GetResult() }); return CalculateMultiTestSequenceResult({ GetResult(), m_draftedTestRunReport.GetResult() });
} }
size_t GetTotalNumTestRuns() const override size_t GetTotalNumTestRuns() const override
{ {
return SequenceReportBase::GetTotalNumTestRuns() + m_draftedTestRunReport.GetTotalNumTestRuns(); return GetTotalNumTestRuns() + m_draftedTestRunReport.GetTotalNumTestRuns();
} }
size_t GetTotalNumPassingTests() const override size_t GetTotalNumPassingTests() const override
{ {
return SequenceReportBase::GetTotalNumPassingTests() + m_draftedTestRunReport.GetTotalNumPassingTests(); return GetTotalNumPassingTests() + m_draftedTestRunReport.GetTotalNumPassingTests();
} }
size_t GetTotalNumFailingTests() const override size_t GetTotalNumFailingTests() const override
{ {
return SequenceReportBase::GetTotalNumFailingTests() + m_draftedTestRunReport.GetTotalNumFailingTests(); return GetTotalNumFailingTests() + m_draftedTestRunReport.GetTotalNumFailingTests();
} }
size_t GetTotalNumDisabledTests() const override size_t GetTotalNumDisabledTests() const override
{ {
return SequenceReportBase::GetTotalNumDisabledTests() + m_draftedTestRunReport.GetTotalNumDisabledTests(); return GetTotalNumDisabledTests() + m_draftedTestRunReport.GetTotalNumDisabledTests();
} }
size_t GetTotalNumPassingTestRuns() const override size_t GetTotalNumPassingTestRuns() const override
{ {
return SequenceReportBase::GetTotalNumPassingTestRuns() + m_draftedTestRunReport.GetNumPassingTestRuns(); return GetTotalNumPassingTestRuns() + m_draftedTestRunReport.GetNumPassingTestRuns();
} }
size_t GetTotalNumFailingTestRuns() const override size_t GetTotalNumFailingTestRuns() const override
{ {
return SequenceReportBase::GetTotalNumFailingTestRuns() + m_draftedTestRunReport.GetNumFailingTestRuns(); return GetTotalNumFailingTestRuns() + m_draftedTestRunReport.GetNumFailingTestRuns();
} }
size_t GetTotalNumExecutionFailureTestRuns() const override size_t GetTotalNumExecutionFailureTestRuns() const override
{ {
return SequenceReportBase::GetTotalNumExecutionFailureTestRuns() + m_draftedTestRunReport.GetNumExecutionFailureTestRuns(); return GetTotalNumExecutionFailureTestRuns() + m_draftedTestRunReport.GetNumExecutionFailureTestRuns();
} }
size_t GetTotalNumTimedOutTestRuns() const override size_t GetTotalNumTimedOutTestRuns() const override
{ {
return SequenceReportBase::GetTotalNumTimedOutTestRuns() + m_draftedTestRunReport.GetNumTimedOutTestRuns(); return GetTotalNumTimedOutTestRuns() + m_draftedTestRunReport.GetNumTimedOutTestRuns();
} }
size_t GetTotalNumUnexecutedTestRuns() const override size_t GetTotalNumUnexecutedTestRuns() const override
{ {
return SequenceReportBase::GetTotalNumUnexecutedTestRuns() + m_draftedTestRunReport.GetNumUnexecutedTestRuns(); return GetTotalNumUnexecutedTestRuns() + m_draftedTestRunReport.GetNumUnexecutedTestRuns();
} }
private: private:
AZStd::vector<AZStd::string> m_draftedTestRuns; AZStd::vector<AZStd::string> m_draftedTestRuns;

@ -26,11 +26,11 @@ namespace TestImpact
constexpr RepoPath() = default; constexpr RepoPath() = default;
constexpr RepoPath(const RepoPath&) = default; constexpr RepoPath(const RepoPath&) = default;
constexpr RepoPath(RepoPath&&) noexcept = default; constexpr RepoPath(RepoPath&&) noexcept = default;
constexpr RepoPath::RepoPath(const string_type& path) noexcept; constexpr RepoPath(const string_type& path) noexcept;
constexpr RepoPath::RepoPath(const string_view_type& path) noexcept; constexpr RepoPath(const string_view_type& path) noexcept;
constexpr RepoPath::RepoPath(const value_type* path) noexcept; constexpr RepoPath(const value_type* path) noexcept;
constexpr RepoPath::RepoPath(const AZ::IO::PathView& path); constexpr RepoPath(const AZ::IO::PathView& path);
constexpr RepoPath::RepoPath(const AZ::IO::Path& path); constexpr RepoPath(const AZ::IO::Path& path);
RepoPath& operator=(const RepoPath&) noexcept = default; RepoPath& operator=(const RepoPath&) noexcept = default;
RepoPath& operator=(const string_type&) noexcept; RepoPath& operator=(const string_type&) noexcept;

@ -14,8 +14,8 @@ namespace TestImpact
{ {
AZStd::string GetTestTargetExtension(const TestTarget* testTarget) AZStd::string GetTestTargetExtension(const TestTarget* testTarget)
{ {
static constexpr char* const standAloneExtension = ".exe"; static constexpr const char* const standAloneExtension = ".exe";
static constexpr char* const testRunnerExtension = ".dll"; static constexpr const char* const testRunnerExtension = ".dll";
switch (const auto launchMethod = testTarget->GetLaunchMethod(); launchMethod) switch (const auto launchMethod = testTarget->GetLaunchMethod(); launchMethod)
{ {

@ -11,6 +11,8 @@
#include <RHI/PipelineLayout.h> #include <RHI/PipelineLayout.h>
#include <RHI/PipelineState.h> #include <RHI/PipelineState.h>
#include <RHI/MemoryView.h> #include <RHI/MemoryView.h>
#include <RHI/ShaderResourceGroup.h>
#include <RHI/Conversions.h>
#include <Atom/RHI.Reflect/ClearValue.h> #include <Atom/RHI.Reflect/ClearValue.h>
#include <Atom/RHI/CommandList.h> #include <Atom/RHI/CommandList.h>
#include <Atom/RHI/CommandListValidator.h> #include <Atom/RHI/CommandListValidator.h>

@ -9,6 +9,7 @@
#include <Blast/BlastMaterial.h> #include <Blast/BlastMaterial.h>
#include <Family/ActorTracker.h> #include <Family/ActorTracker.h>
#include <Blast/BlastSystemBus.h>
namespace Blast namespace Blast
{ {

@ -329,23 +329,23 @@ namespace PhysX
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get()) if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::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); EXPECT_NE(jointHandle, AzPhysics::InvalidJointHandle);
// run physics to trigger the the move of parent body // 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; AZ::Vector3 childCurrentPos;
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get()) if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
{ {
auto* childBody = sceneInterface->GetSimulatedBodyFromHandle(m_testSceneHandle, m_childBodyHandle); auto* childBody = sceneInterface->GetSimulatedBodyFromHandle(this->m_testSceneHandle, this->m_childBodyHandle);
childCurrentPos = childBody->GetPosition(); childCurrentPos = childBody->GetPosition();
} }
EXPECT_GT(childCurrentPos.GetX(), m_childInitialPos.GetX()); EXPECT_GT(childCurrentPos.GetX(), this->m_childInitialPos.GetX());
} }
#endif // ENABLE_JOINTS_TYPED_TEST_CASE #endif // ENABLE_JOINTS_TYPED_TEST_CASE
} }

@ -171,7 +171,7 @@ namespace PhysX
//invalid simulated body handle returns null //invalid simulated body handle returns null
nullBody = sceneInterface->GetSimulatedBodyFromHandle(AzPhysics::InvalidSceneHandle, AzPhysics::InvalidSimulatedBodyHandle); nullBody = sceneInterface->GetSimulatedBodyFromHandle(AzPhysics::InvalidSceneHandle, AzPhysics::InvalidSimulatedBodyHandle);
EXPECT_TRUE(nullBody == nullptr); 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); EXPECT_TRUE(nullBody == nullptr);
//get 1 simulated body, should not be null. //get 1 simulated body, should not be null.

@ -29,6 +29,46 @@
#include <AzToolsFramework/ViewportSelection/EditorSelectionUtil.h> #include <AzToolsFramework/ViewportSelection/EditorSelectionUtil.h>
#include <WhiteBox/WhiteBoxToolApi.h> #include <WhiteBox/WhiteBoxToolApi.h>
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 // OpenMesh includes
AZ_PUSH_DISABLE_WARNING(4702, "-Wunknown-warning-option") // OpenMesh\Core\Utils\Property.hh has unreachable code AZ_PUSH_DISABLE_WARNING(4702, "-Wunknown-warning-option") // OpenMesh\Core\Utils\Property.hh has unreachable code
#include <OpenMesh/Core/IO/MeshIO.hh> #include <OpenMesh/Core/IO/MeshIO.hh>
@ -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<> template<>
inline void vector_cast(const AZ::Vector3& src, OpenMesh::Vec3f& dst, GenProg::Int2Type<3> /*unused*/) inline void vector_cast(const AZ::Vector3& src, OpenMesh::Vec3f& dst, GenProg::Int2Type<3> /*unused*/)
{ {

@ -33,6 +33,7 @@ ly_append_configurations_options(
/nologo # Suppress Copyright and version number message /nologo # Suppress Copyright and version number message
/W4 # Warning level 4 /W4 # Warning level 4
/WX # Warnings as errors /WX # Warnings as errors
/permissive- # Conformance with standard
# Disabling some warnings # 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 /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

Loading…
Cancel
Save