Skip to content

Commit bc0050b

Browse files
committed
Remove more typedef struct.
1 parent 2f60c22 commit bc0050b

7 files changed

Lines changed: 86 additions & 92 deletions

File tree

matepath/src/Dialogs.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,7 @@ INT_PTR CALLBACK GotoDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
364364
ComboBox_LimitText(hwndGoto, MAX_PATH - 1);
365365
ComboBox_SetExtendedUI(hwndGoto, TRUE);
366366

367-
for (int i = 0; i < HISTORY_ITEMS; i++) {
368-
LPCWSTR path = mHistory.psz[i];
367+
for (LPCWSTR path : mHistory.psz) {
369368
if (path) {
370369
const int iItem = ComboBox_FindStringExact(hwndGoto, -1, path);
371370
if (iItem != CB_ERR) {
@@ -1545,14 +1544,12 @@ bool GetFilterDlg(HWND hwnd) noexcept {
15451544
}
15461545

15471546
// Data structure used in file operation dialogs
1548-
typedef struct FILEOPDLGDATA {
1547+
struct FILEOPDLGDATA {
15491548
WCHAR szSource[MAX_PATH];
15501549
WCHAR szDestination[MAX_PATH];
15511550
LPMRULIST pmru;
15521551
UINT wFunc;
1553-
} FILEOPDLGDATA, *LPFILEOPDLGDATA;
1554-
1555-
typedef const FILEOPDLGDATA * LPCFILEOPDLGDATA;
1552+
};
15561553

15571554
extern int cxRenameFileDlg;
15581555
//=============================================================================
@@ -1565,7 +1562,7 @@ INT_PTR CALLBACK RenameFileDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM l
15651562
case WM_INITDIALOG: {
15661563
SetWindowLongPtr(hwnd, DWLP_USER, lParam);
15671564
ResizeDlg_InitX(hwnd, cxRenameFileDlg, IDC_RESIZEGRIP2);
1568-
const LPCFILEOPDLGDATA lpfod = (LPCFILEOPDLGDATA)lParam;
1565+
const FILEOPDLGDATA * const lpfod = reinterpret_cast<const FILEOPDLGDATA *>(lParam);
15691566

15701567
SetDlgItemText(hwnd, IDC_OLDNAME, lpfod->szSource);
15711568

@@ -1611,7 +1608,7 @@ INT_PTR CALLBACK RenameFileDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM l
16111608
if (!Edit_GetModify(hwndCtl)) {
16121609
EndDialog(hwnd, IDCANCEL);
16131610
} else {
1614-
LPFILEOPDLGDATA lpfod = (LPFILEOPDLGDATA)GetWindowLongPtr(hwnd, DWLP_USER);
1611+
FILEOPDLGDATA * const lpfod = reinterpret_cast<FILEOPDLGDATA *>(GetWindowLongPtr(hwnd, DWLP_USER));
16151612
Edit_GetText(hwndCtl, lpfod->szDestination, COUNTOF(lpfod->szDestination) - 1);
16161613
EndDialog(hwnd, IDOK);
16171614
}
@@ -1697,7 +1694,7 @@ INT_PTR CALLBACK CopyMoveDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPa
16971694
ResizeDlg_InitX(hwnd, cxCopyMoveDlg, IDC_RESIZEGRIP5);
16981695
MakeBitmapButton(hwnd, IDC_BROWSEDESTINATION, g_exeInstance, IDB_OPEN_FOLDER16);
16991696

1700-
const LPCFILEOPDLGDATA lpfod = (LPCFILEOPDLGDATA)lParam;
1697+
const FILEOPDLGDATA * const lpfod = reinterpret_cast<const FILEOPDLGDATA *>(lParam);
17011698
SetDlgItemText(hwnd, IDC_SOURCE, lpfod->szSource);
17021699

17031700
HWND hwndDest = GetDlgItem(hwnd, IDC_DESTINATION);
@@ -1750,7 +1747,7 @@ INT_PTR CALLBACK CopyMoveDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPa
17501747
case WM_NOTIFY: {
17511748
LPNMHDR pnmhdr = (LPNMHDR)lParam;
17521749
if (pnmhdr->idFrom == IDC_EMPTY_MRU && (pnmhdr->code == NM_CLICK || pnmhdr->code == NM_RETURN)) {
1753-
const LPCFILEOPDLGDATA lpfod = (LPCFILEOPDLGDATA)lParam;
1750+
const FILEOPDLGDATA * const lpfod = reinterpret_cast<const FILEOPDLGDATA *>(GetWindowLongPtr(hwnd, DWLP_USER));
17541751
WCHAR tch[MAX_PATH];
17551752
HWND hwndDest = GetDlgItem(hwnd, IDC_DESTINATION);
17561753
ComboBox_GetText(hwndDest, tch, COUNTOF(tch));
@@ -1782,7 +1779,7 @@ INT_PTR CALLBACK CopyMoveDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPa
17821779

17831780
case IDOK: {
17841781
/*text*/
1785-
LPFILEOPDLGDATA lpfod = (LPFILEOPDLGDATA)GetWindowLongPtr(hwnd, DWLP_USER);
1782+
FILEOPDLGDATA * const lpfod = reinterpret_cast<FILEOPDLGDATA *>(GetWindowLongPtr(hwnd, DWLP_USER));
17861783
HWND hwndDest = GetDlgItem(hwnd, IDC_DESTINATION);
17871784
if (ComboBox_GetText(hwndDest, lpfod->szDestination, COUNTOF(lpfod->szDestination) - 1)) {
17881785
lpfod->wFunc = IsButtonChecked(hwnd, IDC_FUNCCOPY) ? FO_COPY : FO_MOVE;
@@ -2121,7 +2118,7 @@ INT_PTR CALLBACK NewDirDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPara
21212118
break;
21222119

21232120
case IDOK: {
2124-
LPFILEOPDLGDATA lpfod = (LPFILEOPDLGDATA)GetWindowLongPtr(hwnd, DWLP_USER);
2121+
FILEOPDLGDATA * const lpfod = reinterpret_cast<FILEOPDLGDATA *>(GetWindowLongPtr(hwnd, DWLP_USER));
21252122
GetDlgItemText(hwnd, IDC_NEWDIR, lpfod->szDestination, COUNTOF(lpfod->szDestination) - 1);
21262123
EndDialog(hwnd, IDOK);
21272124
}

src/Dialogs.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int MsgBox(UINT uType, UINT uIdMsg, ...) noexcept {
7979
#if NP2_ENABLE_APP_LOCALIZATION_DLL
8080
const LANGID lang = uiLanguage;
8181
#else
82-
const LANGID lang = LANG_USER_DEFAULT;
82+
constexpr LANGID lang = LANG_USER_DEFAULT;
8383
#endif
8484

8585
if (uType & MB_SERVICE_NOTIFICATION) {
@@ -1822,17 +1822,15 @@ bool TabSettingsDlg(HWND hwnd) noexcept {
18221822
// SelectDefEncodingDlgProc()
18231823
//
18241824
//
1825-
typedef struct ENCODEDLG {
1825+
struct ENCODEDLG {
18261826
bool bRecodeOnly;
18271827
int idEncoding;
18281828
int cxDlg;
18291829
int cyDlg;
18301830
UINT uidLabel;
1831-
} ENCODEDLG, *PENCODEDLG;
1832-
1833-
typedef const ENCODEDLG *LPCENCODEDLG;
1831+
};
18341832

1835-
static INT_PTR CALLBACK SelectDefEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) {
1833+
static INT_PTR CALLBACK SelectDefEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) noexcept {
18361834
switch (umsg) {
18371835
case WM_INITDIALOG: {
18381836
SetWindowLongPtr(hwnd, DWLP_USER, lParam);
@@ -1920,7 +1918,7 @@ static INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wPara
19201918
switch (umsg) {
19211919
case WM_INITDIALOG: {
19221920
SetWindowLongPtr(hwnd, DWLP_USER, lParam);
1923-
const LPCENCODEDLG pdd = (LPCENCODEDLG)lParam;
1921+
const ENCODEDLG * const pdd = reinterpret_cast<const ENCODEDLG*>(lParam);
19241922
ResizeDlg_Init(hwnd, pdd->cxDlg, pdd->cyDlg, IDC_RESIZEGRIP);
19251923

19261924
WCHAR wch[256];
@@ -1958,7 +1956,7 @@ static INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wPara
19581956
return TRUE;
19591957

19601958
case WM_DESTROY: {
1961-
PENCODEDLG pdd = (PENCODEDLG)GetWindowLongPtr(hwnd, DWLP_USER);
1959+
ENCODEDLG * pdd = reinterpret_cast<ENCODEDLG *>(GetWindowLongPtr(hwnd, DWLP_USER));
19621960
ResizeDlg_Destroy(hwnd, &pdd->cxDlg, &pdd->cyDlg);
19631961
HIMAGELIST himl = TreeView_GetImageList(GetDlgItem(hwnd, IDC_ENCODINGLIST), TVSIL_NORMAL);
19641962
ImageList_Destroy(himl);
@@ -2013,7 +2011,7 @@ static INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wPara
20132011
switch (LOWORD(wParam)) {
20142012
case IDOK: {
20152013
HWND hwndTV = GetDlgItem(hwnd, IDC_ENCODINGLIST);
2016-
PENCODEDLG pdd = (PENCODEDLG)GetWindowLongPtr(hwnd, DWLP_USER);
2014+
ENCODEDLG * pdd = reinterpret_cast<ENCODEDLG *>(GetWindowLongPtr(hwnd, DWLP_USER));
20172015
if (Encoding_GetFromTreeView(hwndTV, &pdd->idEncoding, false)) {
20182016
EndDialog(hwnd, IDOK);
20192017
} else {
@@ -2267,7 +2265,7 @@ void ZoomLevelDlg(HWND hwnd, bool bBottom) noexcept {
22672265

22682266
extern EditAutoCompletionConfig autoCompletionConfig;
22692267

2270-
static INT_PTR CALLBACK AutoCompletionSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) {
2268+
static INT_PTR CALLBACK AutoCompletionSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) noexcept {
22712269
UNREFERENCED_PARAMETER(lParam);
22722270

22732271
switch (umsg) {
@@ -2555,7 +2553,7 @@ static INT_PTR CALLBACK AutoSaveSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wPa
25552553
GetDlgItemText(hwnd, IDC_AUTOSAVE_PERIOD, tch, COUNTOF(tch));
25562554
float period = 0;
25572555
StrToFloat(tch, &period);
2558-
dwAutoSavePeriod = (DWORD)(period * 1000);
2556+
dwAutoSavePeriod = static_cast<int>(period * 1000);
25592557
EndDialog(hwnd, IDOK);
25602558
}
25612559
break;
@@ -2584,26 +2582,26 @@ bool AutoSaveSettingsDlg(HWND hwnd) noexcept {
25842582
// InfoBoxDlgProc()
25852583
//
25862584
//
2585+
namespace {
2586+
25872587
struct INFOBOX {
25882588
LPWSTR lpstrMessage;
25892589
LPCWSTR lpstrSetting;
25902590
LPCWSTR idiIcon;
25912591
bool bDisableCheckBox;
25922592
};
25932593

2594-
typedef const INFOBOX * LPCINFOBOX;
2595-
25962594
enum SuppressMmessage {
25972595
SuppressMmessage_None = 0,
25982596
SuppressMmessage_Suppress,
25992597
SuppressMmessage_Never,
26002598
};
26012599

2602-
static INT_PTR CALLBACK InfoBoxDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) noexcept {
2600+
INT_PTR CALLBACK InfoBoxDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) noexcept {
26032601
switch (umsg) {
26042602
case WM_INITDIALOG: {
26052603
SetWindowLongPtr(hwnd, DWLP_USER, lParam);
2606-
const LPCINFOBOX lpib = (LPCINFOBOX)lParam;
2604+
const INFOBOX * const lpib = reinterpret_cast<const INFOBOX *>(lParam);
26072605

26082606
SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)LoadIcon(nullptr, lpib->idiIcon), 0);
26092607
SetDlgItemText(hwnd, IDC_INFOBOXTEXT, lpib->lpstrMessage);
@@ -2633,7 +2631,7 @@ static INT_PTR CALLBACK InfoBoxDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPAR
26332631
case IDYES:
26342632
case IDNO:
26352633
if (IsButtonChecked(hwnd, IDC_INFOBOXCHECK)) {
2636-
const LPCINFOBOX lpib = (LPCINFOBOX)GetWindowLongPtr(hwnd, DWLP_USER);
2634+
const INFOBOX * const lpib = reinterpret_cast<const INFOBOX *>(GetWindowLongPtr(hwnd, DWLP_USER));
26372635
IniSetBool(INI_SECTION_NAME_SUPPRESSED_MESSAGES, lpib->lpstrSetting, true);
26382636
}
26392637
EndDialog(hwnd, LOWORD(wParam));
@@ -2644,6 +2642,8 @@ static INT_PTR CALLBACK InfoBoxDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPAR
26442642
return FALSE;
26452643
}
26462644

2645+
}
2646+
26472647
//=============================================================================
26482648
//
26492649
// InfoBox()

src/Edit.cpp

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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

67426742
void 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

Comments
 (0)