diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 06edbd33e8..067a58faa1 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -29,6 +29,7 @@ # include # include # elif defined(__MINGW32__) +# undef WINVER # define WINVER 0x502 // needed for SetDllDirectory # include # endif diff --git a/src/Gui/NaviCube.cpp b/src/Gui/NaviCube.cpp index a4743c299e..92389f736e 100644 --- a/src/Gui/NaviCube.cpp +++ b/src/Gui/NaviCube.cpp @@ -969,16 +969,22 @@ SbRotation NaviCubeImplementation::getNearestOrientation(PickId pickId) { angle *= -1; } + static const float pi = boost::math::constants::pi(); + static const float pi2 = boost::math::constants::two_pi(); + static const float pi1_2 = boost::math::constants::half_pi(); + static const float pi1_3 = boost::math::constants::third_pi(); + static const float pi2_3 = boost::math::constants::two_thirds_pi(); + // Make angle positive if (angle < 0) { - angle += 2 * M_PI; + angle += pi2; } // f is a small value used to control orientation priority when the camera is almost exactly between two // orientations (e.g. +45 and -45 degrees). The standard orientation is preferred compared to // +90 and -90 degree orientations and the +90 and -90 degree orientations are preferred compared to an // upside down standard orientation - float f = 0.00001; + float f = 0.00001F; // Find the angle to rotate to the nearest orientation if (m_Faces[pickId].type == ShapeId::Corner) { @@ -987,19 +993,19 @@ SbRotation NaviCubeImplementation::getNearestOrientation(PickId pickId) { angle = 0; } else if (angle <= (M_PI_2 + f)) { - angle = M_PI / 3; + angle = pi1_3; } else if (angle < (5 * M_PI / 6 - f)) { - angle = 2 * M_PI / 3; + angle = pi2_3; } else if (angle <= (M_PI + M_PI / 6 + f)) { - angle = M_PI; + angle = pi; } else if (angle < (M_PI + M_PI_2 - f)) { - angle = M_PI + M_PI / 3; + angle = pi + pi1_3; } else if (angle < (M_PI + 5 * M_PI / 6 - f)) { - angle = M_PI + 2 * M_PI / 3; + angle = pi + pi2_3; } else { angle = 0; @@ -1011,13 +1017,13 @@ SbRotation NaviCubeImplementation::getNearestOrientation(PickId pickId) { angle = 0; } else if (angle <= (3 * M_PI_4 + f)) { - angle = M_PI_2; + angle = pi1_2; } else if (angle < (M_PI + M_PI_4 - f)) { - angle = M_PI; + angle = pi; } else if (angle < (M_PI + 3 * M_PI_4 - f)) { - angle = M_PI + M_PI_2; + angle = pi + pi1_2; } else { angle = 0; diff --git a/src/Gui/SoFCCSysDragger.cpp b/src/Gui/SoFCCSysDragger.cpp index 75794b10ce..e78fbc11a6 100644 --- a/src/Gui/SoFCCSysDragger.cpp +++ b/src/Gui/SoFCCSysDragger.cpp @@ -186,7 +186,7 @@ SoGroup* TDragger::buildGeometry() cylinderSeparator->addChild(cylinder); //cone - float coneBottomRadius = 0.8; + float coneBottomRadius = 0.8F; float coneHeight = 2.5; auto coneSeparator = new SoSeparator(); root->addChild(coneSeparator); @@ -779,7 +779,7 @@ SoGroup* RDragger::buildGeometry() root->addChild(sphereTranslation); auto sphere = new SoSphere(); - sphere->radius.setValue(0.8); + sphere->radius.setValue(0.8F); root->addChild(sphere); return root; diff --git a/src/Mod/Mesh/Gui/ViewProviderPython.cpp b/src/Mod/Mesh/Gui/ViewProviderPython.cpp index d5c0f88e61..23cdd0d758 100644 --- a/src/Mod/Mesh/Gui/ViewProviderPython.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderPython.cpp @@ -21,8 +21,10 @@ ***************************************************************************/ -#include "ViewProviderPython.h" +// clang-format off #include "PreCompiled.h" +#include "ViewProviderPython.h" +// clang-format on namespace Gui { diff --git a/src/Mod/Sketcher/App/planegcs/Constraints.cpp b/src/Mod/Sketcher/App/planegcs/Constraints.cpp index 46bbbef181..ce081f7fdf 100644 --- a/src/Mod/Sketcher/App/planegcs/Constraints.cpp +++ b/src/Mod/Sketcher/App/planegcs/Constraints.cpp @@ -20,6 +20,10 @@ * * ***************************************************************************/ +#ifdef _MSC_VER +#pragma warning(disable : 4251) +#endif + #include #define DEBUG_DERIVS 0 #if DEBUG_DERIVS diff --git a/src/Mod/Sketcher/App/planegcs/SubSystem.cpp b/src/Mod/Sketcher/App/planegcs/SubSystem.cpp index 9df1d84937..494d6a8fd4 100644 --- a/src/Mod/Sketcher/App/planegcs/SubSystem.cpp +++ b/src/Mod/Sketcher/App/planegcs/SubSystem.cpp @@ -20,6 +20,10 @@ * * ***************************************************************************/ +#ifdef _MSC_VER +#pragma warning(disable : 4251) +#endif + #include #include