engine: fixup endianness found by -Werror=strict-aliasing in old armv7hf compiler (d259421111289af3b49c055150e02213f39075a6)

This commit is contained in:
Alibek Omarov 2023-10-22 18:41:44 +03:00
parent b9ca0d4563
commit 3ac8ad9484
3 changed files with 7 additions and 2 deletions

View File

@ -2247,11 +2247,13 @@ void CL_ReadNetMessage( void )
while( CL_GetMessage( net_message_buffer, &curSize ))
{
const int split_header = 0xFFFFFFFE;
const int split_header = LittleLong( 0xFFFFFFFE );
if( cls.legacymode && !memcmp( &split_header, net_message_buffer, sizeof( split_header )))
{
// Will rewrite existing packet by merged
if( !NetSplit_GetLong( &cls.netchan.netsplit, &net_from, net_message_buffer, &curSize ) )
continue;
}
MSG_Init( &net_message, "ServerData", net_message_buffer, curSize );

View File

@ -1535,6 +1535,7 @@ void CL_SendConsistencyInfo( sizebuf_t *msg )
case force_exactfile:
MD5_HashFile( md5, filename, NULL );
memcpy( &pc->value, md5, sizeof( pc->value ));
LittleLongSW( pc->value );
if( user_changed_diskfile )
MSG_WriteUBitLong( msg, 0, 32 );

View File

@ -121,8 +121,10 @@ void SV_ParseConsistencyResponse( sv_client_t *cl, sizebuf_t *msg )
{
value = MSG_ReadUBitLong( msg, 32 );
LittleLongSW( value );
// will be compare only first 4 bytes
if( memcmp( &value , r->rgucMD5_hash, 4 ))
if( memcmp( &value, r->rgucMD5_hash, 4 ))
badresindex = idx + 1;
}
else