summaryrefslogtreecommitdiff
path: root/plugins/Popup/src/history.cpp
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:03:31 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:07:33 +0100
commita7c24ca48995cf2bf436156302f96b91bf135409 (patch)
tree953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/Popup/src/history.cpp
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/Popup/src/history.cpp')
-rw-r--r--plugins/Popup/src/history.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/plugins/Popup/src/history.cpp b/plugins/Popup/src/history.cpp
index 4746c4d4a9..860e777962 100644
--- a/plugins/Popup/src/history.cpp
+++ b/plugins/Popup/src/history.cpp
@@ -27,7 +27,7 @@ static mir_cs csPopupHistory;
static LIST<POPUPDATA2> arPopupHistory(SETTING_HISTORYSIZE_DEFAULT);
static int popupHistoryBuffer = 0;
-static HWND hwndHistory = NULL;
+static HWND hwndHistory = nullptr;
#define UM_RESIZELIST (WM_USER+100)
#define UM_SELECTLAST (WM_USER+101)
@@ -82,7 +82,7 @@ void PopupHistoryAdd(POPUPDATA2 *ppdNew)
ppd->lpzText = mir_strdup(ppd->lpzText);
}
ppd->lpzSkin = mir_strdup(ppd->lpzSkin);
- ppd->dwTimestamp = time(NULL);
+ ppd->dwTimestamp = time(nullptr);
{
mir_cslock lck(csPopupHistory);
if (arPopupHistory.getCount() >= popupHistoryBuffer) {
@@ -98,7 +98,7 @@ void PopupHistoryAdd(POPUPDATA2 *ppdNew)
void PopupHistoryShow()
{
if (!PopupOptions.EnableHistory) {
- MessageBox(NULL, TranslateT("Popup History is disabled"), TranslateT("Popup History message"), MB_OK);
+ MessageBox(nullptr, TranslateT("Popup History is disabled"), TranslateT("Popup History message"), MB_OK);
return;
}
@@ -109,7 +109,7 @@ void PopupHistoryShow()
SetActiveWindow(hwndHistory);
}
else {
- hwndHistory = CreateDialog(hInst, MAKEINTRESOURCE(IDD_HISTORY), NULL, HistoryDlgProc);
+ hwndHistory = CreateDialog(hInst, MAKEINTRESOURCE(IDD_HISTORY), nullptr, HistoryDlgProc);
SetWindowText(hwndHistory, TranslateT("Popup History"));
}
}
@@ -120,7 +120,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara
static int loadItem = -1;
static enum { LOG_NONE, LOG_DEFAULT, LOG_HPP } logType = LOG_NONE;
- static HWND hwndLog = NULL;
+ static HWND hwndLog = nullptr;
switch (msg) {
case WM_INITDIALOG:
@@ -176,7 +176,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara
ieEvent.eventData = &ieData;
ieEvent.count = 1;
ieEvent.codepage = 0;
- ieEvent.pszProto = NULL;
+ ieEvent.pszProto = nullptr;
for (int i = 0; i < arPopupHistory.getCount(); ++i) {
POPUPDATA2* ppd = arPopupHistory[i];
@@ -188,18 +188,18 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara
ieData.dwFlags |= IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK;
ieData.pszNickW = ppd->lptzTitle;
ieData.pszTextW = ppd->lptzText;
- ieData.pszText2W = NULL;
+ ieData.pszText2W = nullptr;
}
else {
ieData.dwFlags |= 0;
ieData.pszNick = ppd->lpzTitle;
ieData.pszText = ppd->lpzText;
- ieData.pszText2 = NULL;
+ ieData.pszText2 = nullptr;
}
ieData.bIsMe = FALSE;
ieData.time = ppd->dwTimestamp;
ieData.dwData = 0;
- ieData.next = NULL;
+ ieData.next = nullptr;
CallService(MS_HPP_EG_EVENT, 0, (WPARAM)&ieEvent);
}
}
@@ -301,7 +301,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara
rcLst.right -= 10;
rcLst.bottom -= 10;
if (logType == LOG_HPP) {
- SetWindowPos(hwndLog, NULL,
+ SetWindowPos(hwndLog, nullptr,
rcLst.left, rcLst.top, rcLst.right - rcLst.left, rcLst.bottom - rcLst.top,
SWP_NOZORDER | SWP_DEFERERASE | SWP_SHOWWINDOW);
@@ -317,7 +317,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara
CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&ieWindow);
}
else if (logType == LOG_DEFAULT) {
- SetWindowPos(hwndLog, NULL,
+ SetWindowPos(hwndLog, nullptr,
rcLst.left, rcLst.top, rcLst.right - rcLst.left, rcLst.bottom - rcLst.top,
SWP_NOZORDER | SWP_DEFERERASE | SWP_SHOWWINDOW);
if (rcLst.right - rcLst.left != oldWidth) {
@@ -343,8 +343,8 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara
ListBox_SetItemData(hwndLog, i, 0);
ListBox_SetItemHeight(hwndLog, i, 50);
}
- ScrollWindow(hwndLog, 0, 100000, NULL, NULL);
- InvalidateRect(hwndLog, NULL, TRUE);
+ ScrollWindow(hwndLog, 0, 100000, nullptr, nullptr);
+ InvalidateRect(hwndLog, nullptr, TRUE);
}
return TRUE;
@@ -362,7 +362,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara
ieEvent.eventData = &ieData;
ieEvent.count = 1;
ieEvent.codepage = 0;
- ieEvent.pszProto = NULL;
+ ieEvent.pszProto = nullptr;
ieData.cbSize = sizeof(ieData);
ieData.dwFlags = 0;
@@ -372,18 +372,18 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara
ieData.dwFlags |= IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK;
ieData.pszNickW = ppd->lptzTitle;
ieData.pszTextW = ppd->lptzText;
- ieData.pszText2W = NULL;
+ ieData.pszText2W = nullptr;
}
else {
ieData.dwFlags |= 0;
ieData.pszNick = ppd->lpzTitle;
ieData.pszText = ppd->lpzText;
- ieData.pszText2 = NULL;
+ ieData.pszText2 = nullptr;
}
ieData.bIsMe = FALSE;
ieData.time = ppd->dwTimestamp;
ieData.dwData = 0;
- ieData.next = NULL;
+ ieData.next = nullptr;
CallService(MS_HPP_EG_EVENT, 0, (WPARAM)&ieEvent);
}
else if (logType == LOG_DEFAULT) {
@@ -399,7 +399,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara
case WM_CLOSE:
Utils_SaveWindowPosition(hwnd, NULL, MODULNAME, "popupHistory_");
DestroyWindow(hwnd);
- hwndHistory = NULL;
+ hwndHistory = nullptr;
return TRUE;
case WM_DESTROY: