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/SimpleStatusMsg | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/SimpleStatusMsg')
-rw-r--r-- | plugins/SimpleStatusMsg/src/awaymsg.cpp | 36 | ||||
-rw-r--r-- | plugins/SimpleStatusMsg/src/main.cpp | 154 | ||||
-rw-r--r-- | plugins/SimpleStatusMsg/src/msgbox.cpp | 78 | ||||
-rw-r--r-- | plugins/SimpleStatusMsg/src/options.cpp | 58 | ||||
-rw-r--r-- | plugins/SimpleStatusMsg/src/utils.cpp | 6 |
5 files changed, 166 insertions, 166 deletions
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index f80213728b..37ae062f63 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -32,8 +32,8 @@ static MWindowList hWindowList, hWindowList2; static wchar_t *StrNormNewline(wchar_t *tszStr)
{
- if (tszStr == NULL)
- return NULL;
+ if (tszStr == nullptr)
+ return nullptr;
int nCR = 0;
for (int i = 0; tszStr[i]; i++)
@@ -76,7 +76,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP dat->hContact = lParam;
dat->hSeq = (HANDLE)ProtoChainSend(dat->hContact, PSS_GETAWAYMSG, 0, 0);
- dat->hAwayMsgEvent = dat->hSeq ? HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_AWAYMSG) : NULL;
+ dat->hAwayMsgEvent = dat->hSeq ? HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_AWAYMSG) : nullptr;
WindowList_Add(hWindowList, hwndDlg, dat->hContact);
{
wchar_t str[256], format[128];
@@ -112,7 +112,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP break;
if (dat->hAwayMsgEvent && ack->hProcess == dat->hSeq) {
UnhookEvent(dat->hAwayMsgEvent);
- dat->hAwayMsgEvent = NULL;
+ dat->hAwayMsgEvent = nullptr;
}
wchar_t *tszMsg = StrNormNewline((wchar_t *)ack->lParam);
@@ -143,7 +143,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP if (len) {
LPTSTR lptstrCopy;
HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t));
- if (hglbCopy == NULL) {
+ if (hglbCopy == nullptr) {
CloseClipboard();
break;
}
@@ -183,7 +183,7 @@ static INT_PTR GetMessageCommand(WPARAM wParam, LPARAM) SetForegroundWindow(hwnd);
SetFocus(hwnd);
}
- else CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_READAWAYMSG), NULL, ReadAwayMsgDlgProc, wParam);
+ else CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_READAWAYMSG), nullptr, ReadAwayMsgDlgProc, wParam);
return 0;
}
@@ -200,7 +200,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP dat->hContact = lParam;
dat->hSeq = (HANDLE)ProtoChainSend(dat->hContact, PSS_GETAWAYMSG, 0, 0);
- dat->hAwayMsgEvent = dat->hSeq ? HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_AWAYMSG) : NULL;
+ dat->hAwayMsgEvent = dat->hSeq ? HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_AWAYMSG) : nullptr;
WindowList_Add(hWindowList2, hwndDlg, dat->hContact);
wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
wchar_t str[256], format[128];
@@ -225,7 +225,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP }
if (dat->hAwayMsgEvent && ack->hProcess == dat->hSeq) {
UnhookEvent(dat->hAwayMsgEvent);
- dat->hAwayMsgEvent = NULL;
+ dat->hAwayMsgEvent = nullptr;
}
if (!OpenClipboard(hwndDlg)) {
@@ -241,7 +241,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP if (len) {
LPTSTR lptstrCopy;
HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t));
- if (hglbCopy == NULL) {
+ if (hglbCopy == nullptr) {
CloseClipboard();
DestroyWindow(hwndDlg);
break;
@@ -288,21 +288,21 @@ static INT_PTR CopyAwayMsgCommand(WPARAM wParam, LPARAM) SetFocus(hwnd);
}
else
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_COPY), NULL, CopyAwayMsgDlgProc, wParam);
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_COPY), nullptr, CopyAwayMsgDlgProc, wParam);
return 0;
}
static char *StrFindURL(char *pszStr)
{
- char *pszURL = NULL;
+ char *pszURL = nullptr;
- if (pszStr != NULL && *pszStr != '\0') {
+ if (pszStr != nullptr && *pszStr != '\0') {
pszURL = strstr(pszStr, "www.");
- if (pszURL == NULL)
+ if (pszURL == nullptr)
pszURL = strstr(pszStr, "http://");
- if (pszURL == NULL)
+ if (pszURL == nullptr)
pszURL = strstr(pszStr, "https://");
- if (pszURL == NULL)
+ if (pszURL == nullptr)
pszURL = strstr(pszStr, "ftp://");
}
@@ -314,7 +314,7 @@ static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM) ptrA szMsg(db_get_sa(wParam, "CList", "StatusMsg"));
char *szURL = StrFindURL(szMsg);
- if (szURL != NULL) {
+ if (szURL != nullptr) {
int i;
for (i = 0; szURL[i] != ' ' && szURL[i] != '\n' && szURL[i] != '\r' && szURL[i] != '\t' && szURL[i] != '\0'; i++);
@@ -336,7 +336,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) Menu_ShowItem(hAwayMsgMenuItem, false);
char *szProto = GetContactProto(hContact);
- if (szProto == NULL || db_get_b(hContact, szProto, "ChatRoom", 0))
+ if (szProto == nullptr || db_get_b(hContact, szProto, "ChatRoom", 0))
return 0;
wchar_t str[128];
@@ -353,7 +353,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) mir_snwprintf(str, TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hCopyMsgMenuItem, str);
- if (StrFindURL(szMsg) != NULL) {
+ if (StrFindURL(szMsg) != nullptr) {
mir_snwprintf(str, TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hGoToURLMenuItem, str);
}
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 48b7a21ecd..f1fc07fed6 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -29,7 +29,7 @@ PROTOACCOUNTS *accounts; static int g_iIdleTime = -1;
UINT_PTR g_uUpdateMsgTimer = 0, *g_uSetStatusTimer;
static wchar_t *g_ptszWinampSong;
-HANDLE hTTBButton = 0, h_statusmodechange;
+HANDLE hTTBButton = nullptr, h_statusmodechange;
HWND hwndSAMsgDialog;
static HANDLE *hProtoStatusMenuItem;
@@ -66,14 +66,14 @@ void log2file(const char *fmt, ...) DWORD dwBytesWritten;
va_list va;
char szText[1024];
- HANDLE hFile = CreateFileA("simplestatusmsg.log", GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- SetFilePointer(hFile, 0, 0, FILE_END);
+ HANDLE hFile = CreateFileA("simplestatusmsg.log", GENERIC_WRITE, FILE_SHARE_READ, nullptr, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
+ SetFilePointer(hFile, 0, nullptr, FILE_END);
strncpy(szText, "[\0", _countof(szText));
- WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, NULL);
+ WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, nullptr);
- GetTimeFormatA(LOCALE_USER_DEFAULT, 0, NULL, NULL, szText, _countof(szText));
- WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, NULL);
+ GetTimeFormatA(LOCALE_USER_DEFAULT, 0, nullptr, nullptr, szText, _countof(szText));
+ WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, nullptr);
strncpy(szText, "] \0", _countof(szText));
@@ -81,10 +81,10 @@ void log2file(const char *fmt, ...) mir_vsnprintf(szText + mir_strlen(szText), _countof(szText) - mir_strlen(szText), fmt, va);
va_end(va);
- WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, NULL);
+ WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, nullptr);
strncpy(szText, "\n\0", _countof(szText));
- WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, NULL);
+ WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, nullptr);
CloseHandle(hFile);
}
@@ -92,51 +92,51 @@ void log2file(const char *fmt, ...) static wchar_t *GetWinampSong(void)
{
- wchar_t *szTitle, *pstr, *res = NULL;
- HWND hwndWinamp = FindWindow(L"STUDIO", NULL);
+ wchar_t *szTitle, *pstr, *res = nullptr;
+ HWND hwndWinamp = FindWindow(L"STUDIO", nullptr);
int iTitleLen;
- if (hwndWinamp == NULL)
- hwndWinamp = FindWindow(L"Winamp v1.x", NULL);
+ if (hwndWinamp == nullptr)
+ hwndWinamp = FindWindow(L"Winamp v1.x", nullptr);
- if (hwndWinamp == NULL)
- return NULL;
+ if (hwndWinamp == nullptr)
+ return nullptr;
iTitleLen = GetWindowTextLength(hwndWinamp);
szTitle = (wchar_t *)mir_alloc((iTitleLen + 1) * sizeof(wchar_t));
- if (szTitle == NULL)
- return NULL;
+ if (szTitle == nullptr)
+ return nullptr;
if (GetWindowText(hwndWinamp, szTitle, iTitleLen + 1) == 0)
{
mir_free(szTitle);
- return NULL;
+ return nullptr;
}
pstr = wcsstr(szTitle, L" - Winamp");
- if (pstr == NULL)
+ if (pstr == nullptr)
{
mir_free(szTitle);
- return NULL;
+ return nullptr;
}
if (pstr < szTitle + (iTitleLen / 2))
{
memmove(szTitle, pstr + 9, mir_wstrlen(pstr + 9) * sizeof(wchar_t));
pstr = wcsstr(pstr + 1, L" - Winamp");
- if (pstr == NULL)
+ if (pstr == nullptr)
{
mir_free(szTitle);
- return NULL;
+ return nullptr;
}
}
*pstr = 0;
pstr = wcschr(szTitle, '.');
- if (pstr == NULL)
+ if (pstr == nullptr)
{
mir_free(szTitle);
- return NULL;
+ return nullptr;
}
pstr += 2;
@@ -181,7 +181,7 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) {
wchar_t *ptszWinampTitle = GetWinampSong();
- if (ptszWinampTitle != NULL)
+ if (ptszWinampTitle != nullptr)
{
mir_free(g_ptszWinampSong);
g_ptszWinampSong = mir_wstrdup(ptszWinampTitle);
@@ -225,9 +225,9 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) }
t.wMinute = mm % 60;
t.wHour = mm / 60;
- GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &t, NULL, substituteStr, _countof(substituteStr));
+ GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &t, nullptr, substituteStr, _countof(substituteStr));
}
- else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, substituteStr, _countof(substituteStr));
+ else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, nullptr, nullptr, substituteStr, _countof(substituteStr));
if (mir_wstrlen(substituteStr) > 6)
msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(substituteStr) - 6) * sizeof(wchar_t));
@@ -237,7 +237,7 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) }
else if (!wcsnicmp(msg + i, L"%date%", 6))
{
- GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, _countof(substituteStr));
+ GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, nullptr, nullptr, substituteStr, _countof(substituteStr));
if (mir_wstrlen(substituteStr) > 6)
msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(substituteStr) - 6) * sizeof(wchar_t));
@@ -253,7 +253,7 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) temp = mir_wstrdup(msg + i + 6);
token = wcstok(temp, L",)");
ran_from = _wtoi(token);
- token = wcstok(NULL, L",)%%");
+ token = wcstok(nullptr, L",)%%");
ran_to = _wtoi(token);
if (ran_to > ran_from)
@@ -290,7 +290,7 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) mir_snprintf(buff, "SMsg%d", k);
wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff);
- if (tszStatusMsg == NULL)
+ if (tszStatusMsg == nullptr)
continue;
mir_wstrcpy(substituteStr, tszStatusMsg);
@@ -299,7 +299,7 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) if (!mir_wstrlen(substituteStr))
continue;
- if (wcsstr(substituteStr, L"%randmsg%") != NULL || wcsstr(substituteStr, L"%randdefmsg%") != NULL)
+ if (wcsstr(substituteStr, L"%randmsg%") != nullptr || wcsstr(substituteStr, L"%randdefmsg%") != nullptr)
{
if (k == maxk) maxk--;
}
@@ -335,7 +335,7 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) mir_snprintf(buff, "DefMsg%d", k);
wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff);
- if (tszStatusMsg == NULL)
+ if (tszStatusMsg == nullptr)
continue;
mir_wstrcpy(substituteStr, tszStatusMsg);
@@ -344,7 +344,7 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) if (!mir_wstrlen(substituteStr))
continue;
- if (wcsstr(substituteStr, L"%randmsg%") != NULL || wcsstr(substituteStr, L"%randdefmsg%") != NULL)
+ if (wcsstr(substituteStr, L"%randmsg%") != nullptr || wcsstr(substituteStr, L"%randdefmsg%") != nullptr)
{
if (k == maxk) maxk--;
}
@@ -382,8 +382,8 @@ wchar_t *InsertVarsIntoMsg(wchar_t *tszMsg, const char *szProto, int iStatus, MC {
if (ServiceExists(MS_VARS_FORMATSTRING) && db_get_b(NULL, "SimpleStatusMsg", "EnableVariables", 1))
{
- wchar_t *tszVarsMsg = variables_parse(tszMsg, NULL, hContact);
- if (tszVarsMsg != NULL)
+ wchar_t *tszVarsMsg = variables_parse(tszMsg, nullptr, hContact);
+ if (tszVarsMsg != nullptr)
{
wchar_t *format = InsertBuiltinVarsIntoMsg(tszVarsMsg, szProto, iStatus);
mir_free(tszVarsMsg);
@@ -423,8 +423,8 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto) mir_snprintf(szSetting, "LastMsg");
char *szLastMsg = db_get_sa(NULL, "SimpleStatusMsg", szSetting);
- if (szLastMsg == NULL)
- return NULL; //mir_wstrdup(L"");
+ if (szLastMsg == nullptr)
+ return nullptr; //mir_wstrdup(L"");
format = db_get_wsa(NULL, "SimpleStatusMsg", szLastMsg);
mir_free(szLastMsg);
@@ -437,7 +437,7 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto) mir_snprintf(szSetting, "Default");
format = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting));
- if (format == NULL)
+ if (format == nullptr)
format = mir_wstrdup(L"");
}
else
@@ -520,7 +520,7 @@ static wchar_t *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVar iStatus = GetCurrentStatus(szProto);
if (szProto && !(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus)))
- return NULL;
+ return nullptr;
mir_snprintf(szSetting, "Proto%sFlags", szProto ? szProto : "");
int flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
@@ -534,7 +534,7 @@ static wchar_t *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVar {
mir_snprintf(szSetting, "Proto%sDefault", szProto);
format = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
- if (format == NULL)
+ if (format == nullptr)
format = mir_wstrdup(L"");
}
else if (flags & PROTO_NOCHANGE && szProto)
@@ -545,13 +545,13 @@ static wchar_t *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVar else if (flags & PROTO_POPUPDLG)
format = GetAwayMessageFormat(iStatus, szProto);
else
- format = NULL;
+ format = nullptr;
}
#ifdef _DEBUG
log2file("GetAwayMessage(): %s has %s status and \"%S\" status message.", szProto, StatusModeToDbSetting(iStatus, ""), format);
#endif
- if (bInsertVars && format != NULL)
+ if (bInsertVars && format != nullptr)
{
wchar_t *tszVarsMsg = InsertVarsIntoMsg(format, szProto, iStatus, hContact); // TODO random values not the same!
mir_free(format);
@@ -601,7 +601,7 @@ static void Proto_SetStatus(const char *szProto, int iInitialStatus, int iStatus CallProtoService(szProto, PS_SETSTATUS, (WPARAM)iMsgStatus, 0);
}
if (ServiceExists(MS_KS_ANNOUNCESTATUSCHANGE))
- announce_status_change((char*)szProto, ID_STATUS_OFFLINE, NULL);
+ announce_status_change((char*)szProto, ID_STATUS_OFFLINE, nullptr);
CallProtoService(szProto, PS_SETSTATUS, ID_STATUS_OFFLINE, 0);
return;
}
@@ -619,16 +619,16 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus if (flags & PROTO_NO_MSG)
{
- Proto_SetStatus(szProto, iInitialStatus, iStatus, NULL);
- SaveMessageToDB(szProto, NULL, TRUE);
- SaveMessageToDB(szProto, NULL, FALSE);
+ Proto_SetStatus(szProto, iInitialStatus, iStatus, nullptr);
+ SaveMessageToDB(szProto, nullptr, TRUE);
+ SaveMessageToDB(szProto, nullptr, FALSE);
return 1;
}
else if (flags & PROTO_THIS_MSG)
{
mir_snprintf(szSetting, "Proto%sDefault", szProto);
wchar_t *szSimpleStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
- if (szSimpleStatusMsg != NULL)
+ if (szSimpleStatusMsg != nullptr)
{
SaveMessageToDB(szProto, szSimpleStatusMsg, TRUE);
wchar_t *msg = InsertVarsIntoMsg(szSimpleStatusMsg, szProto, iStatus, NULL);
@@ -679,7 +679,7 @@ INT_PTR SetStatusModeFromExtern(WPARAM wParam, LPARAM lParam) if ((Proto_Status2Flag(newStatus) & status_modes_msg) || (newStatus == ID_STATUS_OFFLINE && (Proto_Status2Flag(ID_STATUS_INVISIBLE) & status_modes_msg)))
{
- wchar_t *msg = NULL;
+ wchar_t *msg = nullptr;
if (HasProtoStaticStatusMsg(accounts->pa[i]->szModuleName, GetCurrentStatus(accounts->pa[i]->szModuleName), newStatus))
continue;
@@ -703,7 +703,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam); void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, wchar_t *message, BOOL bOnStartup)
{
- wchar_t *msg = NULL;
+ wchar_t *msg = nullptr;
#ifdef _DEBUG
log2file("SetStatusMessage(\"%s\", %d, %d, \"%S\", %d)", szProto, iInitialStatus, iStatus, message, bOnStartup);
#endif
@@ -807,7 +807,7 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, wcha mir_free(msg);
}
- if (GetCurrentStatus(NULL) != iStatus && !bIsStatusCurrent && !iProfileStatus)
+ if (GetCurrentStatus(nullptr) != iStatus && !bIsStatusCurrent && !iProfileStatus)
{
// not so nice...
UnhookEvent(h_statusmodechange);
@@ -878,7 +878,7 @@ INT_PTR ShowStatusMessageDialogInternal(WPARAM, LPARAM lParam) }
if (!idvstatusmsg)
{
- box_data->m_szProto = NULL;
+ box_data->m_szProto = nullptr;
box_data->m_iStatusModes = accounts->statusFlags;
box_data->m_iStatusMsgModes = accounts->statusMsgFlags;
}
@@ -889,7 +889,7 @@ INT_PTR ShowStatusMessageDialogInternal(WPARAM, LPARAM lParam) if (hwndSAMsgDialog)
DestroyWindow(hwndSAMsgDialog);
- hwndSAMsgDialog = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_AWAYMSGBOX), NULL, AwayMsgBoxDlgProc, (LPARAM)box_data);
+ hwndSAMsgDialog = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_AWAYMSGBOX), nullptr, AwayMsgBoxDlgProc, (LPARAM)box_data);
return 0;
}
@@ -928,7 +928,7 @@ INT_PTR ShowStatusMessageDialog(WPARAM, LPARAM lParam) }
if (!idvstatusmsg)
{
- box_data->m_szProto = NULL;
+ box_data->m_szProto = nullptr;
box_data->m_iStatusModes = accounts->statusFlags;
box_data->m_iStatusMsgModes = accounts->statusMsgFlags;
}
@@ -938,7 +938,7 @@ INT_PTR ShowStatusMessageDialog(WPARAM, LPARAM lParam) if (hwndSAMsgDialog)
DestroyWindow(hwndSAMsgDialog);
- hwndSAMsgDialog = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_AWAYMSGBOX), NULL, AwayMsgBoxDlgProc, (LPARAM)box_data);
+ hwndSAMsgDialog = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_AWAYMSGBOX), nullptr, AwayMsgBoxDlgProc, (LPARAM)box_data);
return 0;
}
@@ -954,7 +954,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) // TODO this could be done better
BOOL bOnStartup = FALSE, bGlobalStartupStatus = TRUE;
if (szProto && !mir_strcmp(szProto, "SimpleStatusMsgGlobalStartupStatus")) {
- szProto = NULL;
+ szProto = nullptr;
bOnStartup = TRUE;
}
@@ -1050,7 +1050,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) if (hwndSAMsgDialog)
DestroyWindow(hwndSAMsgDialog);
- hwndSAMsgDialog = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_AWAYMSGBOX), NULL, AwayMsgBoxDlgProc, (LPARAM)box_data);
+ hwndSAMsgDialog = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_AWAYMSGBOX), nullptr, AwayMsgBoxDlgProc, (LPARAM)box_data);
}
else {
// iStatus == ID_STATUS_CURRENT only when bOnStartup == TRUE
@@ -1079,7 +1079,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) msg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
}
else
- msg = GetAwayMessageFormat(iStatus, NULL);
+ msg = GetAwayMessageFormat(iStatus, nullptr);
#ifdef _DEBUG
log2file("ChangeStatusMessage(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, accounts->pa[i]->szModuleName);
#endif
@@ -1091,7 +1091,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) }
MsgBoxInitData *box_data = (MsgBoxInitData*)mir_alloc( sizeof(MsgBoxInitData));
- box_data->m_szProto = NULL;
+ box_data->m_szProto = nullptr;
box_data->m_iStatus = iStatus;
box_data->m_iStatusModes = accounts->statusFlags;
box_data->m_iStatusMsgModes = accounts->statusMsgFlags;
@@ -1100,7 +1100,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) if (hwndSAMsgDialog)
DestroyWindow(hwndSAMsgDialog);
- hwndSAMsgDialog = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_AWAYMSGBOX), NULL, AwayMsgBoxDlgProc, (LPARAM)box_data);
+ hwndSAMsgDialog = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_AWAYMSGBOX), nullptr, AwayMsgBoxDlgProc, (LPARAM)box_data);
}
return 0;
}
@@ -1134,7 +1134,7 @@ static int ProcessProtoAck(WPARAM , LPARAM lParam) int SetStartupStatus(int i)
{
char szSetting[80];
- wchar_t *fmsg, *msg = NULL;
+ wchar_t *fmsg, *msg = nullptr;
int iStatus = GetStartupStatus(accounts->pa[i]->szModuleName);
if (iStatus == ID_STATUS_OFFLINE)
@@ -1154,7 +1154,7 @@ int SetStartupStatus(int i) if (HasProtoStaticStatusMsg(accounts->pa[i]->szModuleName, ID_STATUS_OFFLINE, iStatus))
return 0;
else
- fmsg = NULL;
+ fmsg = nullptr;
}
else if (flags & PROTO_NOCHANGE)
{
@@ -1253,7 +1253,7 @@ VOID CALLBACK SetStartupStatusProc(HWND hwnd, UINT, UINT_PTR idEvent, DWORD) if (g_uSetStatusTimer[i] == idEvent)
{
- KillTimer(NULL, g_uSetStatusTimer[i]);
+ KillTimer(nullptr, g_uSetStatusTimer[i]);
found = true;
break;
}
@@ -1297,7 +1297,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) mir_snprintf(szBuffer, "FCur%sMsg", accounts->pa[i]->szModuleName);
wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szBuffer);
- if (tszStatusMsg == NULL)
+ if (tszStatusMsg == nullptr)
continue;
tszMsg = InsertVarsIntoMsg(tszStatusMsg, accounts->pa[i]->szModuleName, iCurrentStatus, NULL);
@@ -1330,7 +1330,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) static int AddTopToolbarButton(WPARAM, LPARAM)
{
- TTBButton tbb = { 0 };
+ TTBButton tbb = {};
tbb.hIconHandleUp = tbb.hIconHandleDn = GetIconHandle(IDI_CSMSG);
tbb.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
tbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
@@ -1492,14 +1492,14 @@ static int CSStatusChange(WPARAM wParam, LPARAM) PROTOCOLSETTINGEX **ps = *(PROTOCOLSETTINGEX***)wParam;
int status_mode, CSProtoCount;
char szSetting[80];
- wchar_t *msg = NULL;
+ wchar_t *msg = nullptr;
- if (ps == NULL) return -1;
+ if (ps == nullptr) return -1;
CSProtoCount = CallService(MS_CS_GETPROTOCOUNT, 0, 0);
for (int i = 0; i < CSProtoCount; ++i)
{
- if (ps[i]->m_szName == NULL || !*ps[i]->m_szName) continue;
+ if (ps[i]->m_szName == nullptr || !*ps[i]->m_szName) continue;
if (ps[i]->m_status == ID_STATUS_IDLE)
status_mode = ps[i]->m_lastStatus;
else if (ps[i]->m_status == ID_STATUS_CURRENT)
@@ -1527,7 +1527,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM) {
mir_snprintf(buff, "SMsg%d", j);
wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff);
- if (tszStatusMsg != NULL)
+ if (tszStatusMsg != nullptr)
{
if (!mir_wstrcmp(tszStatusMsg, szMsgW))
{
@@ -1567,12 +1567,12 @@ static int CSStatusChange(WPARAM wParam, LPARAM) static wchar_t *ParseWinampSong(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
- return NULL;
+ return nullptr;
ai->flags |= AIF_DONTPARSE;
wchar_t *ptszWinampTitle = GetWinampSong();
- if (ptszWinampTitle != NULL) {
+ if (ptszWinampTitle != nullptr) {
mir_free(g_ptszWinampSong);
g_ptszWinampSong = mir_wstrdup(ptszWinampTitle);
}
@@ -1585,11 +1585,11 @@ static wchar_t *ParseWinampSong(ARGUMENTSINFO *ai) static wchar_t *ParseDate(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
- return NULL;
+ return nullptr;
wchar_t szStr[128] = {0};
ai->flags |= AIF_DONTPARSE;
- GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szStr, _countof(szStr));
+ GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, nullptr, nullptr, szStr, _countof(szStr));
return mir_wstrdup(szStr);
}
@@ -1715,11 +1715,11 @@ static int OnModulesLoaded(WPARAM, LPARAM) }
g_ptszWinampSong = db_get_wsa(NULL, "SimpleStatusMsg", "AmpLastTitle");
- if (g_ptszWinampSong == NULL)
+ if (g_ptszWinampSong == nullptr)
g_ptszWinampSong = mir_wstrdup(L"SimpleStatusMsg");
if (db_get_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1))
- g_uUpdateMsgTimer = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10) * 1000, UpdateMsgTimerProc);
+ g_uUpdateMsgTimer = SetTimer(nullptr, 0, db_get_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10) * 1000, UpdateMsgTimerProc);
if (ServiceExists(MS_CS_SETSTATUSEX))
HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChange);
@@ -1729,7 +1729,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) if (!ServiceExists(MS_SS_GETPROFILECOUNT)) {
if (db_get_b(NULL, "SimpleStatusMsg", "GlobalStatusDelay", 1))
- SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "SetStatusDelay", 300), SetStartupStatusGlobal);
+ SetTimer(nullptr, 0, db_get_w(NULL, "SimpleStatusMsg", "SetStatusDelay", 300), SetStartupStatusGlobal);
else {
g_uSetStatusTimer = (UINT_PTR *)mir_alloc(sizeof(UINT_PTR) * accounts->count);
for (int i = 0; i < accounts->count; ++i) {
@@ -1741,7 +1741,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) char szSetting[80];
mir_snprintf(szSetting, "Set%sStatusDelay", accounts->pa[i]->szModuleName);
- g_uSetStatusTimer[i] = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", szSetting, 300), SetStartupStatusProc);
+ g_uSetStatusTimer[i] = SetTimer(nullptr, 0, db_get_w(NULL, "SimpleStatusMsg", szSetting, 300), SetStartupStatusProc);
}
}
}
@@ -1782,7 +1782,7 @@ static int OnPreShutdown(WPARAM, LPARAM) if (hProtoStatusMenuItem) mir_free(hProtoStatusMenuItem);
if (g_uSetStatusTimer) mir_free(g_uSetStatusTimer);
if (g_ptszWinampSong) mir_free(g_ptszWinampSong);
- if (g_uUpdateMsgTimer) KillTimer(NULL, g_uUpdateMsgTimer);
+ if (g_uUpdateMsgTimer) KillTimer(nullptr, g_uUpdateMsgTimer);
return 0;
}
@@ -1798,7 +1798,7 @@ extern "C" int __declspec(dllexport) Load(void) mir_getLP(&pluginInfo);
pcli = Clist_GetInterface();
- hwndSAMsgDialog = NULL;
+ hwndSAMsgDialog = nullptr;
accounts = (PROTOACCOUNTS *)mir_alloc(sizeof(PROTOACCOUNTS));
db_set_w(NULL, "CList", "Status", (WORD)ID_STATUS_OFFLINE);
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index debf97e35b..d35a8eb527 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -102,11 +102,11 @@ HWND WINAPI CreateStatusComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) wchar_t *status_desc; if (!(data->m_iDlgFlags & DLG_SHOW_STATUS)) - return NULL; + return nullptr; - HWND handle = CreateWindowEx(0, WC_COMBOBOXEX, NULL, + HWND handle = CreateWindowEx(0, WC_COMBOBOXEX, nullptr, WS_TABSTOP | CBS_NOINTEGRALHEIGHT | WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST, - 0, 0, 0, 240, hwndDlg, NULL, g_hInst, NULL); + 0, 0, 0, 240, hwndDlg, nullptr, g_hInst, nullptr); COMBOBOXEXITEM cbei = {0}; if (!(data->m_iDlgFlags & DLG_SHOW_STATUS_ICONS)) @@ -177,7 +177,7 @@ HWND WINAPI CreateStatusComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) cbei.iItem = j; cbei.pszText = (LPTSTR)tszProfileName; if (data->m_iDlgFlags & DLG_SHOW_STATUS_ICONS) { - int k = GetCurrentStatus(NULL) - ID_STATUS_OFFLINE; + int k = GetCurrentStatus(nullptr) - ID_STATUS_OFFLINE; if (k < 0 || k > 9) k = 0; // valid status modes only cbei.iImage = statusicon_nr[k]; @@ -199,7 +199,7 @@ HWND WINAPI CreateStatusComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) SendMessage(handle, CB_SETITEMHEIGHT, 0, (LPARAM)18); SendMessage(handle, CBEM_SETIMAGELIST, 0, (LPARAM)data->status_icons); } - SetWindowPos(handle, NULL, 11, 11, 112, 20, SWP_NOACTIVATE); + SetWindowPos(handle, nullptr, 11, 11, 112, 20, SWP_NOACTIVATE); SendMessage(handle, CB_SETCURSEL, (WPARAM)cur_sel, 0); SendMessage(handle, CB_SETITEMHEIGHT, (WPARAM)-1, (LPARAM)16); @@ -219,9 +219,9 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) BOOL found = FALSE; wchar_t text[128]; - HWND handle = CreateWindowEx(0, WC_COMBOBOXEX, NULL, + HWND handle = CreateWindowEx(0, WC_COMBOBOXEX, nullptr, WS_TABSTOP | CBS_NOINTEGRALHEIGHT | WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST, - 0, 0, 0, 300, hwndDlg, NULL, g_hInst, NULL); + 0, 0, 0, 300, hwndDlg, nullptr, g_hInst, nullptr); COMBOBOXEXITEM cbei = {0}; if (!(data->m_iDlgFlags & DLG_SHOW_LIST_ICONS)) @@ -239,7 +239,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) j--; wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff); - if (tszStatusMsg != NULL) { + if (tszStatusMsg != nullptr) { if (*tszStatusMsg != '\0') { found = TRUE; cbei.iItem = -1; @@ -333,7 +333,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) // predefined messages mir_snprintf(buff, "DefMsg%d", i); wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff); - if (tszStatusMsg != NULL) { + if (tszStatusMsg != nullptr) { if (*tszStatusMsg != '\0') { cbei.iItem = -1; cbei.pszText = tszStatusMsg; @@ -370,11 +370,11 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) if (data->m_iDlgFlags & DLG_SHOW_LIST_ICONS) SendMessage(handle, CBEM_SETIMAGELIST, 0, (LPARAM)data->other_icons); if (!(data->m_iDlgFlags & DLG_SHOW_STATUS)) { - SetWindowPos(handle, NULL, 11, 11, 290, 20, SWP_NOACTIVATE); + SetWindowPos(handle, nullptr, 11, 11, 290, 20, SWP_NOACTIVATE); SendMessage(handle, CB_SETDROPPEDWIDTH, (WPARAM)290, 0); } else { - SetWindowPos(handle, NULL, 127, 11, 174, 20, SWP_NOACTIVATE); + SetWindowPos(handle, nullptr, 127, 11, 174, 20, SWP_NOACTIVATE); SendMessage(handle, CB_SETDROPPEDWIDTH, (WPARAM)250, 0); } SendMessage(handle, CB_SETITEMHEIGHT, (WPARAM)-1, (LPARAM)16); @@ -392,7 +392,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control) { HMENU hmenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_EDITMENU)); - if (hmenu == NULL) + if (hmenu == nullptr) return; HMENU hmenuTrackPopup = GetSubMenu(hmenu, 0); @@ -401,7 +401,7 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control) ClientToScreen(hwnd, (LPPOINT)&pt); - LPDWORD sel_s = NULL, sel_e = NULL; + LPDWORD sel_s = nullptr, sel_e = nullptr; SendMessage(edit_control, EM_GETSEL, (WPARAM)&sel_s, (LPARAM)&sel_e); if (sel_s == sel_e) { EnableMenuItem(hmenuTrackPopup, IDM_COPY, MF_BYCOMMAND | MF_GRAYED); @@ -417,7 +417,7 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control) DeleteMenu(hmenuTrackPopup, 7, MF_BYPOSITION); - int m_selection = TrackPopupMenu(hmenuTrackPopup, TPM_LEFTALIGN | TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, NULL); + int m_selection = TrackPopupMenu(hmenuTrackPopup, TPM_LEFTALIGN | TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, nullptr); switch (m_selection) { case IDM_COPY: SendMessage(edit_control, WM_COPY, 0, 0); @@ -454,8 +454,8 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control) vhi.cbSize = sizeof(vhi); vhi.flags = VHF_FULLDLG | VHF_SETLASTSUBJECT; vhi.hwndCtrl = edit_control; - vhi.szSubjectDesc = NULL; - vhi.szExtraTextDesc = NULL; + vhi.szSubjectDesc = nullptr; + vhi.szExtraTextDesc = nullptr; CallService(MS_VARS_SHOWHELPEX, (WPARAM)hwnd, (LPARAM)&vhi); } break; @@ -472,7 +472,7 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control) if (len) { LPTSTR lptstrCopy; HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t)); - if (hglbCopy == NULL) { + if (hglbCopy == nullptr) { CloseClipboard(); break; } @@ -551,7 +551,7 @@ static LRESULT CALLBACK EditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L case WM_LBUTTONDBLCLK: { MsgEditCtrl *mec = (MsgEditCtrl *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - if (mec != NULL) { + if (mec != nullptr) { mec->ctLastDblClk = clock(); mec->uClocksPerDblClk = GetDoubleClickTime() * CLOCKS_PER_SEC / 1000; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)mec); @@ -562,7 +562,7 @@ static LRESULT CALLBACK EditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L case WM_LBUTTONDOWN: { MsgEditCtrl *mec = (MsgEditCtrl *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - if (mec != NULL && UINT(clock() - mec->ctLastDblClk) < mec->uClocksPerDblClk) { + if (mec != nullptr && UINT(clock() - mec->ctLastDblClk) < mec->uClocksPerDblClk) { SendMessage(hwndDlg, EM_SETSEL, 0, -1); return 0; } @@ -580,7 +580,7 @@ static LRESULT CALLBACK EditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L { MsgEditCtrl *mec = (MsgEditCtrl *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); mir_free(mec); - mec = NULL; + mec = nullptr; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)mec); break; } @@ -714,10 +714,10 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) mir_snprintf(setting, "LastMsg"); char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting); - if (szSetting != NULL) { + if (szSetting != nullptr) { if (*szSetting != '\0') { wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting); - if (tszStatusMsg != NULL) { + if (tszStatusMsg != nullptr) { if (*tszStatusMsg != '\0') { SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg); fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)tszStatusMsg); @@ -746,7 +746,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) mir_snprintf(setting, "Default"); wchar_t *tszStatusMsg = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting)); - if (tszStatusMsg != NULL) { + if (tszStatusMsg != nullptr) { SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg); fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)tszStatusMsg); if (fcursel != CB_ERR) @@ -761,7 +761,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) mir_snprintf(setting, "Msg"); wchar_t *tszStatusMsg = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting)); - if (tszStatusMsg != NULL) { + if (tszStatusMsg != nullptr) { SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg); fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)tszStatusMsg); if (fcursel != CB_ERR) @@ -802,7 +802,7 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) if (iStatus == ID_STATUS_CURRENT) iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(msgbox_data->m_szProto) : GetCurrentStatus(msgbox_data->m_szProto); else if (iStatus > ID_STATUS_CURRENT) - iStatus = GetCurrentStatus(NULL); + iStatus = GetCurrentStatus(nullptr); Window_FreeIcon_IcoLib(hwndDlg); Window_SetProtoIcon_IcoLib(hwndDlg, msgbox_data->m_szProto, iStatus); @@ -974,8 +974,8 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA } } else { - SetWindowPos(GetDlgItem(hwndDlg, IDC_OK), NULL, 52, 115, 0, 0, SWP_NOSIZE | SWP_NOZORDER); - SetWindowPos(GetDlgItem(hwndDlg, IDC_CANCEL), NULL, 160, 115, 0, 0, SWP_NOSIZE | SWP_NOZORDER); + SetWindowPos(GetDlgItem(hwndDlg, IDC_OK), nullptr, 52, 115, 0, 0, SWP_NOSIZE | SWP_NOZORDER); + SetWindowPos(GetDlgItem(hwndDlg, IDC_CANCEL), nullptr, 160, 115, 0, 0, SWP_NOSIZE | SWP_NOZORDER); ShowWindow(GetDlgItem(hwndDlg, IDC_BADD), FALSE); ShowWindow(GetDlgItem(hwndDlg, IDC_BDEL), FALSE); ShowWindow(GetDlgItem(hwndDlg, IDC_BCLEAR), FALSE); @@ -987,7 +987,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA copy_init_data->m_iStatus = GetStartupStatus(copy_init_data->m_szProto); else copy_init_data->m_iStatus = GetCurrentStatus(copy_init_data->m_szProto); - if (copy_init_data->m_szProto == NULL) + if (copy_init_data->m_szProto == nullptr) bCurrentStatus = TRUE; } @@ -1049,7 +1049,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (db_get_b(NULL, "SimpleStatusMsg", "AutoClose", 1) && init_data->m_bOnEvent) { copy_init_data->m_iCountdown = db_get_b(NULL, "SimpleStatusMsg", "DlgTime", 5); SendMessage(hwndDlg, WM_TIMER, 0, 0); - SetTimer(hwndDlg, 1, 1000, 0); + SetTimer(hwndDlg, 1, 1000, nullptr); } else { copy_init_data->m_iCountdown = -2; @@ -1113,12 +1113,12 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (msgbox_data->m_iStatus == ID_STATUS_CURRENT) { msgbox_data->m_iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(msgbox_data->m_szProto) : GetCurrentStatus(msgbox_data->m_szProto); - if (msgbox_data->m_szProto == NULL) + if (msgbox_data->m_szProto == nullptr) bCurrentStatus = TRUE; } else if (msgbox_data->m_iStatus >= ID_STATUS_CURRENT) { iProfileStatus = msgbox_data->m_iStatus; - msgbox_data->m_iStatus = GetCurrentStatus(NULL); + msgbox_data->m_iStatus = GetCurrentStatus(nullptr); } if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EDIT1))) @@ -1160,11 +1160,11 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA } if (bCurrentStatus) - SetStatusMessage(msgbox_data->m_szProto, msgbox_data->m_iInitialStatus, ID_STATUS_CURRENT, 0, msgbox_data->m_bOnStartup); + SetStatusMessage(msgbox_data->m_szProto, msgbox_data->m_iInitialStatus, ID_STATUS_CURRENT, nullptr, msgbox_data->m_bOnStartup); else if (iProfileStatus != 0) - SetStatusMessage(msgbox_data->m_szProto, msgbox_data->m_iInitialStatus, iProfileStatus, 0, FALSE); + SetStatusMessage(msgbox_data->m_szProto, msgbox_data->m_iInitialStatus, iProfileStatus, nullptr, FALSE); else - SetStatusMessage(msgbox_data->m_szProto, msgbox_data->m_iInitialStatus, msgbox_data->m_iStatus, 0, msgbox_data->m_bOnStartup); + SetStatusMessage(msgbox_data->m_szProto, msgbox_data->m_iInitialStatus, msgbox_data->m_iStatus, nullptr, msgbox_data->m_bOnStartup); } else { char buff[64], buff2[80]; @@ -1173,7 +1173,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA for (int i = 1; i <= msgbox_data->max_hist_msgs; i++) { mir_snprintf(buff, "SMsg%d", i); wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff); - if (tszStatusMsg != NULL) { + if (tszStatusMsg != nullptr) { if (!mir_wstrcmp(tszStatusMsg, tszMsg)) { found = true; if (msgbox_data->m_szProto) { @@ -1363,7 +1363,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA } } else if (LOWORD(cbitem.lParam) == CLEAR_HISTORY) { - if (MessageBox(NULL, TranslateT("Are you sure you want to clear status message history?"), TranslateT("Confirm clearing history"), MB_ICONQUESTION | MB_YESNO) == IDYES) + if (MessageBox(nullptr, TranslateT("Are you sure you want to clear status message history?"), TranslateT("Confirm clearing history"), MB_ICONQUESTION | MB_YESNO) == IDYES) ClearHistory(msgbox_data, cur_sel); else if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EDIT1))) { wchar_t msg[1024]; @@ -1469,7 +1469,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_BCLEAR)) { switch (HIWORD(wParam)) { case BN_CLICKED: - if (MessageBox(NULL, TranslateT("Are you sure you want to clear status message history?"), TranslateT("Confirm clearing history"), MB_ICONQUESTION | MB_YESNO) == IDYES) + if (MessageBox(nullptr, TranslateT("Are you sure you want to clear status message history?"), TranslateT("Confirm clearing history"), MB_ICONQUESTION | MB_YESNO) == IDYES) { ClearHistory(msgbox_data, 0); @@ -1571,7 +1571,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA break; case WM_DESTROY: - if (msgbox_data == NULL) + if (msgbox_data == nullptr) break; { WINDOWPLACEMENT wp; @@ -1616,7 +1616,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA ReleaseIconEx("clear"); Window_FreeIcon_IcoLib(hwndDlg); - hwndSAMsgDialog = NULL; + hwndSAMsgDialog = nullptr; mir_free(msgbox_data); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0); break; diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index fb3c1d931e..5c6f80052b 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -180,7 +180,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (index != CB_ERR && index != CB_ERRSPACE)
{
- data->proto_msg[0].msg = NULL;
+ data->proto_msg[0].msg = nullptr;
val = db_get_b(NULL, "SimpleStatusMsg", "ProtoFlags", PROTO_DEFAULT);
data->proto_msg[0].flags = val;
@@ -194,7 +194,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l || !CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0)
|| !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
{
- data->proto_msg[i+1].msg = NULL;
+ data->proto_msg[i+1].msg = nullptr;
continue;
}
@@ -232,8 +232,8 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (ServiceExists(MS_VARS_FORMATSTRING))
{
- HICON hIcon=NULL;
- char *szTipInfo=NULL;
+ HICON hIcon=nullptr;
+ char *szTipInfo=nullptr;
if (ServiceExists(MS_VARS_GETSKINITEM))
{
@@ -241,12 +241,12 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l szTipInfo = (char *)CallService(MS_VARS_GETSKINITEM, 0, VSI_HELPTIPTEXT);
}
- if (hIcon != NULL)
+ if (hIcon != nullptr)
SendDlgItemMessage(hwndDlg, IDC_VARSHELP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
else
SetDlgItemText(hwndDlg, IDC_VARSHELP, L"V");
- if (szTipInfo == NULL)
+ if (szTipInfo == nullptr)
SendDlgItemMessage(hwndDlg, IDC_VARSHELP, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open string formatting help"), 0);
else
SendDlgItemMessage(hwndDlg, IDC_VARSHELP, BUTTONADDTOOLTIP, (WPARAM)szTipInfo, 0);
@@ -600,7 +600,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l SetDlgItemText(hwndDlg, IDC_OPTEDIT1, L"");
char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
- if (szSetting != NULL)
+ if (szSetting != nullptr)
{
wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
@@ -640,7 +640,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l mir_snprintf(setting, "Msg");
wchar_t *tszStatusMsg = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
- if (tszStatusMsg != NULL)
+ if (tszStatusMsg != nullptr)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
mir_free(tszStatusMsg);
@@ -695,7 +695,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l SetDlgItemText(hwndDlg, IDC_OPTEDIT1, L"");
char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
- if (szSetting != NULL)
+ if (szSetting != nullptr)
{
wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
@@ -727,7 +727,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l mir_snprintf(setting, "Msg");
wchar_t *tszStatusMsg = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
- if (tszStatusMsg != NULL)
+ if (tszStatusMsg != nullptr)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
mir_free(tszStatusMsg);
@@ -805,7 +805,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
- if (szSetting != NULL)
+ if (szSetting != nullptr)
{
wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
@@ -838,7 +838,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l mir_snprintf(setting, "Msg");
wchar_t *tszStatusMsg = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting));
- if (tszStatusMsg != NULL)
+ if (tszStatusMsg != nullptr)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
mir_free(tszStatusMsg);
@@ -869,7 +869,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l int len = GetDlgItemText(hwndDlg, IDC_OPTEDIT1, msg, _countof(msg));
if (len > 0)
{
- if (data->proto_msg[j].msg == NULL)
+ if (data->proto_msg[j].msg == nullptr)
data->proto_msg[j].msg = mir_wstrdup(msg);
else
{
@@ -879,10 +879,10 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l }
else
{
- if (data->proto_msg[j].msg != NULL)
+ if (data->proto_msg[j].msg != nullptr)
{
mir_free(data->proto_msg[j].msg);
- data->proto_msg[j].msg = NULL;
+ data->proto_msg[j].msg = nullptr;
}
}
}
@@ -896,7 +896,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l }
case IDC_VARSHELP:
- variables_showhelp(hwndDlg, IDC_OPTEDIT1, VHF_FULLDLG|VHF_SETLASTSUBJECT, NULL, NULL);
+ variables_showhelp(hwndDlg, IDC_OPTEDIT1, VHF_FULLDLG|VHF_SETLASTSUBJECT, nullptr, nullptr);
break;
case IDC_BOPTPROTO:
@@ -932,7 +932,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l size_t len = mir_wstrlen(data->proto_msg[j].msg);
if (len > 0)
{
- if (data->proto_msg[k+1].msg == NULL)
+ if (data->proto_msg[k+1].msg == nullptr)
data->proto_msg[k+1].msg = mir_wstrdup(data->proto_msg[j].msg);
else
{
@@ -942,10 +942,10 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l }
else
{
- if (data->proto_msg[k+1].msg != NULL)
+ if (data->proto_msg[k+1].msg != nullptr)
{
mir_free(data->proto_msg[k+1].msg);
- data->proto_msg[k+1].msg = NULL;
+ data->proto_msg[k+1].msg = nullptr;
}
}
}
@@ -1122,7 +1122,7 @@ static INT_PTR CALLBACK DlgVariablesOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM case IDC_ESECUPDTMSG:
{
if ((HWND)lParam != GetFocus() || HIWORD(wParam) != EN_CHANGE) return 0;
- int val = GetDlgItemInt(hwndDlg, IDC_ESECUPDTMSG, NULL, FALSE);
+ int val = GetDlgItemInt(hwndDlg, IDC_ESECUPDTMSG, nullptr, FALSE);
if (val == 0 && GetWindowTextLength(GetDlgItem(hwndDlg, IDC_ESECUPDTMSG)))
SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_SETPOS, 0, MAKELONG((short)1, 0));
break;
@@ -1143,7 +1143,7 @@ static INT_PTR CALLBACK DlgVariablesOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY)
{
if (g_uUpdateMsgTimer)
- KillTimer(NULL, g_uUpdateMsgTimer);
+ KillTimer(nullptr, g_uUpdateMsgTimer);
int val = SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_GETPOS, 0, 0);
db_set_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", (WORD)val);
@@ -1151,7 +1151,7 @@ static INT_PTR CALLBACK DlgVariablesOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM if (IsDlgButtonChecked(hwndDlg, IDC_CUPDATEMSG) == BST_CHECKED && val)
{
db_set_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", (BYTE)1);
- g_uUpdateMsgTimer = SetTimer(NULL, 0, val * 1000, (TIMERPROC)UpdateMsgTimerProc);
+ g_uUpdateMsgTimer = SetTimer(nullptr, 0, val * 1000, (TIMERPROC)UpdateMsgTimerProc);
}
else
{
@@ -1182,7 +1182,7 @@ static bool IsHistoryMsgsFound(HWND, int histMax) j = histMax;
mir_snprintf(szSetting, "SMsg%d", j);
wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
- if (tszStatusMsg != NULL) {
+ if (tszStatusMsg != nullptr) {
if (*tszStatusMsg != '\0') {
mir_free(tszStatusMsg);
return true;
@@ -1296,7 +1296,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w {
if ((HWND)lParam != GetFocus() || HIWORD(wParam) != EN_CHANGE)
return 0;
- int val = GetDlgItemInt(hwndDlg, IDC_EMAXHIST, NULL, FALSE);
+ int val = GetDlgItemInt(hwndDlg, IDC_EMAXHIST, nullptr, FALSE);
if (val > 25)
SendDlgItemMessage(hwndDlg, IDC_SMAXHIST, UDM_SETPOS, 0, MAKELONG((short)25, 0));
EnableWindow(GetDlgItem(hwndDlg, IDC_CICONS2), val != 0);
@@ -1311,7 +1311,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w {
if ((HWND)lParam != GetFocus() || HIWORD(wParam) != EN_CHANGE)
return 0;
- int val = GetDlgItemInt(hwndDlg, IDC_ETIMEOUT, NULL, FALSE);
+ int val = GetDlgItemInt(hwndDlg, IDC_ETIMEOUT, nullptr, FALSE);
if (val == 0 && GetWindowTextLength(GetDlgItem(hwndDlg, IDC_ETIMEOUT)))
SendDlgItemMessage(hwndDlg, IDC_STIMEOUT, UDM_SETPOS, 0, MAKELONG((short)1, 0));
else if (val > 60)
@@ -1320,7 +1320,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w }
case IDC_BOPTHIST:
- if (MessageBox(NULL, TranslateT("Are you sure you want to clear status message history?"), TranslateT("Confirm clearing history"), MB_ICONQUESTION | MB_YESNO) == IDYES)
+ if (MessageBox(nullptr, TranslateT("Are you sure you want to clear status message history?"), TranslateT("Confirm clearing history"), MB_ICONQUESTION | MB_YESNO) == IDYES)
{
if (hwndSAMsgDialog)
@@ -1355,7 +1355,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w return 0;
case IDC_BOPTDEF:
- if (MessageBox(NULL, TranslateT("Are you sure you want to clear predefined status messages?"), TranslateT("Confirm clearing predefined"), MB_ICONQUESTION | MB_YESNO) == IDYES)
+ if (MessageBox(nullptr, TranslateT("Are you sure you want to clear predefined status messages?"), TranslateT("Confirm clearing predefined"), MB_ICONQUESTION | MB_YESNO) == IDYES)
{
if (hwndSAMsgDialog)
DestroyWindow(hwndSAMsgDialog);
@@ -1395,9 +1395,9 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w db_set_b(NULL, "SimpleStatusMsg", "DlgFlags", (BYTE)flags);
// Misc.
- db_set_b(NULL, "SimpleStatusMsg", "MaxHist", (BYTE)GetDlgItemInt(hwndDlg, IDC_EMAXHIST, NULL, FALSE));
+ db_set_b(NULL, "SimpleStatusMsg", "MaxHist", (BYTE)GetDlgItemInt(hwndDlg, IDC_EMAXHIST, nullptr, FALSE));
db_set_b(NULL, "SimpleStatusMsg", "AutoClose", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CCLOSEWND) == BST_CHECKED));
- db_set_b(NULL, "SimpleStatusMsg", "DlgTime", (BYTE)GetDlgItemInt(hwndDlg, IDC_ETIMEOUT, NULL, FALSE));
+ db_set_b(NULL, "SimpleStatusMsg", "DlgTime", (BYTE)GetDlgItemInt(hwndDlg, IDC_ETIMEOUT, nullptr, FALSE));
db_set_b(NULL, "SimpleStatusMsg", "WinCentered", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CRPOSWND) != BST_CHECKED));
db_set_b(NULL, "SimpleStatusMsg", "RemoveCR", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CREMOVECR) == BST_CHECKED));
db_set_b(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWSMSG) == BST_CHECKED));
diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp index f0bbf520b5..5bca49336f 100644 --- a/plugins/SimpleStatusMsg/src/utils.cpp +++ b/plugins/SimpleStatusMsg/src/utils.cpp @@ -52,7 +52,7 @@ HANDLE GetIconHandle(int iconId) if (iconList[i].defIconID == iconId)
return iconList[i].hIcolib;
- return NULL;
+ return nullptr;
}
void ReleaseIconEx(const char *name)
@@ -104,7 +104,7 @@ const wchar_t *GetDefaultMessage(int status) case ID_STATUS_OUTTOLUNCH: return TranslateT("Mmm... food.");
case ID_STATUS_IDLE: return TranslateT("idleeeeeeee");
}
- return NULL;
+ return nullptr;
}
const char *StatusModeToDbSetting(int status, const char *suffix)
@@ -124,7 +124,7 @@ const char *StatusModeToDbSetting(int status, const char *suffix) case ID_STATUS_ONTHEPHONE: prefix = "Otp"; break;
case ID_STATUS_OUTTOLUNCH: prefix = "Otl"; break;
case ID_STATUS_IDLE: prefix = "Idl"; break;
- default: return NULL;
+ default: return nullptr;
}
mir_snprintf(str, "%s%s", prefix, suffix);
return str;
|