mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-20 03:30:18 +00:00
reinterpret_cast-based type-punning is almost always UB
This commit is contained in:
@@ -159,8 +159,7 @@ void RakNet::BitStream::Write<AMFIntValue&>(AMFIntValue& value) {
|
||||
// Writes an AMFDoubleValue to BitStream
|
||||
template<>
|
||||
void RakNet::BitStream::Write<AMFDoubleValue&>(AMFDoubleValue& value) {
|
||||
double d = value.GetValue();
|
||||
WriteAMFU64(*this, *reinterpret_cast<uint64_t*>(&d));
|
||||
WriteAMFU64(*this, std::bit_cast<uint64_t>(value.GetValue()));
|
||||
}
|
||||
|
||||
// Writes an AMFStringValue to BitStream
|
||||
|
||||
Reference in New Issue
Block a user