From be86eb779b2b862e894db4e7e26328bec0a998ec Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 20 Apr 2019 21:57:05 +0000 Subject: [PATCH] This is a few less instructions git-svn-id: https://svn.eduke32.com/eduke32@7618 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/polymost.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/build/include/polymost.h b/source/build/include/polymost.h index 8aca5d845..95d374841 100644 --- a/source/build/include/polymost.h +++ b/source/build/include/polymost.h @@ -155,9 +155,9 @@ static inline float polymost_invsqrt_approximation(float x) { #ifdef B_LITTLE_ENDIAN float const haf = x * .5f; - struct conv { union { uint32_t i; float f; } ; } * const n = (struct conv *)&x; - n->i = 0x5f375a86 - (n->i >> 1); - return n->f * (1.5f - haf * (n->f * n->f)); + union { float f; uint32_t i; } n = { x }; + n.i = 0x5f375a86 - (n.i >> 1); + return n.f * (1.5f - haf * (n.f * n.f)); #else // this is the comment return 1.f / Bsqrtf(x);