From 1ebd2cd7c389723d9935e2eb6e84a84c9aa93a39 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 4 Mar 2017 19:05:08 -0500 Subject: [PATCH] SysConf: Get rid of pointer casts --- Source/Core/Common/SysConf.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/SysConf.h b/Source/Core/Common/SysConf.h index 271e5a0df2..28af700b36 100644 --- a/Source/Core/Common/SysConf.h +++ b/Source/Core/Common/SysConf.h @@ -55,7 +55,9 @@ struct SSysConfEntry template T GetData() { - return *(T*)data.data(); + T extracted_data; + std::memcpy(&extracted_data, data.data(), sizeof(T)); + return extracted_data; } bool GetArrayData(u8* dest, u16 destSize) { @@ -169,7 +171,7 @@ public: return false; } - *(T*)index->data.data() = newValue; + std::memcpy(index->data.data(), &newValue, sizeof(T)); return true; }