base_units.cpp: better fix for a overzealous gcc compil warning than 4f369801 fix.

(Replaced a useless break by a default case with a debug warning)
This commit is contained in:
jean-pierre charras 2020-04-27 09:23:25 +02:00
parent d2046b17d7
commit 5340046747
1 changed files with 10 additions and 5 deletions

View File

@ -472,6 +472,9 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE
{ {
switch( aType ) switch( aType )
{ {
default:
wxASSERT( 0 );
KI_FALLTHROUGH;
case EDA_DATA_TYPE::DISTANCE: case EDA_DATA_TYPE::DISTANCE:
return _( "mils" ); return _( "mils" );
case EDA_DATA_TYPE::AREA: case EDA_DATA_TYPE::AREA:
@ -484,6 +487,9 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE
{ {
switch( aType ) switch( aType )
{ {
default:
wxASSERT( 0 );
KI_FALLTHROUGH;
case EDA_DATA_TYPE::DISTANCE: case EDA_DATA_TYPE::DISTANCE:
return _( "in" ); return _( "in" );
case EDA_DATA_TYPE::AREA: case EDA_DATA_TYPE::AREA:
@ -492,11 +498,13 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE
return _( "cu. in" ); return _( "cu. in" );
} }
} }
break; // Make compil happy.
case EDA_UNITS::MILLIMETRES: case EDA_UNITS::MILLIMETRES:
switch( aType ) switch( aType )
{ {
default:
wxASSERT( 0 );
KI_FALLTHROUGH;
case EDA_DATA_TYPE::DISTANCE: case EDA_DATA_TYPE::DISTANCE:
return _( "mm" ); return _( "mm" );
case EDA_DATA_TYPE::AREA: case EDA_DATA_TYPE::AREA:
@ -504,7 +512,6 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE
case EDA_DATA_TYPE::VOLUME: case EDA_DATA_TYPE::VOLUME:
return _( "cu. mm" ); return _( "cu. mm" );
} }
break; // Make compil happy.
case EDA_UNITS::PERCENT: case EDA_UNITS::PERCENT:
return _( "%" ); return _( "%" );
@ -516,10 +523,8 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE
return _( "deg" ); return _( "deg" );
default: default:
break;
}
return wxT( "??" ); return wxT( "??" );
}
} }