From 67435e22ca22dadc3479e7ef697dc3c4a8a9fa81 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sat, 31 May 2025 17:57:24 -0500 Subject: [PATCH] CAM(PathSimulator): Use single-precision pi All of PathSimulator uses floats, rather than doubles: to prevent compiler warnings about truncation, explicitly use the single-precision version of the standard pi constant. --- src/Mod/CAM/PathSimulator/AppGL/MillPathSegment.cpp | 2 +- src/Mod/CAM/PathSimulator/AppGL/SimDisplay.cpp | 2 -- src/Mod/CAM/PathSimulator/AppGL/SimDisplay.h | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Mod/CAM/PathSimulator/AppGL/MillPathSegment.cpp b/src/Mod/CAM/PathSimulator/AppGL/MillPathSegment.cpp index 53bef6acfd..fa2b5b2274 100644 --- a/src/Mod/CAM/PathSimulator/AppGL/MillPathSegment.cpp +++ b/src/Mod/CAM/PathSimulator/AppGL/MillPathSegment.cpp @@ -27,7 +27,7 @@ #include "GlUtils.h" #include -using std::numbers::pi; +constexpr auto pi = std::numbers::pi_v; #define N_MILL_SLICES 8 #define MAX_SEG_DEG (pi / 2.0f) // 90 deg diff --git a/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.cpp b/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.cpp index 88f10bb4bc..1c09c9420b 100644 --- a/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.cpp +++ b/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.cpp @@ -36,8 +36,6 @@ namespace MillSim { -using std::numbers::pi; - void SimDisplay::InitShaders() { // use shaders diff --git a/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.h b/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.h index 04ff704bc2..55f2d8eb8b 100644 --- a/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.h +++ b/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.h @@ -34,7 +34,7 @@ namespace MillSim { -using std::numbers::pi; +constexpr auto pi = std::numbers::pi_v; struct Point3D {