Browse Source

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

pull/2/head
Alibek Omarov 1 year ago
parent
commit
3ac8ad9484
  1. 4
      engine/client/cl_main.c
  2. 1
      engine/client/cl_parse.c
  3. 4
      engine/server/sv_custom.c

4
engine/client/cl_main.c

@ -2247,11 +2247,13 @@ void CL_ReadNetMessage( void )
while( CL_GetMessage( net_message_buffer, &curSize )) 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 ))) if( cls.legacymode && !memcmp( &split_header, net_message_buffer, sizeof( split_header )))
{
// Will rewrite existing packet by merged // Will rewrite existing packet by merged
if( !NetSplit_GetLong( &cls.netchan.netsplit, &net_from, net_message_buffer, &curSize ) ) if( !NetSplit_GetLong( &cls.netchan.netsplit, &net_from, net_message_buffer, &curSize ) )
continue; continue;
}
MSG_Init( &net_message, "ServerData", net_message_buffer, curSize ); MSG_Init( &net_message, "ServerData", net_message_buffer, curSize );

1
engine/client/cl_parse.c

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

4
engine/server/sv_custom.c

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

Loading…
Cancel
Save