Fix comments for switch statement fall throughs

This cleans up all GCC warnings (-Wimplicit-fallthrough=2) about
implicitly falling through switch cases.
This commit is contained in:
Ian McInerney 2020-01-11 19:16:32 +00:00
parent 4ebb87d1c1
commit f896043067
10 changed files with 17 additions and 9 deletions

View File

@ -555,12 +555,12 @@ BVHBuildNode *CBVH_PBRT::recursiveBuild ( std::vector<BVHPrimitiveInfo> &primiti
(mid <= end) );
if( (mid != start) && (mid != end) )
// for lots of prims with large overlapping bounding boxes, this
// may fail to partition; in that case don't break and fall through
// to SPLITMETHOD::EQUAL_COUNTS
break;
}
// Intentionally fall through to SPLITMETHOD::EQUAL_COUNTS since prims
// with large overlapping bounding boxes may fail to partition
case SPLITMETHOD::EQUALCOUNTS:
{
// Partition primitives into equally-sized subsets

View File

@ -415,7 +415,7 @@ wxString KIwxExpandEnvVars(const wxString& str)
break;
}
//else: fall through
// else fall through
default:
strResult += str_n;

View File

@ -824,7 +824,7 @@ void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize,
case 900:
case 2700: // rotation of 90 degrees or 270 swaps sizes
std::swap( size.x, size.y );
// Pass through
// Intentionally fall through
case 0:
case 1800:
if( trace_mode == SKETCH )

View File

@ -358,7 +358,7 @@ void LIB_TREE::onQueryCharHook( wxKeyEvent& aKeyStroke )
toggleExpand( sel );
break;
}
/* fall through, so the selected component will be treated as the selected one */
// Intentionally fall through, so the selected component will be treated as the selected one
default:
aKeyStroke.Skip(); // Any other key: pass on to search box directly.

View File

@ -566,6 +566,8 @@ void CVPCB_MAINFRAME::SetFootprintFilter(
// Extract the current search patten when needed
m_currentSearchPattern = m_tcFilterString->GetValue();
// Intentionally fall through since this uses the filter options passed in
case FOOTPRINTS_LISTBOX::UNFILTERED_FP_LIST:
case FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT:
case FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY:

View File

@ -114,6 +114,8 @@ bool NETLIST_OBJECT_LIST::BuildNetListInfo( SCH_SHEET_LIST& aSheets )
if( net_item->GetNet() != 0 )
break;
// Intentionally fall through if there is no net assigned
case NET_SEGMENT:
// Test connections point to point type without bus.
if( net_item->GetNet() == 0 )
@ -162,6 +164,8 @@ bool NETLIST_OBJECT_LIST::BuildNetListInfo( SCH_SHEET_LIST& aSheets )
if( net_item->m_BusNetCode != 0 )
break;
// Intentionally fall through if there is no bus assigned
case NET_BUS:
// Control type connections point to point mode bus
if( net_item->m_BusNetCode == 0 )

View File

@ -843,7 +843,7 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T
if( result == SEARCH_RESULT::QUIT )
break;
// m_Drawings can hold TYPETEXTMODULE also, so fall thru
// Intentionally fall through since m_Drawings can hold TYPETEXTMODULE also
case PCB_MODULE_EDGE_T:
result = IterateForward<BOARD_ITEM*>( m_drawings, inspector, testData, p );

View File

@ -1282,7 +1282,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
if( padlayers_mask[B_Paste] || padlayers_mask[F_Paste] )
error_msgs.Add( _( "Error: Connector pads are not on the solder paste layer\n"
"Use SMD pads instead" ) );
// Fall trough
// Intentionally fall through
case PAD_ATTRIB_SMD: // SMD and Connector pads (One external copper layer only)
{
LSET innerlayers_mask = padlayers_mask & LSET::InternalCuMask();

View File

@ -1160,6 +1160,8 @@ static void export_vrml_padshape( MODEL_VRML& aModel, VRML_LAYER* aTinLayer, D_P
pad_dx = 0;
pad_dy = 0;
// Intentionally fall through and treat a rectangle as a trapezoid with no sloped sides
case PAD_SHAPE_TRAPEZOID:
{
double coord[8] =

View File

@ -753,7 +753,7 @@ void GPCB_FPL_CACHE::parseParameters( wxArrayString& aParameterList, LINE_READER
// Element descriptions can span multiple lines.
line = aLineReader->ReadLine();
// Fall through is intentional.
// Intentionally fall through
case '\t':
case ' ':