SysConf: Get rid of pointer casts

This commit is contained in:
Lioncash 2017-03-04 19:05:08 -05:00
parent 7304cb0f8e
commit 1ebd2cd7c3
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}