@@ -4708,7 +4708,7 @@ static void FindReplaceSetFont(HWND hwnd, bool monospaced, HFONT *hFontFindRepla
47084708 }
47094709}
47104710
4711- static bool CopySelectionAsFindText (HWND hwnd, LPEDITFINDREPLACE lpefr, bool bFirstTime) noexcept {
4711+ static bool CopySelectionAsFindText (HWND hwnd, EDITFINDREPLACE * lpefr, bool bFirstTime) noexcept {
47124712 const Sci_Position cchSelection = SciCall_GetSelTextLength ();
47134713 char *lpszSelection = nullptr ;
47144714
@@ -4778,7 +4778,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
47784778 // Load MRUs
47794779 MRU_AddToCombobox (&mruFind, hwndFind);
47804780
4781- LPEDITFINDREPLACE lpefr = ( LPEDITFINDREPLACE ) lParam;
4781+ EDITFINDREPLACE * const lpefr = reinterpret_cast < EDITFINDREPLACE *>( lParam) ;
47824782 // don't copy selection after toggle find & replace on this window.
47834783 bool hasFindText = false ;
47844784 if (bSwitchedFindReplace != 3 ) {
@@ -4882,7 +4882,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
48824882 case APPM_COPYDATA : {
48834883 HWND hwndFind = GetDlgItem (hwnd, IDC_FINDTEXT );
48844884 HWND hwndRepl = GetDlgItem (hwnd, IDC_REPLACETEXT );
4885- LPEDITFINDREPLACE lpefr = ( LPEDITFINDREPLACE ) GetWindowLongPtr (hwnd, DWLP_USER );
4885+ EDITFINDREPLACE * const lpefr = reinterpret_cast < EDITFINDREPLACE *>( GetWindowLongPtr (hwnd, DWLP_USER ) );
48864886
48874887 const bool hasFindText = CopySelectionAsFindText (hwnd, lpefr, false );
48884888 if (!GetWindowTextLength (hwndFind)) {
@@ -4989,7 +4989,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
49894989 case IDC_REPLACEINSEL :
49904990 case IDACC_SELTONEXT :
49914991 case IDACC_SELTOPREV : {
4992- LPEDITFINDREPLACE lpefr = ( LPEDITFINDREPLACE ) GetWindowLongPtr (hwnd, DWLP_USER );
4992+ EDITFINDREPLACE * const lpefr = reinterpret_cast < EDITFINDREPLACE *>( GetWindowLongPtr (hwnd, DWLP_USER ) );
49934993 HWND hwndFind = GetDlgItem (hwnd, IDC_FINDTEXT );
49944994 HWND hwndRepl = GetDlgItem (hwnd, IDC_REPLACETEXT );
49954995 const bool bIsFindDlg = (hwndRepl == nullptr );
@@ -5152,7 +5152,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
51525152
51535153 case IDACC_SAVEFIND : {
51545154 SendWMCommand (hwndMain, IDM_EDIT_SAVEFIND );
5155- LPCEDITFINDREPLACE lpefr = ( LPCEDITFINDREPLACE ) GetWindowLongPtr (hwnd, DWLP_USER );
5155+ const EDITFINDREPLACE * const lpefr = reinterpret_cast < const EDITFINDREPLACE *>( GetWindowLongPtr (hwnd, DWLP_USER ) );
51565156 SetDlgItemTextA2W (CP_UTF8 , hwnd, IDC_FINDTEXT , lpefr->szFindUTF8 );
51575157 CheckDlgButton (hwnd, IDC_FINDREGEXP , BST_UNCHECKED );
51585158 CheckDlgButton (hwnd, IDC_FINDTRANSFORMBS , BST_UNCHECKED );
@@ -5162,7 +5162,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
51625162
51635163 case IDC_TOGGLEFINDREPLACE : {
51645164 bSwitchedFindReplace |= 2 ;
5165- LPEDITFINDREPLACE lpefr = ( LPEDITFINDREPLACE ) GetWindowLongPtr (hwnd, DWLP_USER );
5165+ EDITFINDREPLACE * const lpefr = reinterpret_cast < EDITFINDREPLACE *>( GetWindowLongPtr (hwnd, DWLP_USER ) );
51665166 GetDlgPos (hwnd, &xFindReplaceDlgSave, &yFindReplaceDlgSave);
51675167 memcpy (&efrSave, lpefr, sizeof (EDITFINDREPLACE ));
51685168 GetDlgItemTextA2W (CP_UTF8 , hwnd, IDC_FINDTEXT , lpefr->szFindUTF8 , COUNTOF (lpefr->szFindUTF8 ));
@@ -5246,7 +5246,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
52465246//
52475247// EditFindReplaceDlg()
52485248//
5249- HWND EditFindReplaceDlg (HWND hwnd, LPEDITFINDREPLACE lpefr, bool bReplace) noexcept {
5249+ HWND EditFindReplaceDlg (HWND hwnd, EDITFINDREPLACE * lpefr, bool bReplace) noexcept {
52505250 lpefr->hwnd = hwnd;
52515251 HWND hDlg = CreateThemedDialogParam (g_hInstance,
52525252 (bReplace) ? MAKEINTRESOURCE (IDD_REPLACE ) : MAKEINTRESOURCE (IDD_FIND ),
@@ -5285,7 +5285,7 @@ static void EscapeWildcards(char *szFind2) noexcept {
52855285 strncpy (szFind2, szWildcardEscaped, COUNTOF (szWildcardEscaped));
52865286}
52875287
5288- int EditPrepareFind (char *szFind2, LPCEDITFINDREPLACE lpefr) noexcept {
5288+ int EditPrepareFind (char *szFind2, const EDITFINDREPLACE * lpefr) noexcept {
52895289 if (StrIsEmpty (lpefr->szFind )) {
52905290 return NP2_InvalidSearchFlags;
52915291 }
@@ -5311,7 +5311,7 @@ int EditPrepareFind(char *szFind2, LPCEDITFINDREPLACE lpefr) noexcept {
53115311 return searchFlags;
53125312}
53135313
5314- int EditPrepareReplace (HWND hwnd, char *szFind2, char **pszReplace2, BOOL *bReplaceRE, LPCEDITFINDREPLACE lpefr) noexcept {
5314+ int EditPrepareReplace (HWND hwnd, char *szFind2, char **pszReplace2, BOOL *bReplaceRE, const EDITFINDREPLACE * lpefr) noexcept {
53155315 const int searchFlags = EditPrepareFind (szFind2, lpefr);
53165316 if (searchFlags == NP2_InvalidSearchFlags) {
53175317 return searchFlags;
@@ -5339,7 +5339,7 @@ int EditPrepareReplace(HWND hwnd, char *szFind2, char **pszReplace2, BOOL *bRepl
53395339//
53405340// EditFindNext()
53415341//
5342- void EditFindNext (LPCEDITFINDREPLACE lpefr, bool fExtendSelection ) noexcept {
5342+ void EditFindNext (const EDITFINDREPLACE * lpefr, bool fExtendSelection ) noexcept {
53435343 char szFind2[NP2_FIND_REPLACE_LIMIT ];
53445344 const int searchFlags = EditPrepareFind (szFind2, lpefr);
53455345 if (searchFlags == NP2_InvalidSearchFlags) {
@@ -5381,7 +5381,7 @@ void EditFindNext(LPCEDITFINDREPLACE lpefr, bool fExtendSelection) noexcept {
53815381//
53825382// EditFindPrev()
53835383//
5384- void EditFindPrev (LPCEDITFINDREPLACE lpefr, bool fExtendSelection ) noexcept {
5384+ void EditFindPrev (const EDITFINDREPLACE * lpefr, bool fExtendSelection ) noexcept {
53855385 char szFind2[NP2_FIND_REPLACE_LIMIT ];
53865386 const int searchFlags = EditPrepareFind (szFind2, lpefr);
53875387 if (searchFlags == NP2_InvalidSearchFlags) {
@@ -5423,7 +5423,7 @@ void EditFindPrev(LPCEDITFINDREPLACE lpefr, bool fExtendSelection) noexcept {
54235423//
54245424// EditReplace()
54255425//
5426- bool EditReplace (HWND hwnd, LPCEDITFINDREPLACE lpefr) noexcept {
5426+ bool EditReplace (HWND hwnd, const EDITFINDREPLACE * lpefr) noexcept {
54275427 BOOL bReplaceRE;
54285428 char szFind2[NP2_FIND_REPLACE_LIMIT ];
54295429 char *pszReplace2;
@@ -5756,7 +5756,7 @@ void EditMarkAll(BOOL bChanged, bool matchCase, bool wholeWord, bool bookmark) {
57565756 EditMarkAll_Start (bChanged, findFlag, iSelCount, pszText);
57575757}
57585758
5759- void EditFindAll (LPCEDITFINDREPLACE lpefr, bool selectAll) {
5759+ void EditFindAll (const EDITFINDREPLACE * lpefr, bool selectAll) {
57605760 char *szFind2 = (char *)NP2HeapAlloc (NP2_FIND_REPLACE_LIMIT );
57615761 int searchFlags = EditPrepareFind (szFind2, lpefr);
57625762 if (searchFlags == NP2_InvalidSearchFlags) {
@@ -5828,7 +5828,7 @@ static void ShwowReplaceCount(Sci_Position iCount) noexcept {
58285828//
58295829// EditReplaceAll()
58305830//
5831- bool EditReplaceAll (HWND hwnd, LPCEDITFINDREPLACE lpefr, bool bShowInfo) noexcept {
5831+ bool EditReplaceAll (HWND hwnd, const EDITFINDREPLACE * lpefr, bool bShowInfo) noexcept {
58325832 BOOL bReplaceRE;
58335833 char szFind2[NP2_FIND_REPLACE_LIMIT ];
58345834 char *pszReplace2;
@@ -5908,7 +5908,7 @@ bool EditReplaceAll(HWND hwnd, LPCEDITFINDREPLACE lpefr, bool bShowInfo) noexcep
59085908//
59095909// EditReplaceAllInSelection()
59105910//
5911- bool EditReplaceAllInSelection (HWND hwnd, LPCEDITFINDREPLACE lpefr, bool bShowInfo) noexcept {
5911+ bool EditReplaceAllInSelection (HWND hwnd, const EDITFINDREPLACE * lpefr, bool bShowInfo) noexcept {
59125912 if (SciCall_IsRectangleSelection ()) {
59135913 NotifyRectangleSelection ();
59145914 return false ;
@@ -6740,8 +6740,7 @@ void EditInsertUnicodeControlCharacter(int menu) noexcept {
67406740}
67416741
67426742void EditShowUnicodeControlCharacter (bool bShow) noexcept {
6743- for (UINT i = 0 ; i < COUNTOF (kUnicodeControlCharacterTable ); i++) {
6744- const UnicodeControlCharacter ucc = kUnicodeControlCharacterTable [i];
6743+ for (const auto ucc : kUnicodeControlCharacterTable ) {
67456744 if (StrIsEmpty (ucc.representation )) {
67466745 // built-in
67476746 continue ;
@@ -7036,7 +7035,7 @@ char *EditGetStringAroundCaret(LPCSTR delimiters) noexcept {
70367035 }
70377036
70387037 Sci_TextToFindFull ft = { { iCurrentPos, 0 }, delimiters, { 0 , 0 } };
7039- const int findFlag = NP2_RegexDefaultFlags;
7038+ constexpr int findFlag = NP2_RegexDefaultFlags;
70407039
70417040 // forward
70427041 if (iCurrentPos < iLineEnd) {
0 commit comments