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/Sessions/Src | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/Sessions/Src')
-rw-r--r-- | plugins/Sessions/Src/Main.cpp | 68 | ||||
-rw-r--r-- | plugins/Sessions/Src/Options.cpp | 32 | ||||
-rw-r--r-- | plugins/Sessions/Src/Utils.cpp | 8 |
3 files changed, 54 insertions, 54 deletions
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 0d0baffe91..6a365b73dc 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
CLIST_INTERFACE *pcli;
-HINSTANCE g_hInst = NULL;
+HINSTANCE g_hInst = nullptr;
HGENMENU hmSaveCurrentSession;
@@ -130,7 +130,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l case WM_CLOSE:
DestroyWindow(hdlg);
- g_hSDlg = 0;
+ g_hSDlg = nullptr;
break;
case WM_NOTIFY:
@@ -163,7 +163,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l dd = 5;
hClistControl = CreateWindowEx(WS_EX_CLIENTEDGE, CLISTCONTROL_CLASSW, L"",
WS_TABSTOP | WS_VISIBLE | WS_CHILD,
- x, y, dx, dy, hdlg, (HMENU)IDC_CLIST, g_hInst, 0);
+ x, y, dx, dy, hdlg, (HMENU)IDC_CLIST, g_hInst, nullptr);
SetWindowLongPtr(hClistControl, GWL_STYLE,
GetWindowLongPtr(hClistControl, GWL_STYLE) | CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE | CLS_GROUPCHECKBOXES);
@@ -177,9 +177,9 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l DestroyWindow(hClistControl);
}
- SetWindowPos(hdlg, NULL, rWnd.left, rWnd.top, x + dx, y + (dx / 3), SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE);
+ SetWindowPos(hdlg, nullptr, rWnd.left, rWnd.top, x + dx, y + (dx / 3), SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE);
- SetWindowPos(hClistControl, 0, x - dd, dd, dx - dd, y + (dx / 12), SWP_NOZORDER/*|SWP_NOSIZE|SWP_SHOWWINDOW*/);
+ SetWindowPos(hClistControl, nullptr, x - dd, dd, dx - dd, y + (dx / 12), SWP_NOZORDER/*|SWP_NOSIZE|SWP_SHOWWINDOW*/);
SendMessage(hClistControl, CLM_AUTOREBUILD, 0, 0);
for (i = 0; session_list[i] > 0; i++) {
@@ -218,7 +218,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l SaveUserSessionName(szUserSessionName);
memcpy(session_list, session_list_temp, sizeof(session_list));
DestroyWindow(hdlg);
- g_hSDlg = 0;
+ g_hSDlg = nullptr;
}
else if (!SaveUserSessionName(szUserSessionName)) {
SaveSessionHandles(0, 1);
@@ -226,18 +226,18 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l if (IsDlgButtonChecked(hdlg, IDC_SANDCCHECK))
CloseCurrentSession(0, 0);
DestroyWindow(hdlg);
- g_hSDlg = 0;
+ g_hSDlg = nullptr;
}
- else MessageBox(NULL, TranslateT("Current session is empty!"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
+ else MessageBox(nullptr, TranslateT("Current session is empty!"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
}
- else MessageBox(NULL, TranslateT("Session name is empty, enter the name and try again"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
+ else MessageBox(nullptr, TranslateT("Session name is empty, enter the name and try again"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
}
break;
case IDCANCEL:
SavePosition(hdlg, "SaveDlg");
DestroyWindow(hdlg);
- g_hSDlg = 0;
+ g_hSDlg = nullptr;
}
break;
@@ -258,7 +258,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) {
int iDelay = db_get_w(NULL, MODNAME, "StartupModeDelay", 1500);
if (g_hghostw == TRUE)
- SetTimer(hdlg, TIMERID_LOAD, iDelay, NULL);
+ SetTimer(hdlg, TIMERID_LOAD, iDelay, nullptr);
else {
if ((ses_count = LoadSessionToCombobox(hdlg, 0, g_ses_limit, "SessionDate", 0)) == g_ses_limit)
EnableWindow(GetDlgItem(hdlg, IDC_SESSDEL), TRUE);
@@ -272,7 +272,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) SendDlgItemMessage(hdlg, IDC_LIST, CB_SETCURSEL, 0, 0);
LoadPosition(hdlg, "LoadDlg");
if (StartUp)
- SetTimer(hdlg, TIMERID_SHOW, iDelay, NULL);
+ SetTimer(hdlg, TIMERID_SHOW, iDelay, nullptr);
else
ShowWindow(g_hDlg, SW_SHOW);
}
@@ -290,14 +290,14 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) LoadSession(0, g_bIncompletedSave ? 256 : 0);
g_hghostw = StartUp = FALSE;
DestroyWindow(hdlg);
- g_hDlg = 0;
+ g_hDlg = nullptr;
}
break;
case WM_CLOSE:
SavePosition(hdlg, "LoadDlg");
DestroyWindow(hdlg);
- g_hDlg = 0;
+ g_hDlg = nullptr;
break;
case WM_COMMAND:
@@ -374,14 +374,14 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) if (!LoadSession(0, ses_count)) {
SavePosition(hdlg, "LoadDlg");
DestroyWindow(hdlg);
- g_hDlg = 0;
+ g_hDlg = nullptr;
}
break;
case IDCANCEL:
SavePosition(hdlg, "LoadDlg");
DestroyWindow(hdlg);
- g_hDlg = 0;
+ g_hDlg = nullptr;
break;
}
break;
@@ -433,7 +433,7 @@ INT_PTR SaveUserSessionHandles(WPARAM, LPARAM) return 1;
}
- g_hSDlg = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_SAVEDIALOG), 0, SaveSessionDlgProc);
+ g_hSDlg = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_SAVEDIALOG), nullptr, SaveSessionDlgProc);
return 0;
}
@@ -448,26 +448,26 @@ INT_PTR OpenSessionsManagerWindow(WPARAM, LPARAM) tszSession(db_get_wsa(NULL, MODNAME, "SessionDate_0")),
tszUserSession(db_get_wsa(NULL, MODNAME, "UserSessionDsc_0"));
if (g_bIncompletedSave || tszSession || tszUserSession) {
- g_hDlg = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_WLCMDIALOG), 0, LoadSessionDlgProc);
+ g_hDlg = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_WLCMDIALOG), nullptr, LoadSessionDlgProc);
return 0;
}
if (g_bOtherWarnings)
- MessageBox(NULL, TranslateT("No sessions to open"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
+ MessageBox(nullptr, TranslateT("No sessions to open"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
return 1;
}
int SaveSessionDate()
{
if (session_list[0] != 0) {
- int TimeSize = GetTimeFormat(LOCALE_USER_DEFAULT, 0/*TIME_NOSECONDS*/, NULL, NULL, NULL, 0);
+ int TimeSize = GetTimeFormat(LOCALE_USER_DEFAULT, 0/*TIME_NOSECONDS*/, nullptr, nullptr, nullptr, 0);
wchar_t *szTimeBuf = (wchar_t*)mir_alloc((TimeSize + 1)*sizeof(wchar_t));
- GetTimeFormat(LOCALE_USER_DEFAULT, 0/*TIME_NOSECONDS*/, NULL, NULL, szTimeBuf, TimeSize);
+ GetTimeFormat(LOCALE_USER_DEFAULT, 0/*TIME_NOSECONDS*/, nullptr, nullptr, szTimeBuf, TimeSize);
- int DateSize = GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, NULL, 0);
+ int DateSize = GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, nullptr, nullptr, nullptr, 0);
wchar_t *szDateBuf = (wchar_t*)mir_alloc((DateSize + 1)*sizeof(wchar_t));
- GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szDateBuf, DateSize);
+ GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, nullptr, nullptr, szDateBuf, DateSize);
int lenn = (DateSize + TimeSize + 5);
wchar_t *szSessionTime = (wchar_t*)mir_alloc(lenn*sizeof(wchar_t));
mir_snwprintf(szSessionTime, lenn, L"%s - %s", szTimeBuf, szDateBuf);
@@ -512,7 +512,7 @@ INT_PTR LoadLastSession(WPARAM wparam, LPARAM lparam) if (isLastTRUE)
return LoadSession(wparam, lparam);
if (g_bOtherWarnings)
- MessageBox(NULL, TranslateT("Last Sessions is empty"), TranslateT("Sessions Manager"), MB_OK);
+ MessageBox(nullptr, TranslateT("Last Sessions is empty"), TranslateT("Sessions Manager"), MB_OK);
return 0;
}
@@ -552,22 +552,22 @@ int LoadSession(WPARAM, LPARAM lparam) if (i == 0) {
if (g_bOtherWarnings)
- MessageBox(NULL, TranslateT("No contacts to open"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
+ MessageBox(nullptr, TranslateT("No contacts to open"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
return 1;
}
if (dup == i) {
if (!hidden[i]) {
if (g_bOtherWarnings)
- MessageBox(NULL, TranslateT("This Session already opened"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
+ MessageBox(nullptr, TranslateT("This Session already opened"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
return 1;
}
if (!g_bWarnOnHidden && g_bOtherWarnings) {
- MessageBox(NULL, TranslateT("This Session already opened"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
+ MessageBox(nullptr, TranslateT("This Session already opened"), TranslateT("Sessions Manager"), MB_OK | MB_ICONWARNING);
return 1;
}
if (g_bWarnOnHidden) {
- if (IDYES == MessageBox(NULL, TranslateT("This Session already opened (but probably hidden).\nDo you want to show hidden contacts?"), TranslateT("Sessions Manager"), MB_YESNO | MB_ICONQUESTION))
+ if (IDYES == MessageBox(nullptr, TranslateT("This Session already opened (but probably hidden).\nDo you want to show hidden contacts?"), TranslateT("Sessions Manager"), MB_YESNO | MB_ICONQUESTION))
for (j = 0; hidden[j] != 0; j++)
Clist_ContactDoubleClicked(session_list_t[hidden[j] - 1]);
}
@@ -660,7 +660,7 @@ int OkToExit(WPARAM, LPARAM) db_set_b(NULL, MODNAME, "lastempty", 0);
}
else if (exitmode == 1 && session_list[0] != 0) {
- DialogBox(g_hInst, MAKEINTRESOURCE(IDD_EXDIALOG), 0, ExitDlgProc);
+ DialogBox(g_hInst, MAKEINTRESOURCE(IDD_EXDIALOG), nullptr, ExitDlgProc);
}
else db_set_b(NULL, MODNAME, "lastempty", 1);
return 0;
@@ -691,7 +691,7 @@ INT_PTR BuildFavMenu(WPARAM, LPARAM) HMENU hMenu = CreatePopupMenu();
FillFavoritesMenu(hMenu, g_ses_count);
- int res = TrackPopupMenu(hMenu, TPM_RETURNCMD | TPM_NONOTIFY, pt.x, pt.y, 0, GetActiveWindow(), NULL);
+ int res = TrackPopupMenu(hMenu, TPM_RETURNCMD | TPM_NONOTIFY, pt.x, pt.y, 0, GetActiveWindow(), nullptr);
if (res == 0) return 1;
LoadSession(0, (res - 1) + g_ses_limit);
return 0;
@@ -699,7 +699,7 @@ INT_PTR BuildFavMenu(WPARAM, LPARAM) static int CreateButtons(WPARAM, LPARAM)
{
- TTBButton ttb = { 0 };
+ TTBButton ttb = {};
ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;
ttb.pszService = MS_SESSIONS_OPENMANAGER;
@@ -729,11 +729,11 @@ static void CALLBACK LaunchSessions() int startup = db_get_b(NULL, MODNAME, "StartupMode", 3);
if (startup == 1 || (startup == 3 && isLastTRUE == TRUE)) {
StartUp = TRUE;
- g_hDlg = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_WLCMDIALOG), 0, LoadSessionDlgProc);
+ g_hDlg = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_WLCMDIALOG), nullptr, LoadSessionDlgProc);
}
else if (startup == 2 && isLastTRUE == TRUE) {
g_hghostw = TRUE;
- g_hDlg = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_WLCMDIALOG), 0, LoadSessionDlgProc);
+ g_hDlg = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_WLCMDIALOG), nullptr, LoadSessionDlgProc);
}
}
@@ -787,7 +787,7 @@ static int PluginInit(WPARAM, LPARAM) SET_UID(mi, 0x73ea91d6, 0xb7e5, 0x4f67, 0x96, 0x96, 0xa, 0x24, 0x21, 0x48, 0x6f, 0x15);
mi.name.a = LPGEN("Close session");
mi.pszService = MS_SESSIONS_CLOSESESSION;
- mi.hIcolibItem = 0;
+ mi.hIcolibItem = nullptr;
Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0xe2c4e4ba, 0x5d08, 0x441b, 0xb5, 0x93, 0xc4, 0xe7, 0x9a, 0xfb, 0xa4, 0x6c);
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index e60515546b..cfc378ff6e 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -22,10 +22,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. HICON hIcon;
HICON hMarked, hNotMarked;
-HWND hComboBox = NULL;
-HWND hComboBoxEdit = NULL;
+HWND hComboBox = nullptr;
+HWND hComboBoxEdit = nullptr;
-HWND hOpClistControl = NULL;
+HWND hOpClistControl = nullptr;
static BOOL bOptionsInit;
int opses_count;
@@ -36,7 +36,7 @@ MCONTACT session_list_t[255] = { 0 }; HWND g_opHdlg;
int width;
-HDC hdc = NULL;
+HDC hdc = nullptr;
RECT lprect;
RECT rc;
POINT pt;
@@ -78,7 +78,7 @@ static LRESULT CALLBACK ComboBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, case WM_SETCURSOR:
if (!hOpClistControl) {
- SetCursor(LoadCursor(NULL, IDC_ARROW));
+ SetCursor(LoadCursor(nullptr, IDC_ARROW));
return TRUE;
}
break;
@@ -100,13 +100,13 @@ static LRESULT CALLBACK ComboBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, MarkUserDefSession(opses_count, 1);
hIcon = hMarked;
bChecked = TRUE;
- RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME);
+ RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME);
}
else {
MarkUserDefSession(opses_count, 0);
hIcon = hNotMarked;
bChecked = FALSE;
- RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME);
+ RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME);
}
break;
@@ -123,7 +123,7 @@ static LRESULT CALLBACK ComboBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, rc.left = rc.right;
rc.right = rc.left + 16;
FillRect(hdc, &rc, (HBRUSH)GetSysColor(COLOR_WINDOW));
- DrawIconEx(hdc, rc.left, 0, hIcon, 16, 16, 0, NULL, DI_NORMAL);
+ DrawIconEx(hdc, rc.left, 0, hIcon, 16, 16, 0, nullptr, DI_NORMAL);
ReleaseDC(hwnd, hdc);
break;
@@ -162,7 +162,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l SetDlgItemInt(hdlg, IDC_TRACK, g_ses_limit = db_get_b(NULL, MODNAME, "TrackCount", 10), FALSE);
SendDlgItemMessage(hdlg, IDC_SPIN1, UDM_SETRANGE, 0, MAKELONG(10, 1));
- SendDlgItemMessage(hdlg, IDC_SPIN1, UDM_SETPOS, 0, GetDlgItemInt(hdlg, IDC_TRACK, NULL, FALSE));
+ SendDlgItemMessage(hdlg, IDC_SPIN1, UDM_SETPOS, 0, GetDlgItemInt(hdlg, IDC_TRACK, nullptr, FALSE));
SendDlgItemMessage(hdlg, IDC_OPCLIST, LB_RESETCONTENT, 0, 0);
SetDlgItemInt(hdlg, IDC_STARTDELAY, db_get_w(NULL, MODNAME, "StartupModeDelay", 1500), FALSE);
@@ -223,7 +223,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l hComboBoxEdit = cbi.hwndItem;
hComboBox = cbi.hwndCombo;
- SetWindowPos(hComboBoxEdit, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
+ SetWindowPos(hComboBoxEdit, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
bOptionsInit = FALSE;
}
@@ -241,9 +241,9 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l switch (((LPNMHDR)lparam)->code) {
case PSN_APPLY:
{
- int iDelay = GetDlgItemInt(hdlg, IDC_STARTDELAY, NULL, FALSE);
+ int iDelay = GetDlgItemInt(hdlg, IDC_STARTDELAY, nullptr, FALSE);
db_set_w(0, MODNAME, "StartupModeDelay", (WORD)iDelay);
- db_set_b(0, MODNAME, "TrackCount", (BYTE)(g_ses_limit = GetDlgItemInt(hdlg, IDC_TRACK, NULL, FALSE)));
+ db_set_b(0, MODNAME, "TrackCount", (BYTE)(g_ses_limit = GetDlgItemInt(hdlg, IDC_TRACK, nullptr, FALSE)));
if (IsDlgButtonChecked(hdlg, IDC_REXSAVE))
db_set_b(NULL, MODNAME, "ShutdownMode", 2);
else if (IsDlgButtonChecked(hdlg, IDC_REXDSAVE))
@@ -303,12 +303,12 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l if (IsMarkedUserDefSession(opses_count)) {
hIcon = hMarked;
bChecked = TRUE;
- RedrawWindow(hComboBoxEdit, NULL, NULL, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
+ RedrawWindow(hComboBoxEdit, nullptr, nullptr, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
}
else {
hIcon = hNotMarked;
bChecked = FALSE;
- RedrawWindow(hComboBoxEdit, NULL, NULL, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
+ RedrawWindow(hComboBoxEdit, nullptr, nullptr, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
}
OpLoadSessionContacts(0, opses_count);
if (!hOpClistControl)
@@ -336,7 +336,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l SetDlgItemText(hdlg, IDC_EDIT, TranslateT("View"));
hOpClistControl = CreateWindowEx(WS_EX_STATICEDGE, CLISTCONTROL_CLASSW, L"",
WS_TABSTOP | WS_VISIBLE | WS_CHILD,
- 14, 198, 161, 163, hdlg, (HMENU)IDC_EMCLIST, g_hInst, 0);
+ 14, 198, 161, 163, hdlg, (HMENU)IDC_EMCLIST, g_hInst, nullptr);
SetWindowLongPtr(hOpClistControl, GWL_STYLE,
GetWindowLongPtr(hOpClistControl, GWL_STYLE) | CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE | CLS_GROUPCHECKBOXES);
@@ -354,7 +354,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l EnableWindow(GetDlgItem(hdlg, IDC_SAVE), FALSE);
SetDlgItemText(hdlg, IDC_EDIT, TranslateT("Edit"));
DestroyWindow(hOpClistControl);
- hOpClistControl = NULL;
+ hOpClistControl = nullptr;
}
break;
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index c0f2e5ea90..98f731bd2f 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -225,7 +225,7 @@ void SetInSessionOrder(MCONTACT hContact, int mode, int count, unsigned int orde BOOL ResaveSettings(char *szName, int iFirst, int iLimit, wchar_t *szBuffer)
{
for (int i = iFirst; i < iLimit; i++) {
- if (szBuffer == NULL)
+ if (szBuffer == nullptr)
break;
char szNameBuf[256];
@@ -238,7 +238,7 @@ BOOL ResaveSettings(char *szName, int iFirst, int iLimit, wchar_t *szBuffer) BYTE marked = IsMarkedUserDefSession(i);
MarkUserDefSession(i, (BYTE)((i == iFirst) ? IsMarkedUserDefSession(iFirst - 1) : marked));
- if (ptszTemp == NULL) // read failed
+ if (ptszTemp == nullptr) // read failed
return 0;
szBuffer = ptszTemp;
@@ -350,7 +350,7 @@ void OffsetWindow(HWND parent, HWND hwnd, int dx, int dy) rc.top = pt.y;
OffsetRect(&rc, dx, dy);
- SetWindowPos(hwnd, NULL, rc.left, rc.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
+ SetWindowPos(hwnd, nullptr, rc.left, rc.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
}
int CheckContactVisibility(MCONTACT hContact)
@@ -398,5 +398,5 @@ void LoadPosition(HWND hWnd, char *wndName) int x = db_get_dw(0, MODNAME, buffer, ((GetSystemMetrics(SM_CXSCREEN)) / 2) - 130);
mir_snprintf(buffer, "%sPosY", wndName);
int y = db_get_dw(0, MODNAME, buffer, ((GetSystemMetrics(SM_CYSCREEN)) / 2) - 80);
- SetWindowPos(hWnd, NULL, x, y, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOSIZE);
+ SetWindowPos(hWnd, nullptr, x, y, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOSIZE);
}
|