Skip to content

Commit 2f60c22

Browse files
committed
Replace NULL with nullptr.
1 parent b21629f commit 2f60c22

15 files changed

Lines changed: 1044 additions & 1044 deletions

matepath/src/Dialogs.cpp

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extern LANGID uiLanguage;
4242

4343
static inline HWND GetMsgBoxParent(void) noexcept {
4444
HWND hwnd = GetActiveWindow();
45-
return (hwnd == NULL) ? hwndMain : hwnd;
45+
return (hwnd == nullptr) ? hwndMain : hwnd;
4646
}
4747

4848
//=============================================================================
@@ -110,7 +110,7 @@ bool GetDirectory(HWND hwndParent, int iTitle, LPWSTR pszFolder, LPCWSTR pszBase
110110

111111
BROWSEINFO bi;
112112
bi.hwndOwner = hwndParent;
113-
bi.pidlRoot = NULL;
113+
bi.pidlRoot = nullptr;
114114
bi.pszDisplayName = pszFolder;
115115
bi.lpszTitle = szTitle;
116116
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE;
@@ -144,9 +144,9 @@ bool GetDirectory2(HWND hwndParent, int iTitle, LPWSTR pszFolder, int iBase) noe
144144

145145
PIDLIST_ABSOLUTE pidlRoot;
146146
#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
147-
if (S_OK != SHGetKnownFolderIDList(iBase, KF_FLAG_DEFAULT, NULL, &pidlRoot))
147+
if (S_OK != SHGetKnownFolderIDList(iBase, KF_FLAG_DEFAULT, nullptr, &pidlRoot))
148148
#else
149-
if (S_OK != SHGetFolderLocation(hwndParent, iBase, NULL, SHGFP_TYPE_DEFAULT, &pidlRoot))
149+
if (S_OK != SHGetFolderLocation(hwndParent, iBase, nullptr, SHGFP_TYPE_DEFAULT, &pidlRoot))
150150
#endif
151151
{
152152
return false;
@@ -158,12 +158,12 @@ bool GetDirectory2(HWND hwndParent, int iTitle, LPWSTR pszFolder, int iBase) noe
158158
bi.pszDisplayName = pszFolder;
159159
bi.lpszTitle = szTitle;
160160
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE;
161-
bi.lpfn = NULL;
161+
bi.lpfn = nullptr;
162162
bi.lParam = 0;
163163
bi.iImage = 0;
164164

165165
PIDLIST_ABSOLUTE pidl = SHBrowseForFolder(&bi);
166-
const bool fOk = pidl != NULL;
166+
const bool fOk = pidl != nullptr;
167167
if (fOk) {
168168
SHGetPathFromIDList(pidl, pszFolder);
169169
CoTaskMemFree((LPVOID)pidl);
@@ -224,7 +224,7 @@ INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
224224
hdwp = DeferCtlPos(hdwp, hwnd, IDC_SEARCHEXE, dx, 0, SWP_NOSIZE);
225225
hdwp = DeferCtlPos(hdwp, hwnd, IDC_COMMANDLINE, dx, 0, SWP_NOMOVE);
226226
EndDeferWindowPos(hdwp);
227-
InvalidateRect(GetDlgItem(hwnd, IDC_RUNDESC), NULL, TRUE);
227+
InvalidateRect(GetDlgItem(hwnd, IDC_RUNDESC), nullptr, TRUE);
228228
}
229229
return TRUE;
230230

@@ -283,7 +283,7 @@ INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
283283
WCHAR args[MAX_PATH];
284284

285285
if (GetDlgItemText(hwnd, IDC_COMMANDLINE, args, MAX_PATH)) {
286-
if (ExtractFirstArgument(args, args, NULL)) {
286+
if (ExtractFirstArgument(args, args, nullptr)) {
287287
if (StrNotEmpty(args)) {
288288
bEnableOK = true;
289289
}
@@ -312,7 +312,7 @@ INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
312312
sei.cbSize = sizeof(SHELLEXECUTEINFO);
313313
sei.fMask = SEE_MASK_DOENVSUBST;
314314
sei.hwnd = hwnd;
315-
sei.lpVerb = NULL;
315+
sei.lpVerb = nullptr;
316316
sei.lpFile = arg1;
317317
sei.lpParameters = arg2;
318318
sei.lpDirectory = szCurDir;
@@ -403,7 +403,7 @@ INT_PTR CALLBACK GotoDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
403403
hdwp = DeferCtlPos(hdwp, hwnd, IDC_GOTODESC, dx, 0, SWP_NOMOVE);
404404
EndDeferWindowPos(hdwp);
405405

406-
InvalidateRect(GetDlgItem(hwnd, IDC_GOTODESC), NULL, TRUE);
406+
InvalidateRect(GetDlgItem(hwnd, IDC_GOTODESC), nullptr, TRUE);
407407
}
408408
return TRUE;
409409

@@ -457,7 +457,7 @@ void GotoDlg(HWND hwnd) noexcept {
457457
}
458458

459459
void OpenHelpLink(HWND hwnd, int cmd) noexcept {
460-
LPCWSTR link = NULL;
460+
LPCWSTR link = nullptr;
461461
switch (cmd) {
462462
case IDC_WEBPAGE_LINK:
463463
link = L"https://www.flos-freeware.ch";
@@ -471,7 +471,7 @@ void OpenHelpLink(HWND hwnd, int cmd) noexcept {
471471
}
472472

473473
if (StrNotEmpty(link)) {
474-
ShellExecute(hwnd, L"open", link, NULL, NULL, SW_SHOWNORMAL);
474+
ShellExecute(hwnd, L"open", link, nullptr, nullptr, SW_SHOWNORMAL);
475475
}
476476
}
477477

@@ -517,7 +517,7 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam
517517
SetDlgItemText(hwnd, IDC_BUILD_INFO, wch);
518518

519519
HFONT hFontTitle = (HFONT)SendDlgItemMessage(hwnd, IDC_VERSION, WM_GETFONT, 0, 0);
520-
if (hFontTitle == NULL) {
520+
if (hFontTitle == nullptr) {
521521
hFontTitle = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
522522
}
523523

@@ -528,23 +528,23 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam
528528
SendDlgItemMessage(hwnd, IDC_VERSION, WM_SETFONT, (WPARAM)hFontTitle, TRUE);
529529
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)(hFontTitle));
530530

531-
if (GetDlgItem(hwnd, IDC_WEBPAGE_LINK) == NULL) {
531+
if (GetDlgItem(hwnd, IDC_WEBPAGE_LINK) == nullptr) {
532532
SetDlgItemText(hwnd, IDC_WEBPAGE_TEXT, VERSION_WEBPAGE_DISPLAY);
533533
ShowWindow(GetDlgItem(hwnd, IDC_WEBPAGE_TEXT), SW_SHOWNORMAL);
534534
} else {
535535
wsprintf(wch, L"<A>%s</A>", VERSION_WEBPAGE_DISPLAY);
536536
SetDlgItemText(hwnd, IDC_WEBPAGE_LINK, wch);
537537
}
538538

539-
if (GetDlgItem(hwnd, IDC_EMAIL_LINK) == NULL) {
539+
if (GetDlgItem(hwnd, IDC_EMAIL_LINK) == nullptr) {
540540
SetDlgItemText(hwnd, IDC_EMAIL_TEXT, VERSION_EMAIL_DISPLAY);
541541
ShowWindow(GetDlgItem(hwnd, IDC_EMAIL_TEXT), SW_SHOWNORMAL);
542542
} else {
543543
wsprintf(wch, L"<A>%s</A>", VERSION_EMAIL_DISPLAY);
544544
SetDlgItemText(hwnd, IDC_EMAIL_LINK, wch);
545545
}
546546

547-
if (GetDlgItem(hwnd, IDC_NEW_PAGE_LINK) == NULL) {
547+
if (GetDlgItem(hwnd, IDC_NEW_PAGE_LINK) == nullptr) {
548548
SetDlgItemText(hwnd, IDC_NEW_PAGE_TEXT, VERSION_NEWPAGE_DISPLAY);
549549
ShowWindow(GetDlgItem(hwnd, IDC_NEW_PAGE_TEXT), SW_SHOWNORMAL);
550550
} else {
@@ -900,14 +900,14 @@ INT_PTR CALLBACK ItemsPageProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPara
900900
case IDC_COLOR_CUST1:
901901
m_bDefColorNoFilter = !IsButtonChecked(hwnd, IDC_COLOR_CUST1);
902902
EnableWindow(GetDlgItem(hwnd, IDC_COLOR_PICK1), !m_bDefColorNoFilter);
903-
InvalidateRect(GetDlgItem(hwnd, IDC_COLOR_SAMP1), NULL, TRUE);
903+
InvalidateRect(GetDlgItem(hwnd, IDC_COLOR_SAMP1), nullptr, TRUE);
904904
break;
905905

906906
case IDC_COLOR_DEF2:
907907
case IDC_COLOR_CUST2:
908908
m_bDefColorFilter = !IsButtonChecked(hwnd, IDC_COLOR_CUST2);
909909
EnableWindow(GetDlgItem(hwnd, IDC_COLOR_PICK2), !m_bDefColorFilter);
910-
InvalidateRect(GetDlgItem(hwnd, IDC_COLOR_SAMP2), NULL, TRUE);
910+
InvalidateRect(GetDlgItem(hwnd, IDC_COLOR_SAMP2), nullptr, TRUE);
911911
break;
912912

913913
case IDC_COLOR_PICK1:
@@ -925,7 +925,7 @@ INT_PTR CALLBACK ItemsPageProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPara
925925
m_hbrNoFilter = CreateSolidBrush(m_colorNoFilter);
926926
}
927927

928-
InvalidateRect(GetDlgItem(hwnd, IDC_COLOR_SAMP1), NULL, TRUE);
928+
InvalidateRect(GetDlgItem(hwnd, IDC_COLOR_SAMP1), nullptr, TRUE);
929929
break;
930930

931931
case IDC_COLOR_PICK2:
@@ -943,7 +943,7 @@ INT_PTR CALLBACK ItemsPageProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPara
943943
m_hbrFilter = CreateSolidBrush(m_colorFilter);
944944
}
945945

946-
InvalidateRect(GetDlgItem(hwnd, IDC_COLOR_SAMP2), NULL, TRUE);
946+
InvalidateRect(GetDlgItem(hwnd, IDC_COLOR_SAMP2), nullptr, TRUE);
947947
break;
948948
}
949949
return TRUE;
@@ -1006,7 +1006,7 @@ struct SystemIntegrationInfo {
10061006
int GetSystemIntegrationStatus(SystemIntegrationInfo &info) noexcept {
10071007
int mask = 0;
10081008
WCHAR tchModule[MAX_PATH];
1009-
GetModuleFileName(NULL, tchModule, COUNTOF(tchModule));
1009+
GetModuleFileName(nullptr, tchModule, COUNTOF(tchModule));
10101010

10111011
// context menu
10121012
HKEY hKey;
@@ -1017,8 +1017,8 @@ int GetSystemIntegrationStatus(SystemIntegrationInfo &info) noexcept {
10171017
status = RegOpenKeyEx(hKey, L"command", 0, KEY_READ, &hSubKey);
10181018
if (status == ERROR_SUCCESS) {
10191019
LPWSTR command = Registry_GetDefaultString(hSubKey);
1020-
if (command != NULL) {
1021-
if (StrStrI(command, tchModule) != NULL) {
1020+
if (command != nullptr) {
1021+
if (StrStrI(command, tchModule) != nullptr) {
10221022
mask |= SystemIntegration_ContextMenu;
10231023
}
10241024
NP2HeapFree(command);
@@ -1036,12 +1036,12 @@ int GetSystemIntegrationStatus(SystemIntegrationInfo &info) noexcept {
10361036
status = RegOpenKeyEx(hKey, L"shell\\open\\command", 0, KEY_READ, &hSubKey);
10371037
if (status == ERROR_SUCCESS) {
10381038
LPWSTR command = Registry_GetDefaultString(hSubKey);
1039-
if (command != NULL) {
1039+
if (command != nullptr) {
10401040
LPWSTR userId = Registry_GetString(hKey, L"AppUserModelID");
1041-
if (userId != NULL && StrEqual(userId, g_wchAppUserModelID) && StrStrI(command, tchModule) != NULL) {
1041+
if (userId != nullptr && StrEqual(userId, g_wchAppUserModelID) && StrStrI(command, tchModule) != nullptr) {
10421042
mask |= SystemIntegration_JumpList;
10431043
}
1044-
if (userId != NULL) {
1044+
if (userId != nullptr) {
10451045
NP2HeapFree(userId);
10461046
}
10471047
NP2HeapFree(command);
@@ -1056,7 +1056,7 @@ int GetSystemIntegrationStatus(SystemIntegrationInfo &info) noexcept {
10561056

10571057
void UpdateSystemIntegrationStatus(int mask, LPCWSTR lpszText, LPCWSTR lpszName) noexcept {
10581058
WCHAR tchModule[MAX_PATH];
1059-
GetModuleFileName(NULL, tchModule, COUNTOF(tchModule));
1059+
GetModuleFileName(nullptr, tchModule, COUNTOF(tchModule));
10601060
WCHAR command[300];
10611061
wsprintf(command, L"\"%s\" \"%%1\"", tchModule);
10621062

@@ -1391,7 +1391,7 @@ INT_PTR CALLBACK GetFilterDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lP
13911391
switch (umsg) {
13921392
case WM_INITDIALOG: {
13931393
ResizeDlg_InitX(hwnd, cxFileFilterDlg, IDC_RESIZEGRIP3);
1394-
MakeBitmapButton(hwnd, IDC_BROWSEFILTER, NULL, OBM_COMBO);
1394+
MakeBitmapButton(hwnd, IDC_BROWSEFILTER, nullptr, OBM_COMBO);
13951395

13961396
HWND hwndCtl = GetDlgItem(hwnd, IDC_FILTER);
13971397
Edit_LimitText(hwndCtl, COUNTOF(tchFilter) - 1);
@@ -1469,9 +1469,9 @@ INT_PTR CALLBACK GetFilterDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lP
14691469
RECT rc;
14701470

14711471
GetWindowRect(GetDlgItem(hwnd, IDC_BROWSEFILTER), &rc);
1472-
//MapWindowPoints(hwnd, NULL, (POINT*)&rc, 2);
1472+
//MapWindowPoints(hwnd, nullptr, (POINT*)&rc, 2);
14731473
// Seems that TrackPopupMenuEx() works with client coords...?
1474-
const DWORD dwCmd = TrackPopupMenuEx(hMenu, TPM_RETURNCMD | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, rc.left + 1, rc.bottom + 1, hwnd, NULL);
1474+
const DWORD dwCmd = TrackPopupMenuEx(hMenu, TPM_RETURNCMD | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, rc.left + 1, rc.bottom + 1, hwnd, nullptr);
14751475

14761476
if (dwCmd) {
14771477
WCHAR tchName[256];
@@ -1898,14 +1898,14 @@ INT_PTR CALLBACK OpenWithDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPa
18981898
InitWindowCommon(hwndLV);
18991899
//SetExplorerTheme(hwndLV);
19001900
ListView_SetExtendedListViewStyle(hwndLV, /*LVS_EX_FULLROWSELECT | */LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP);
1901-
LVCOLUMN lvc = { LVCF_FMT | LVCF_TEXT, LVCFMT_LEFT, 0, NULL, -1, 0, 0, 0
1901+
LVCOLUMN lvc = { LVCF_FMT | LVCF_TEXT, LVCFMT_LEFT, 0, nullptr, -1, 0, 0, 0
19021902
#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
19031903
, 0, 0, 0
19041904
#endif
19051905
};
19061906
ListView_InsertColumn(hwndLV, 0, &lvc);
1907-
DirList_Init(hwndLV, NULL);
1908-
DirList_Fill(hwndLV, tchOpenWithDir, DL_ALLOBJECTS, NULL, false, flagNoFadeHidden, DS_NAME, false);
1907+
DirList_Init(hwndLV, nullptr);
1908+
DirList_Fill(hwndLV, tchOpenWithDir, DL_ALLOBJECTS, nullptr, false, flagNoFadeHidden, DS_NAME, false);
19091909
DirList_StartIconThread(hwndLV);
19101910
ListView_SetItemState(hwndLV, 0, LVIS_FOCUSED, LVIS_FOCUSED);
19111911

@@ -1979,7 +1979,7 @@ INT_PTR CALLBACK OpenWithDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPa
19791979
case IDC_GETOPENWITHDIR: {
19801980
HWND hwndLV = GetDlgItem(hwnd, IDC_OPENWITHDIR);
19811981
if (GetDirectory(hwnd, IDS_OPENWITH, tchOpenWithDir, tchOpenWithDir)) {
1982-
DirList_Fill(hwndLV, tchOpenWithDir, DL_ALLOBJECTS, NULL, false, flagNoFadeHidden, DS_NAME, false);
1982+
DirList_Fill(hwndLV, tchOpenWithDir, DL_ALLOBJECTS, nullptr, false, flagNoFadeHidden, DS_NAME, false);
19831983
DirList_StartIconThread(hwndLV);
19841984
ListView_EnsureVisible(hwndLV, 0, FALSE);
19851985
ListView_SetItemState(hwndLV, 0, LVIS_FOCUSED, LVIS_FOCUSED);
@@ -2057,7 +2057,7 @@ bool OpenWithDlg(HWND hwnd, LPCDLITEM lpdliParam) {
20572057
sei.cbSize = sizeof(SHELLEXECUTEINFO);
20582058
sei.fMask = 0;
20592059
sei.hwnd = hwnd;
2060-
sei.lpVerb = NULL;
2060+
sei.lpVerb = nullptr;
20612061
sei.lpFile = dliOpenWith.szFileName;
20622062
sei.lpParameters = szDestination;
20632063
sei.lpDirectory = szCurDir;
@@ -2190,7 +2190,7 @@ static INT_PTR CALLBACK FindWinDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPAR
21902190
hdwp = DeferCtlPos(hdwp, hwnd, IDC_FINDWINDESC, dx, 0, SWP_NOMOVE);
21912191
hdwp = DeferCtlPos(hdwp, hwnd, IDC_WINTITLE, dx, 0, SWP_NOMOVE);
21922192
EndDeferWindowPos(hdwp);
2193-
InvalidateRect(GetDlgItem(hwnd, IDC_FINDWINDESC), NULL, TRUE);
2193+
InvalidateRect(GetDlgItem(hwnd, IDC_FINDWINDESC), nullptr, TRUE);
21942194
}
21952195
return TRUE;
21962196

@@ -2215,7 +2215,7 @@ static INT_PTR CALLBACK FindWinDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPAR
22152215
break;
22162216

22172217
case WM_LBUTTONUP: {
2218-
SetCursor(LoadCursor(NULL, IDC_ARROW));
2218+
SetCursor(LoadCursor(nullptr, IDC_ARROW));
22192219
SendDlgItemMessage(hwnd, IDC_CROSSCURSOR, STM_SETICON, (WPARAM)hIconCross1, 0);
22202220
ReleaseCapture();
22212221
bHasCapture = false;
@@ -2335,7 +2335,7 @@ INT_PTR CALLBACK FindTargetDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM l
23352335
case WM_INITDIALOG: {
23362336
ResizeDlg_InitX(hwnd, cxTargetApplicationDlg, IDC_RESIZEGRIP4);
23372337
// ToolTip for browse button
2338-
HWND hwndToolTip = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, 0, 0, 0, 0, 0, hwnd, NULL, g_hInstance, NULL);
2338+
HWND hwndToolTip = CreateWindowEx(0, TOOLTIPS_CLASS, nullptr, 0, 0, 0, 0, 0, hwnd, nullptr, g_hInstance, nullptr);
23392339

23402340
TOOLINFO ti;
23412341
memset(&ti, 0, sizeof(TOOLINFO));
@@ -2351,7 +2351,7 @@ INT_PTR CALLBACK FindTargetDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM l
23512351
}
23522352

23532353
// ToolTip for find window button
2354-
//hwndToolTip = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, 0, 0, 0, 0, 0, hwnd, NULL, g_hInstance, NULL);
2354+
//hwndToolTip = CreateWindowEx(0, TOOLTIPS_CLASS, nullptr, 0, 0, 0, 0, 0, hwnd, nullptr, g_hInstance, nullptr);
23552355
//memset(&ti, 0, sizeof(TOOLINFO));
23562356
//ti.cbSize = sizeof(TOOLINFO);
23572357
//ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
@@ -2487,7 +2487,7 @@ INT_PTR CALLBACK FindTargetDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM l
24872487
// WCHAR tchArgs[MAX_PATH * 2];
24882488
//
24892489
// if (GetDlgItemText(hwnd, IDC_COMMANDLINE, tchArgs, COUNTOF(tchArgs))) {
2490-
// if (ExtractFirstArgument(tchArgs, tchArgs, NULL)) {
2490+
// if (ExtractFirstArgument(tchArgs, tchArgs, nullptr)) {
24912491
// if (StrNotEmpty(tchArgs)) {
24922492
// bEnableOK = true;
24932493
// }

matepath/src/Dlapi.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ void DirList_Init(HWND hwnd, LPCWSTR pszHeader) {
6767
// Setup dl
6868
BackgroundWorker_Init(&lpdl->worker, hwnd);
6969
lpdl->cbidl = 0;
70-
lpdl->pidl = NULL;
71-
lpdl->lpsf = NULL;
70+
lpdl->pidl = nullptr;
71+
lpdl->lpsf = nullptr;
7272
StrCpyExW(lpdl->szPath, L"");
7373

7474
SHFILEINFO shfi;
@@ -175,9 +175,9 @@ int DirList_Fill(HWND hwnd, LPCWSTR lpszDir, DWORD grfFlags, LPCWSTR lpszFileSpe
175175
lstrcpy(wszDir, lpszDir);
176176

177177
// Get Desktop Folder
178-
LPSHELLFOLDER lpsfDesktop = NULL;
179-
PIDLIST_RELATIVE pidl = NULL;
180-
LPSHELLFOLDER lpsf = NULL;
178+
LPSHELLFOLDER lpsfDesktop = nullptr;
179+
PIDLIST_RELATIVE pidl = nullptr;
180+
LPSHELLFOLDER lpsf = nullptr;
181181
if (S_OK == SHGetDesktopFolder(&lpsfDesktop)) {
182182
// Convert wszDir into a pidl
183183
ULONG chParsed = 0;
@@ -701,7 +701,7 @@ void DirList_CreateFilter(PDL_FILTER pdlf, LPCWSTR lpszFileSpec, bool bExcludeFi
701701
pdlf->pFilter[0] = pdlf->tFilterBuf; // Zeile zum Ausprobieren
702702

703703
WCHAR *p;
704-
while ((p = StrChr(pdlf->pFilter[pdlf->nCount - 1], L';')) != NULL) {
704+
while ((p = StrChr(pdlf->pFilter[pdlf->nCount - 1], L';')) != nullptr) {
705705
*p = L'\0'; // Replace L';' by L'\0'
706706
pdlf->pFilter[pdlf->nCount] = (p + 1); // Next position after L';'
707707
pdlf->nCount++; // Increase number of filters
@@ -715,7 +715,7 @@ void DirList_CreateFilter(PDL_FILTER pdlf, LPCWSTR lpszFileSpec, bool bExcludeFi
715715
// Check if a specified item matches a given filter
716716
//
717717
bool DirList_MatchFilter(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidl, LPCDL_FILTER pdlf) {
718-
// Immediately return true if lpszFileSpec is *.* or NULL
718+
// Immediately return true if lpszFileSpec is *.* or nullptr
719719
if (pdlf->nCount == 0 && !pdlf->bExcludeFilter) {
720720
return true;
721721
}
@@ -795,9 +795,9 @@ int DriveBox_Fill(HWND hwnd) {
795795
// Get pidl to [My Computer]
796796
PIDLIST_ABSOLUTE pidl;
797797
#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
798-
if (S_OK == SHGetKnownFolderIDList(KnownFolderId_ComputerFolder, KF_FLAG_DEFAULT, NULL, &pidl))
798+
if (S_OK == SHGetKnownFolderIDList(KnownFolderId_ComputerFolder, KF_FLAG_DEFAULT, nullptr, &pidl))
799799
#else
800-
if (S_OK == SHGetFolderLocation(hwnd, CSIDL_DRIVES, NULL, SHGFP_TYPE_DEFAULT, &pidl))
800+
if (S_OK == SHGetFolderLocation(hwnd, CSIDL_DRIVES, nullptr, SHGFP_TYPE_DEFAULT, &pidl))
801801
#endif
802802
{
803803
// Get Desktop Folder
@@ -1046,14 +1046,14 @@ bool DriveBox_GetDispInfo(HWND hwnd, LPARAM lParam) {
10461046
//
10471047
// Creates an ITEMIDLIST by concatenating pidl1 and pidl2
10481048
// cb1 and cb2 indicate the sizes of the pidls, where cb1
1049-
// can be zero and pidl1 can be NULL
1049+
// can be zero and pidl1 can be nullptr
10501050
//
10511051
// If cb2 is zero, the size of pidl2 is retrieved using
10521052
// IL_GetSize(pidl2)
10531053
//
10541054
LPITEMIDLIST IL_Create(LPCITEMIDLIST pidl1, UINT cb1, LPCITEMIDLIST pidl2, UINT cb2) noexcept {
10551055
if (!pidl2) {
1056-
return NULL;
1056+
return nullptr;
10571057
}
10581058

10591059
if (!cb2) {
@@ -1072,7 +1072,7 @@ LPITEMIDLIST IL_Create(LPCITEMIDLIST pidl1, UINT cb1, LPCITEMIDLIST pidl2, UINT
10721072
memcpy((char *)pidl, (const char *)pidl1, cb1);
10731073
}
10741074

1075-
// pidl2 can't be NULL here
1075+
// pidl2 can't be nullptr here
10761076
memcpy((char *)pidl + cb1, (const char *)pidl2, cb2);
10771077

10781078
return pidl;

0 commit comments

Comments
 (0)