From e8fd2996689eaddee01e5468bf89ab5e22178736 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Fri, 27 Aug 2021 21:45:09 +0200 Subject: [PATCH] Fix warning N2 Fix warning N2 Signed-off-by: Bensuperpc --- math/inv_sqrt.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/math/inv_sqrt.cpp b/math/inv_sqrt.cpp index 044749a9c..87d383f8c 100644 --- a/math/inv_sqrt.cpp +++ b/math/inv_sqrt.cpp @@ -27,16 +27,17 @@ inline T Fast_InvSqrt(T x) { "T must be floating point type"); static_assert(iterations == 1 or iterations == 2, "itarations must equal 1 or 2"); - typedef typename std::conditional::type Tint; + using Tint = typename std::conditional::type; T y = x; T x2 = y * 0.5; Tint i = *(Tint *)&y; i = (sizeof(T) == 8 ? 0x5fe6eb50c7b537a9 : 0x5f3759df) - (i >> 1); y = *(T *)&i; y = y * (1.5 - (x2 * y * y)); - if (iterations == 2) + if (iterations == 2) { y = y * (1.5 - (x2 * y * y)); + } return y; }