CWE-478: Addition of missing default case in the Switch statement

This commit is contained in:
Markus Gans 2020-04-17 10:53:47 +02:00
parent defc1714e4
commit 6de04a3edd
12 changed files with 32 additions and 0 deletions

View File

@ -275,6 +275,7 @@ std::size_t FLabel::getAlignOffset (const std::size_t length)
switch ( alignment )
{
case fc::alignLeft:
default:
return 0;
case fc::alignCenter:

View File

@ -635,6 +635,7 @@ void FLineEdit::adjustLabel()
break;
case label_left:
default:
label->setGeometry ( FPoint(w->getX() - int(label_width) - 1, w->getY())
, FSize(label_width, 1) );
break;
@ -749,6 +750,7 @@ void FLineEdit::drawInputField()
switch ( input_type )
{
case FLineEdit::textfield:
default:
return printTextField();
case FLineEdit::password:
@ -818,6 +820,7 @@ inline std::size_t FLineEdit::getCursorColumnPos()
switch ( input_type )
{
case FLineEdit::textfield:
default:
return getColumnWidth (print_text, cursor_pos);
case FLineEdit::password:

View File

@ -1758,6 +1758,7 @@ void FListBox::cb_vbarChange (const FWidget*, const FDataPtr)
switch ( scrollType )
{
case FScrollbar::noScroll:
default:
break;
case FScrollbar::scrollPageBackward:
@ -1821,6 +1822,7 @@ void FListBox::cb_hbarChange (const FWidget*, const FDataPtr)
switch ( scrollType )
{
case FScrollbar::noScroll:
default:
break;
case FScrollbar::scrollPageBackward:

View File

@ -1018,6 +1018,7 @@ void FListView::sort()
{
case fc::unknown:
case fc::by_name:
default:
if ( sort_order == fc::ascending )
{
sort (sortAscendingByName);
@ -1586,6 +1587,7 @@ std::size_t FListView::getAlignOffset ( const fc::text_alignment align
switch ( align )
{
case fc::alignLeft:
default:
return 0;
case fc::alignCenter:
@ -2857,6 +2859,7 @@ void FListView::cb_vbarChange (const FWidget*, const FDataPtr)
switch ( scrollType )
{
case FScrollbar::noScroll:
default:
break;
case FScrollbar::scrollPageBackward:
@ -2916,6 +2919,7 @@ void FListView::cb_hbarChange (const FWidget*, const FDataPtr)
switch ( scrollType )
{
case FScrollbar::noScroll:
default:
break;
case FScrollbar::scrollPageBackward:

View File

@ -672,6 +672,7 @@ void FMenuItem::passMouseEvent ( T widget, const FMouseEvent* ev
break;
case fc::MouseMove_Event:
default:
widget->onMouseMove(_ev.get());
break;
}

View File

@ -183,6 +183,7 @@ inline FMouse* FMouse::createMouseObject (const mouse_type mt)
switch ( mt )
{
case none:
default:
return nullptr;
case gpm:

View File

@ -793,6 +793,7 @@ void FScrollView::setHorizontalScrollBarVisibility()
switch ( h_mode )
{
case fc::Auto:
default:
if ( getScrollWidth() > getViewportWidth() )
hbar->show();
else
@ -815,6 +816,7 @@ void FScrollView::setVerticalScrollBarVisibility()
switch ( v_mode )
{
case fc::Auto:
default:
if ( getScrollHeight() > getViewportHeight() )
vbar->show();
else
@ -870,6 +872,7 @@ void FScrollView::cb_vbarChange (const FWidget*, const FDataPtr)
switch ( scrollType )
{
case FScrollbar::noScroll:
default:
break;
case FScrollbar::scrollPageBackward:
@ -921,6 +924,7 @@ void FScrollView::cb_hbarChange (const FWidget*, const FDataPtr)
switch ( scrollType )
{
case FScrollbar::noScroll:
default:
break;
case FScrollbar::scrollPageBackward:

View File

@ -294,6 +294,7 @@ void FSpinBox::onTimer (FTimerEvent*)
break;
case FSpinBox::noSpin:
default:
break;
}
}

View File

@ -1090,6 +1090,7 @@ void FTerm::setEncoding (fc::encoding enc)
case fc::ASCII:
case fc::UNKNOWN:
case fc::NUM_OF_ENCODINGS:
default:
putchar() = &FTerm::putchar_ASCII;
}
@ -2553,6 +2554,10 @@ void FTerm::signal_handler (int signum)
<< signum
<< " (" << strsignal(signum) << ")" << std::endl;
std::terminate();
break;
default:
break;
}
}

View File

@ -758,6 +758,7 @@ void FTextView::cb_vbarChange (const FWidget*, const FDataPtr)
switch ( scrollType )
{
case FScrollbar::noScroll:
default:
break;
case FScrollbar::scrollPageBackward:
@ -809,6 +810,7 @@ void FTextView::cb_hbarChange (const FWidget*, const FDataPtr)
switch ( scrollType )
{
case FScrollbar::noScroll:
default:
break;
case FScrollbar::scrollPageBackward:

View File

@ -159,6 +159,7 @@ void FVTerm::setTerminalUpdates (terminal_update refresh_state)
case continue_terminal_updates:
case start_terminal_updates:
default:
no_terminal_updates = false;
}

View File

@ -235,6 +235,7 @@ std::vector<bool>& FWidget::doubleFlatLine_ref (fc::sides side)
return double_flatline_mask.bottom;
case fc::left:
default:
return double_flatline_mask.left;
}
@ -665,6 +666,9 @@ void FWidget::setDoubleFlatLine (fc::sides side, bool bit)
length = double_flatline_mask.left.size();
double_flatline_mask.left.assign(length, bit);
break;
default:
break;
}
}
@ -714,6 +718,9 @@ void FWidget::setDoubleFlatLine (fc::sides side, int pos, bool bit)
double_flatline_mask.left[index] = bit;
break;
default:
break;
}
}