mirror of
https://github.com/pret/pokeemerald.git
synced 2026-09-27 04:16:47 -05:00
ubfix for strict aliasing violation (#2341)
This commit is contained in:
13
src/link.c
13
src/link.c
@@ -2183,6 +2183,9 @@ static bool8 DoHandshake(void)
|
||||
u8 i;
|
||||
u8 playerCount;
|
||||
u16 minRecv;
|
||||
#ifdef UBFIX
|
||||
u64 recvSiomlt;
|
||||
#endif
|
||||
|
||||
playerCount = 0;
|
||||
minRecv = 0xFFFF;
|
||||
@@ -2194,7 +2197,12 @@ static bool8 DoHandshake(void)
|
||||
{
|
||||
REG_SIOMLT_SEND = SLAVE_HANDSHAKE;
|
||||
}
|
||||
#ifdef UBFIX
|
||||
recvSiomlt = REG_SIOMLT_RECV;
|
||||
memcpy(gLink.handshakeBuffer, &recvSiomlt, sizeof(gLink.handshakeBuffer));
|
||||
#else
|
||||
*(u64 *)gLink.handshakeBuffer = REG_SIOMLT_RECV;
|
||||
#endif
|
||||
REG_SIOMLT_RECV = 0;
|
||||
gLink.handshakeAsMaster = FALSE;
|
||||
for (i = 0; i < MAX_LINK_PLAYERS; i++)
|
||||
@@ -2234,8 +2242,13 @@ static void DoRecv(void)
|
||||
u16 recv[4];
|
||||
u8 i;
|
||||
u8 index;
|
||||
#ifdef UBFIX
|
||||
u64 recvSiomlt = REG_SIOMLT_RECV;
|
||||
|
||||
memcpy(recv, &recvSiomlt, sizeof(recv));
|
||||
#else
|
||||
*(u64 *)recv = REG_SIOMLT_RECV;
|
||||
#endif
|
||||
if (gLink.sendCmdIndex == 0)
|
||||
{
|
||||
for (i = 0; i < gLink.playerCount; i++)
|
||||
|
||||
Reference in New Issue
Block a user