diff options
| author | Lioncash <mathew1800@gmail.com> | 2017-03-04 19:05:08 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2017-03-04 19:06:22 -0500 |
| commit | 1ebd2cd7c389723d9935e2eb6e84a84c9aa93a39 (patch) | |
| tree | 78297bf90b525f616e6f55a849d1081c67688777 /Source/Core/Common | |
| parent | 7304cb0f8eb55169f7f601444a1733020fd96e15 (diff) | |
SysConf: Get rid of pointer casts
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/SysConf.h | 6 |
1 files 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 <class T> 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; } |
