SysConf: Get rid of pointer casts
This commit is contained in:
parent
7304cb0f8e
commit
1ebd2cd7c3
|
@ -55,7 +55,9 @@ struct SSysConfEntry
|
||||||
template <class T>
|
template <class T>
|
||||||
T GetData()
|
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)
|
bool GetArrayData(u8* dest, u16 destSize)
|
||||||
{
|
{
|
||||||
|
@ -169,7 +171,7 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(T*)index->data.data() = newValue;
|
std::memcpy(index->data.data(), &newValue, sizeof(T));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue