aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/bits.cpp
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-07 21:31:41 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-07 21:31:41 +0100
commit2ae34b67e36b8ba05132d481876eb4ed7a826283 (patch)
tree63f44c8e2dcdc959d7a5317a3a7b36efedbd7d38 /NorthstarDLL/bits.cpp
parent3406de7aaaf52cbef20b1549f2d7da0255d30f51 (diff)
downloadNorthstarLauncher-2ae34b67e36b8ba05132d481876eb4ed7a826283.tar.gz
NorthstarLauncher-2ae34b67e36b8ba05132d481876eb4ed7a826283.zip
almost fully replaced hooking lib
Diffstat (limited to 'NorthstarDLL/bits.cpp')
-rw-r--r--NorthstarDLL/bits.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/NorthstarDLL/bits.cpp b/NorthstarDLL/bits.cpp
index 014899f2..db8b1133 100644
--- a/NorthstarDLL/bits.cpp
+++ b/NorthstarDLL/bits.cpp
@@ -1,46 +1,46 @@
-//=============================================================================//
-//
-// Purpose: look for NANs, infinities, and underflows.
-//
-//=============================================================================//
-
-#include "pch.h"
-#include "bits.h"
-
-//-----------------------------------------------------------------------------
-// This follows the ANSI/IEEE 754-1985 standard
-//-----------------------------------------------------------------------------
-unsigned long& FloatBits(float& f)
-{
- return *reinterpret_cast<unsigned long*>(&f);
-}
-
-unsigned long const& FloatBits(float const& f)
-{
- return *reinterpret_cast<unsigned long const*>(&f);
-}
-
-float BitsToFloat(unsigned long i)
-{
- return *reinterpret_cast<float*>(&i);
-}
-
-bool IsFinite(float f)
-{
- return ((FloatBits(f) & 0x7F800000) != 0x7F800000);
-}
-
-unsigned long FloatAbsBits(float f)
-{
- return FloatBits(f) & 0x7FFFFFFF;
-}
-
-float FloatMakePositive(float f)
-{
- return fabsf(f);
-}
-
-float FloatNegate(float f)
-{
- return -f; // BitsToFloat( FloatBits(f) ^ 0x80000000 );
-}
+//=============================================================================//
+//
+// Purpose: look for NANs, infinities, and underflows.
+//
+//=============================================================================//
+
+#include "pch.h"
+#include "bits.h"
+
+//-----------------------------------------------------------------------------
+// This follows the ANSI/IEEE 754-1985 standard
+//-----------------------------------------------------------------------------
+unsigned long& FloatBits(float& f)
+{
+ return *reinterpret_cast<unsigned long*>(&f);
+}
+
+unsigned long const& FloatBits(float const& f)
+{
+ return *reinterpret_cast<unsigned long const*>(&f);
+}
+
+float BitsToFloat(unsigned long i)
+{
+ return *reinterpret_cast<float*>(&i);
+}
+
+bool IsFinite(float f)
+{
+ return ((FloatBits(f) & 0x7F800000) != 0x7F800000);
+}
+
+unsigned long FloatAbsBits(float f)
+{
+ return FloatBits(f) & 0x7FFFFFFF;
+}
+
+float FloatMakePositive(float f)
+{
+ return fabsf(f);
+}
+
+float FloatNegate(float f)
+{
+ return -f; // BitsToFloat( FloatBits(f) ^ 0x80000000 );
+}