mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-28 16:24:27 +02:00
Code enhancement: fix GCC implicit-fallthrough warnings
Fix #13142, close #13143
This commit is contained in:
parent
9627494043
commit
278f694f3a
@ -326,6 +326,7 @@ intptr_t CALLBACK RegExtDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// break; // no break here
|
// break; // no break here
|
||||||
|
[[fallthrough]];
|
||||||
}
|
}
|
||||||
|
|
||||||
default :
|
default :
|
||||||
|
@ -1422,6 +1422,7 @@ void Notepad_plus::wsTabConvert(spaceTab whichWay)
|
|||||||
{
|
{
|
||||||
onlyLeading = true;
|
onlyLeading = true;
|
||||||
}
|
}
|
||||||
|
[[fallthrough]];
|
||||||
case space2TabAll:
|
case space2TabAll:
|
||||||
{
|
{
|
||||||
bool nextChar = false;
|
bool nextChar = false;
|
||||||
|
@ -1070,6 +1070,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
return nbDocPrimary;
|
return nbDocPrimary;
|
||||||
else if (lParam == SECOND_VIEW)
|
else if (lParam == SECOND_VIEW)
|
||||||
return nbDocSecond;
|
return nbDocSecond;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NPPM_GETOPENFILENAMESPRIMARY:
|
case NPPM_GETOPENFILENAMESPRIMARY:
|
||||||
@ -2345,6 +2347,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
nppParam.endSessionStart(); // ensure
|
nppParam.endSessionStart(); // ensure
|
||||||
nppParam.makeEndSessionCritical(); // set our exit-flag to critical even if the bitmask has not the ENDSESSION_CRITICAL set
|
nppParam.makeEndSessionCritical(); // set our exit-flag to critical even if the bitmask has not the ENDSESSION_CRITICAL set
|
||||||
// do not return 0 here and continue to the Notepad++ standard WM_CLOSE code-part (no verbose GUI there this time!!!)
|
// do not return 0 here and continue to the Notepad++ standard WM_CLOSE code-part (no verbose GUI there this time!!!)
|
||||||
|
[[fallthrough]];
|
||||||
}
|
}
|
||||||
} // case WM_ENDSESSION:
|
} // case WM_ENDSESSION:
|
||||||
|
|
||||||
@ -3290,6 +3293,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
{
|
{
|
||||||
addHotSpot(pView);
|
addHotSpot(pView);
|
||||||
}
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NPPM_INTERNAL_UPDATETEXTZONEPADDING:
|
case NPPM_INTERNAL_UPDATETEXTZONEPADDING:
|
||||||
|
@ -373,8 +373,8 @@ void Notepad_plus::command(int id)
|
|||||||
_pEditView->execute(WM_COPY);
|
_pEditView->execute(WM_COPY);
|
||||||
checkClipboard();
|
checkClipboard();
|
||||||
_pEditView->execute(SCI_SETSEL, curPos, curPos);
|
_pEditView->execute(SCI_SETSEL, curPos, curPos);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IDM_EDIT_COPY_BINARY:
|
case IDM_EDIT_COPY_BINARY:
|
||||||
|
@ -1636,11 +1636,14 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const TCHAR * fil
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case SC_STATUS_BADALLOC:
|
case SC_STATUS_BADALLOC:
|
||||||
|
{
|
||||||
pNativeSpeaker->messageBox("FileTooBigToOpen",
|
pNativeSpeaker->messageBox("FileTooBigToOpen",
|
||||||
_pNotepadPlus->_pEditView->getHSelf(),
|
_pNotepadPlus->_pEditView->getHSelf(),
|
||||||
TEXT("File is too big to be opened by Notepad++"),
|
TEXT("File is too big to be opened by Notepad++"),
|
||||||
TEXT("Exception: File size problem"),
|
TEXT("Exception: File size problem"),
|
||||||
MB_OK | MB_APPLMODAL);
|
MB_OK | MB_APPLMODAL);
|
||||||
|
}
|
||||||
|
[[fallthrough]];
|
||||||
case SC_STATUS_FAILURE:
|
case SC_STATUS_FAILURE:
|
||||||
default:
|
default:
|
||||||
_stprintf_s(szException, _countof(szException), TEXT("%d (Scintilla)"), sciStatus);
|
_stprintf_s(szException, _countof(szException), TEXT("%d (Scintilla)"), sciStatus);
|
||||||
|
@ -147,6 +147,7 @@ int Searching::convertExtendedToString(const TCHAR * query, TCHAR * result, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//not enough chars to make parameter, use default method as fallback
|
//not enough chars to make parameter, use default method as fallback
|
||||||
|
[[fallthrough]];
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -1799,7 +1800,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||||||
nppParamInst._isFindReplacing = false;
|
nppParamInst._isFindReplacing = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
case IDC_REPLACE_OPENEDFILES :
|
case IDC_REPLACE_OPENEDFILES :
|
||||||
{
|
{
|
||||||
@ -5126,6 +5127,7 @@ intptr_t CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
// otherwise, repeat the search
|
// otherwise, repeat the search
|
||||||
|
[[fallthrough]];
|
||||||
case IDM_SEARCH_FINDPREV: // Accel table: find prev
|
case IDM_SEARCH_FINDPREV: // Accel table: find prev
|
||||||
case IDM_SEARCH_FINDNEXT: // Accel table: find next
|
case IDM_SEARCH_FINDNEXT: // Accel table: find next
|
||||||
case IDC_INCFINDPREVOK:
|
case IDC_INCFINDPREVOK:
|
||||||
@ -5158,6 +5160,7 @@ intptr_t CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// treat other edit notifications as unhandled
|
// treat other edit notifications as unhandled
|
||||||
|
[[fallthrough]];
|
||||||
default:
|
default:
|
||||||
return DefWindowProc(getHSelf(), message, wParam, lParam);
|
return DefWindowProc(getHSelf(), message, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
@ -1543,6 +1543,8 @@ intptr_t CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPA
|
|||||||
}
|
}
|
||||||
::SetScrollPos(_hSelf, SB_VERT, _yScrollPos, TRUE);
|
::SetScrollPos(_hSelf, SB_VERT, _yScrollPos, TRUE);
|
||||||
::ScrollWindow(_hSelf, 0, oldy-_yScrollPos, NULL, NULL);
|
::ScrollWindow(_hSelf, 0, oldy-_yScrollPos, NULL, NULL);
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case NPPM_MODELESSDIALOG :
|
case NPPM_MODELESSDIALOG :
|
||||||
return ::SendMessage(_hParent, NPPM_MODELESSDIALOG, wParam, lParam);
|
return ::SendMessage(_hParent, NPPM_MODELESSDIALOG, wParam, lParam);
|
||||||
|
@ -436,8 +436,10 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default :
|
default :
|
||||||
|
@ -123,6 +123,7 @@ intptr_t CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPar
|
|||||||
default :
|
default :
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_DESTROY :
|
case WM_DESTROY :
|
||||||
@ -390,6 +391,7 @@ intptr_t CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
@ -538,6 +540,7 @@ intptr_t CALLBACK DoSaveOrNotBox::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -644,6 +647,7 @@ intptr_t CALLBACK DoSaveAllBox::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -162,6 +162,7 @@ intptr_t CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// *** FALL THROUGH ***
|
// *** FALL THROUGH ***
|
||||||
|
[[fallthrough]];
|
||||||
case ODA_SELECT:
|
case ODA_SELECT:
|
||||||
rc = pdis->rcItem;
|
rc = pdis->rcItem;
|
||||||
if (pdis->itemState & ODS_SELECTED)
|
if (pdis->itemState & ODS_SELECTED)
|
||||||
@ -250,12 +251,13 @@ intptr_t CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
|
|||||||
::SendMessage(_hParent, WM_PICKUP_COLOR, _colour, 0);
|
::SendMessage(_hParent, WM_PICKUP_COLOR, _colour, 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
default :
|
default :
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_ACTIVATE :
|
case WM_ACTIVATE :
|
||||||
{
|
{
|
||||||
if (LOWORD(wParam) == WA_INACTIVE)
|
if (LOWORD(wParam) == WA_INACTIVE)
|
||||||
|
@ -572,7 +572,7 @@ intptr_t CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
|
|||||||
//return TRUE;
|
//return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default :
|
default :
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -582,8 +582,8 @@ intptr_t CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
|
|||||||
|
|
||||||
void WordStyleDlg::move2CtrlRight(int ctrlID, HWND handle2Move, int handle2MoveWidth, int handle2MoveHeight)
|
void WordStyleDlg::move2CtrlRight(int ctrlID, HWND handle2Move, int handle2MoveWidth, int handle2MoveHeight)
|
||||||
{
|
{
|
||||||
POINT p;
|
POINT p{};
|
||||||
RECT rc;
|
RECT rc{};
|
||||||
::GetWindowRect(::GetDlgItem(_hSelf, ctrlID), &rc);
|
::GetWindowRect(::GetDlgItem(_hSelf, ctrlID), &rc);
|
||||||
|
|
||||||
p.x = rc.right + NppParameters::getInstance()._dpiManager.scaleX(5);
|
p.x = rc.right + NppParameters::getInstance()._dpiManager.scaleX(5);
|
||||||
|
@ -117,6 +117,7 @@ intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default :
|
default :
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -2202,7 +2202,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
BGHS[SelfIndex].textcolor = RGB(0,0,0);
|
BGHS[SelfIndex].textcolor = RGB(0,0,0);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
int x,y,r,c,t,z;
|
int x,y,r,c,t,z;
|
||||||
x=LOWORD(lParam);
|
x=LOWORD(lParam);
|
||||||
|
@ -1220,6 +1220,7 @@ intptr_t CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case IDC_BABYGRID_FILTER:
|
case IDC_BABYGRID_FILTER:
|
||||||
{
|
{
|
||||||
@ -1229,7 +1230,13 @@ intptr_t CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -1458,6 +1458,8 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||||||
delete _pLinkColorPicker;
|
delete _pLinkColorPicker;
|
||||||
delete _pHotEdgeColorPicker;
|
delete _pHotEdgeColorPicker;
|
||||||
delete _pDisabledEdgeColorPicker;
|
delete _pDisabledEdgeColorPicker;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
@ -1471,6 +1473,7 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||||||
{
|
{
|
||||||
NppDarkMode::handleSettingChange(nullptr, 0, true);
|
NppDarkMode::handleSettingChange(nullptr, 0, true);
|
||||||
}
|
}
|
||||||
|
[[fallthrough]];
|
||||||
case IDC_RADIO_DARKMODE_LIGHTMODE:
|
case IDC_RADIO_DARKMODE_LIGHTMODE:
|
||||||
case IDC_RADIO_DARKMODE_DARKMODE:
|
case IDC_RADIO_DARKMODE_DARKMODE:
|
||||||
{
|
{
|
||||||
@ -2377,6 +2380,8 @@ intptr_t CALLBACK NewDocumentSubDlg::run_dlgProc(UINT message, WPARAM wParam, LP
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_SETCURSEL, j, 0);
|
::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_SETCURSEL, j, 0);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_CTLCOLORLISTBOX:
|
case WM_CTLCOLORLISTBOX:
|
||||||
@ -2531,6 +2536,8 @@ intptr_t CALLBACK DefaultDirectorySubDlg::run_dlgProc(UINT message, WPARAM wPara
|
|||||||
::EnableWindow(::GetDlgItem(_hSelf, IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON), shouldActivated);
|
::EnableWindow(::GetDlgItem(_hSelf, IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON), shouldActivated);
|
||||||
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_OPENSAVEDIR_CHECK_DRROPFOLDEROPENFILES, BM_SETCHECK, nppGUI._isFolderDroppedOpenFiles ? BST_CHECKED : BST_UNCHECKED, 0);
|
::SendDlgItemMessage(_hSelf, IDC_OPENSAVEDIR_CHECK_DRROPFOLDEROPENFILES, BM_SETCHECK, nppGUI._isFolderDroppedOpenFiles ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_CTLCOLOREDIT:
|
case WM_CTLCOLOREDIT:
|
||||||
@ -2662,6 +2669,8 @@ intptr_t CALLBACK RecentFilesHistorySubDlg::run_dlgProc(UINT message, WPARAM wPa
|
|||||||
::SetDlgItemInt(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC, length, FALSE);
|
::SetDlgItemInt(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC, length, FALSE);
|
||||||
_customLenVal.init(_hInst, _hSelf);
|
_customLenVal.init(_hInst, _hSelf);
|
||||||
_customLenVal.create(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), nullptr);
|
_customLenVal.create(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), nullptr);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_CTLCOLORDLG:
|
case WM_CTLCOLORDLG:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user