From 2630752ffea63ecc1ddffa8a4fc18ec63bae22bc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 22 Oct 2015 15:32:11 -0400 Subject: [PATCH] Arm64Emitter: Get rid of a pointer cast --- Source/Core/Common/Arm64Emitter.cpp | 7 +++++++ Source/Core/Common/Arm64Emitter.h | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Core/Common/Arm64Emitter.cpp b/Source/Core/Common/Arm64Emitter.cpp index 1c173731cf..6546686716 100644 --- a/Source/Core/Common/Arm64Emitter.cpp +++ b/Source/Core/Common/Arm64Emitter.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include #include "Common/Arm64Emitter.h" @@ -312,6 +313,12 @@ const u8* ARM64XEmitter::AlignCodePage() return m_code; } +void ARM64XEmitter::Write32(u32 value) +{ + std::memcpy(m_code, &value, sizeof(u32)); + m_code += sizeof(u32); +} + void ARM64XEmitter::FlushIcache() { FlushIcacheSection(m_lastCacheFlushEnd, m_code); diff --git a/Source/Core/Common/Arm64Emitter.h b/Source/Core/Common/Arm64Emitter.h index 5cb353f640..400a87a624 100644 --- a/Source/Core/Common/Arm64Emitter.h +++ b/Source/Core/Common/Arm64Emitter.h @@ -359,11 +359,7 @@ private: void EncodeLoadStoreUnscaled(u32 size, u32 op, ARM64Reg Rt, ARM64Reg Rn, s32 imm); protected: - inline void Write32(u32 value) - { - *(u32*)m_code = value; - m_code += 4; - } + void Write32(u32 value); public: ARM64XEmitter()