SystemRegisters: Get rid of pointer casting

This commit is contained in:
Lioncash 2016-09-30 08:26:16 -04:00
parent 025dce86d5
commit 91bbe56f59
1 changed files with 9 additions and 3 deletions

View File

@ -3,6 +3,9 @@
// Refer to the license.txt file included.
#include "Core/PowerPC/Interpreter/Interpreter.h"
#include <cstring>
#include "Common/Assert.h"
#include "Common/CommonTypes.h"
#include "Common/FPURoundMode.h"
@ -216,8 +219,11 @@ void Interpreter::mfspr(UGeckoInstruction _inst)
case SPR_TL:
case SPR_TU:
*((u64*)&TL) =
SystemTimers::GetFakeTimeBase(); // works since we are little endian and TL comes first :)
{
// works since we are little endian and TL comes first :)
const u64 time_base = SystemTimers::GetFakeTimeBase();
std::memcpy(&TL, &time_base, sizeof(u64));
}
break;
case SPR_WPAR: