Browse Source

wscript: remove duplicated branches diagnostic for good

pull/2/head
Alibek Omarov 3 years ago
parent
commit
f9d0fba05f
  1. 21
      engine/common/net_encode.c
  2. 1
      wscript

21
engine/common/net_encode.c

@ -980,10 +980,6 @@ qboolean Delta_CompareField( delta_t *pField, void *from, void *to, double timeb
} }
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( pField->flags & DT_SIGNED ) if( pField->flags & DT_SIGNED )
{ {
fromF = *(int *)((byte *)from + pField->offset ); fromF = *(int *)((byte *)from + pField->offset );
@ -994,9 +990,6 @@ qboolean Delta_CompareField( delta_t *pField, void *from, void *to, double timeb
fromF = *(uint *)((byte *)from + pField->offset ); fromF = *(uint *)((byte *)from + pField->offset );
toF = *(uint *)((byte *)to + pField->offset ); toF = *(uint *)((byte *)to + pField->offset );
} }
#if defined __GNUC__ && __GNUC_MAJOR < 9 && !defined __clang__
#pragma GCC diagnostic pop
#endif
fromF = Delta_ClampIntegerField( pField, fromF, bSigned, pField->bits ); fromF = Delta_ClampIntegerField( pField, fromF, bSigned, pField->bits );
toF = Delta_ClampIntegerField( pField, toF, bSigned, pField->bits ); toF = Delta_ClampIntegerField( pField, toF, bSigned, pField->bits );
if( !Q_equal( pField->multiplier, 1.0 ) ) if( !Q_equal( pField->multiplier, 1.0 ) )
@ -1161,17 +1154,10 @@ 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( !Q_equal( pField->multiplier, 1.0 ) ) if( !Q_equal( pField->multiplier, 1.0 ) )
@ -1281,10 +1267,6 @@ qboolean Delta_ReadField( 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( bChanged ) if( bChanged )
{ {
iValue = MSG_ReadBitLong( msg, pField->bits, bSigned ); iValue = MSG_ReadBitLong( msg, pField->bits, bSigned );
@ -1302,9 +1284,6 @@ qboolean Delta_ReadField( sizebuf_t *msg, delta_t *pField, void *from, void *to,
*(int32_t *)((uint8_t *)to + pField->offset ) = iValue; *(int32_t *)((uint8_t *)to + pField->offset ) = iValue;
else else
*(uint32_t *)((uint8_t *)to + pField->offset ) = iValue; *(uint32_t *)((uint8_t *)to + pField->offset ) = iValue;
#if defined __GNUC__ && __GNUC_MAJOR < 9 && !defined __clang__
#pragma GCC diagnostic pop
#endif
} }
else if( pField->flags & DT_FLOAT ) else if( pField->flags & DT_FLOAT )
{ {

1
wscript

@ -184,7 +184,6 @@ def configure(conf):
'-Werror=vla', '-Werror=vla',
'-Werror=tautological-compare', '-Werror=tautological-compare',
'-Werror=duplicated-cond', '-Werror=duplicated-cond',
'-Werror=duplicated-branches', # BEWARE: buggy
'-Werror=bool-compare', '-Werror=bool-compare',
'-Werror=bool-operation', '-Werror=bool-operation',
'-Wcast-align', '-Wcast-align',

Loading…
Cancel
Save