From 27611d55ff7d320a2365e6357ad6662ae83e4fd7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 24 Mar 2018 19:33:38 -0400 Subject: [PATCH] Interpreter_FPUtils: Get rid of a pointer cast This is undefined behavior according to the standard. We can just use the built in means of retrieving a quiet NaN. --- Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h index 7c52342dd200..d2adcd7b6fa7 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h @@ -13,8 +13,7 @@ #include "Core/PowerPC/Gekko.h" #include "Core/PowerPC/PowerPC.h" -const u64 PPC_NAN_U64 = 0x7ff8000000000000ull; -const double PPC_NAN = *(double* const) & PPC_NAN_U64; +constexpr double PPC_NAN = std::numeric_limits::quiet_NaN(); // the 4 less-significand bits in FPSCR[FPRF] enum FPCC