Browse Source

engine: try to avoid broken -Werror=duplicated-branches for old GCCs 2

pull/2/head
Alibek Omarov 4 years ago committed by GitHub
parent
commit
23974d24c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      engine/common/net_encode.c

7
engine/common/net_encode.c

@ -1145,10 +1145,17 @@ qboolean Delta_WriteField( sizebuf_t *msg, delta_t *pField, void *from, void *to
} }
else if( pField->flags & DT_INTEGER ) else if( pField->flags & DT_INTEGER )
{ {
#if defined __GNUC__ && __GNUC_MAJOR < 9 && !defined __clang__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wduplicated-branches"
#endif
if( bSigned ) if( bSigned )
iValue = *(int32_t *)((int8_t *)to + pField->offset ); iValue = *(int32_t *)((int8_t *)to + pField->offset );
else else
iValue = *(uint32_t *)((int8_t *)to + pField->offset ); iValue = *(uint32_t *)((int8_t *)to + pField->offset );
#if defined __GNUC__ && __GNUC_MAJOR < 9 && !defined __clang__
#pragma GCC diagnostic pop
#endif
iValue = Delta_ClampIntegerField( pField, iValue, bSigned, pField->bits ); iValue = Delta_ClampIntegerField( pField, iValue, bSigned, pField->bits );
if( pField->multiplier != 1.0f ) iValue *= pField->multiplier; if( pField->multiplier != 1.0f ) iValue *= pField->multiplier;
MSG_WriteBitLong( msg, iValue, pField->bits, bSigned ); MSG_WriteBitLong( msg, iValue, pField->bits, bSigned );

Loading…
Cancel
Save