diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/Folders | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/Folders')
-rw-r--r-- | plugins/Folders/src/dlg_handlers.cpp | 10 | ||||
-rw-r--r-- | plugins/Folders/src/events.cpp | 2 | ||||
-rw-r--r-- | plugins/Folders/src/folderItem.cpp | 10 | ||||
-rw-r--r-- | plugins/Folders/src/services.cpp | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp index 8f26cd0e7e..806b0972c7 100644 --- a/plugins/Folders/src/dlg_handlers.cpp +++ b/plugins/Folders/src/dlg_handlers.cpp @@ -1,6 +1,6 @@ #include "stdafx.h"
-PFolderItem lastItem = NULL;
+PFolderItem lastItem = nullptr;
static int bInitializing = 0;
@@ -8,7 +8,7 @@ static PFolderItem GetSelectedItem(HWND hWnd) {
int index = SendDlgItemMessage(hWnd, IDC_FOLDERS_ITEMS_LIST, LB_GETCURSEL, 0, 0);
if (index == LB_ERR)
- return NULL;
+ return nullptr;
return (PFolderItem)SendDlgItemMessage(hWnd, IDC_FOLDERS_ITEMS_LIST, LB_GETITEMDATA, index, 0);
}
@@ -173,7 +173,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l switch (msg) {
case WM_INITDIALOG:
- lastItem = NULL;
+ lastItem = nullptr;
TranslateDialogDefault(hWnd);
bInitializing = 1;
LoadRegisteredFolderSections(hWnd);
@@ -204,7 +204,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l case LBN_SELCHANGE:
CheckForChanges(hWnd);
LoadRegisteredFolderItems(hWnd);
- lastItem = NULL;
+ lastItem = nullptr;
SetEditText(hWnd, L"");
RefreshPreview(hWnd);
}
@@ -214,7 +214,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l switch (HIWORD(wParam)) {
case LBN_SELCHANGE:
item = GetSelectedItem(hWnd);
- if (item != NULL) {
+ if (item != nullptr) {
CheckForChanges(hWnd);
LoadItem(hWnd, item);
}
diff --git a/plugins/Folders/src/events.cpp b/plugins/Folders/src/events.cpp index db9bd46c1d..ae9616333c 100644 --- a/plugins/Folders/src/events.cpp +++ b/plugins/Folders/src/events.cpp @@ -31,7 +31,7 @@ int InitEvents() int DestroyEvents()
{
DestroyHookableEvent(hPathChanged);
- hPathChanged = 0;
+ hPathChanged = nullptr;
return 0;
}
diff --git a/plugins/Folders/src/folderItem.cpp b/plugins/Folders/src/folderItem.cpp index f277a27ec3..0b86c2c357 100644 --- a/plugins/Folders/src/folderItem.cpp +++ b/plugins/Folders/src/folderItem.cpp @@ -28,8 +28,8 @@ CFolderItem::CFolderItem(const char *sectionName, const char *name, const wchar_ m_tszUserName = mir_wstrdup(userName);
else
m_tszUserName = mir_a2u(name);
- m_tszFormat = NULL;
- m_tszOldFormat = NULL;
+ m_tszFormat = nullptr;
+ m_tszOldFormat = nullptr;
GetDataFromDatabase(format);
FolderCreateDirectory();
}
@@ -84,13 +84,13 @@ void CFolderItem::Save() int CFolderItem::FolderCreateDirectory(int showFolder)
{
- if (m_tszFormat == NULL)
+ if (m_tszFormat == nullptr)
return FOLDER_SUCCESS;
CMStringW buffer(ExpandPath(m_tszFormat));
CreateDirectoryTreeW(buffer);
if (showFolder)
- ShellExecute(NULL, L"explore", buffer, NULL, NULL, SW_SHOW);
+ ShellExecute(nullptr, L"explore", buffer, nullptr, nullptr, SW_SHOW);
return (DirectoryExists(buffer)) ? FOLDER_SUCCESS : FOLDER_FAILURE;
}
@@ -107,7 +107,7 @@ int CFolderItem::FolderDeleteOldDirectory(int showFolder) RemoveDirectories(buffer);
int res = (DirectoryExists(buffer)) ? FOLDER_FAILURE : FOLDER_SUCCESS;
if ((res == FOLDER_FAILURE) && (showFolder))
- ShellExecute(NULL, L"explore", buffer, NULL, NULL, SW_SHOW);
+ ShellExecute(nullptr, L"explore", buffer, nullptr, nullptr, SW_SHOW);
return res;
}
diff --git a/plugins/Folders/src/services.cpp b/plugins/Folders/src/services.cpp index 7dab3adde6..cba24efd33 100644 --- a/plugins/Folders/src/services.cpp +++ b/plugins/Folders/src/services.cpp @@ -30,7 +30,7 @@ wchar_t szUserDataPath[MAX_FOLDERS_PATH]; INT_PTR RegisterPathService(WPARAM, LPARAM lParam)
{
FOLDERSDATA *data = (FOLDERSDATA*)lParam;
- if (data == NULL)
+ if (data == nullptr)
return NULL;
if (data->cbSize != sizeof(FOLDERSDATA))
|