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) ); (mid <= end) );
if( (mid != start) && (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; break;
} }
// Intentionally fall through to SPLITMETHOD::EQUAL_COUNTS since prims
// with large overlapping bounding boxes may fail to partition
case SPLITMETHOD::EQUALCOUNTS: case SPLITMETHOD::EQUALCOUNTS:
{ {
// Partition primitives into equally-sized subsets // Partition primitives into equally-sized subsets

View File

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

View File

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

View File

@ -358,7 +358,7 @@ void LIB_TREE::onQueryCharHook( wxKeyEvent& aKeyStroke )
toggleExpand( sel ); toggleExpand( sel );
break; 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: default:
aKeyStroke.Skip(); // Any other key: pass on to search box directly. 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 // Extract the current search patten when needed
m_currentSearchPattern = m_tcFilterString->GetValue(); 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::UNFILTERED_FP_LIST:
case FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT: case FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT:
case FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY: 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 ) if( net_item->GetNet() != 0 )
break; break;
// Intentionally fall through if there is no net assigned
case NET_SEGMENT: case NET_SEGMENT:
// Test connections point to point type without bus. // Test connections point to point type without bus.
if( net_item->GetNet() == 0 ) if( net_item->GetNet() == 0 )
@ -162,6 +164,8 @@ bool NETLIST_OBJECT_LIST::BuildNetListInfo( SCH_SHEET_LIST& aSheets )
if( net_item->m_BusNetCode != 0 ) if( net_item->m_BusNetCode != 0 )
break; break;
// Intentionally fall through if there is no bus assigned
case NET_BUS: case NET_BUS:
// Control type connections point to point mode bus // Control type connections point to point mode bus
if( net_item->m_BusNetCode == 0 ) 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 ) if( result == SEARCH_RESULT::QUIT )
break; 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: case PCB_MODULE_EDGE_T:
result = IterateForward<BOARD_ITEM*>( m_drawings, inspector, testData, p ); 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] ) if( padlayers_mask[B_Paste] || padlayers_mask[F_Paste] )
error_msgs.Add( _( "Error: Connector pads are not on the solder paste layer\n" error_msgs.Add( _( "Error: Connector pads are not on the solder paste layer\n"
"Use SMD pads instead" ) ); "Use SMD pads instead" ) );
// Fall trough // Intentionally fall through
case PAD_ATTRIB_SMD: // SMD and Connector pads (One external copper layer only) case PAD_ATTRIB_SMD: // SMD and Connector pads (One external copper layer only)
{ {
LSET innerlayers_mask = padlayers_mask & LSET::InternalCuMask(); 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_dx = 0;
pad_dy = 0; pad_dy = 0;
// Intentionally fall through and treat a rectangle as a trapezoid with no sloped sides
case PAD_SHAPE_TRAPEZOID: case PAD_SHAPE_TRAPEZOID:
{ {
double coord[8] = double coord[8] =

View File

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