summaryrefslogtreecommitdiff
path: root/plugins/WhenWasIt/src
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/WhenWasIt/src
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/WhenWasIt/src')
-rw-r--r--plugins/WhenWasIt/src/WhenWasIt.cpp8
-rw-r--r--plugins/WhenWasIt/src/birthdays.cpp6
-rw-r--r--plugins/WhenWasIt/src/date_utils.cpp2
-rw-r--r--plugins/WhenWasIt/src/dlg_handlers.cpp46
-rw-r--r--plugins/WhenWasIt/src/hooked_events.cpp10
-rw-r--r--plugins/WhenWasIt/src/icons.cpp6
-rw-r--r--plugins/WhenWasIt/src/notifiers.cpp4
-rw-r--r--plugins/WhenWasIt/src/services.cpp10
-rw-r--r--plugins/WhenWasIt/src/utils.cpp12
9 files changed, 52 insertions, 52 deletions
diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp
index f321c71a0c..0bdd5bb7d6 100644
--- a/plugins/WhenWasIt/src/WhenWasIt.cpp
+++ b/plugins/WhenWasIt/src/WhenWasIt.cpp
@@ -22,9 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
char ModuleName[] = "WhenWasIt";
HINSTANCE hInstance;
-HWND hBirthdaysDlg = NULL;
-HWND hUpcomingDlg = NULL;
-MWindowList hAddBirthdayWndsList = NULL;
+HWND hBirthdaysDlg = nullptr;
+HWND hUpcomingDlg = nullptr;
+MWindowList hAddBirthdayWndsList = nullptr;
int hLangpack;
CommonData commonData = { 0 };
@@ -110,7 +110,7 @@ extern "C" int __declspec(dllexport) Load(void)
Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x6f844569, 0xad06, 0x4b27, 0x8f, 0xd8, 0x1, 0x24, 0xe7, 0x1e, 0xcc, 0x43);
- mi.root = 0;
+ mi.root = nullptr;
mi.pszService = MS_WWI_ADD_BIRTHDAY;
mi.position = 10000000;
mi.hIcolibItem = hAddBirthdayContact;
diff --git a/plugins/WhenWasIt/src/birthdays.cpp b/plugins/WhenWasIt/src/birthdays.cpp
index 7f4a93ed3e..067c61f162 100644
--- a/plugins/WhenWasIt/src/birthdays.cpp
+++ b/plugins/WhenWasIt/src/birthdays.cpp
@@ -26,7 +26,7 @@ CBirthdays::CBirthdays(int initialSize)
{
count = 0;
size = 0;
- birthdays = NULL;
+ birthdays = nullptr;
advancedIcon = CLIST_ICON;
Realloc(initialSize);
@@ -42,7 +42,7 @@ void CBirthdays::Destroy()
if (birthdays) {
Clear();
free(birthdays);
- birthdays = NULL;
+ birthdays = nullptr;
}
}
@@ -57,7 +57,7 @@ void CBirthdays::Clear()
void CBirthdays::ClearItem(int index)
{
free(birthdays[index]);
- birthdays[index] = NULL;
+ birthdays[index] = nullptr;
}
int CBirthdays::Count() const
diff --git a/plugins/WhenWasIt/src/date_utils.cpp b/plugins/WhenWasIt/src/date_utils.cpp
index d69a9b0dc3..4645e1f88e 100644
--- a/plugins/WhenWasIt/src/date_utils.cpp
+++ b/plugins/WhenWasIt/src/date_utils.cpp
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
time_t Today()
{
- time_t now = time(NULL);
+ time_t now = time(nullptr);
struct tm* date = localtime(&now);
date->tm_hour = date->tm_min = date->tm_sec = 0;
return mktime(date);
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp
index c2c48930e5..4448ccb73c 100644
--- a/plugins/WhenWasIt/src/dlg_handlers.cpp
+++ b/plugins/WhenWasIt/src/dlg_handlers.cpp
@@ -47,15 +47,15 @@ const int cNotifyFor = sizeof(szNotifyFor) / sizeof(szNotifyFor[0]);
#include "commctrl.h"
void CreateToolTip(HWND target, wchar_t* tooltip, LPARAM width)
{
- HWND hwndToolTip = CreateWindow(TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT,
- CW_USEDEFAULT, CW_USEDEFAULT, target, NULL, NULL, NULL);
+ HWND hwndToolTip = CreateWindow(TOOLTIPS_CLASS, nullptr, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT,
+ CW_USEDEFAULT, CW_USEDEFAULT, target, nullptr, nullptr, nullptr);
if (hwndToolTip) {
TOOLINFO ti = { 0 };
ti.cbSize = sizeof(ti);
ti.uFlags = TTF_TRANSPARENT | TTF_SUBCLASS;
ti.hwnd = target;
ti.uId = 0;
- ti.hinst = NULL;
+ ti.hinst = nullptr;
ti.lpszText = tooltip;
GetClientRect(target, &ti.rect);
SendMessage(hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti);
@@ -251,9 +251,9 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
EnablePopupsGroup(hWnd, IsDlgButtonChecked(hWnd, IDC_USE_POPUPS));
EnableClistGroup(hWnd, IsDlgButtonChecked(hWnd, IDC_USE_CLISTICON));
EnableDialogGroup(hWnd, IsDlgButtonChecked(hWnd, IDC_USE_DIALOG));
- RedrawWindow(GetDlgItem(hWnd, IDC_USE_POPUPS), NULL, NULL, RDW_ERASE | RDW_INVALIDATE);
- RedrawWindow(GetDlgItem(hWnd, IDC_USE_CLISTICON), NULL, NULL, RDW_ERASE | RDW_INVALIDATE);
- RedrawWindow(GetDlgItem(hWnd, IDC_USE_DIALOG), NULL, NULL, RDW_ERASE | RDW_INVALIDATE);
+ RedrawWindow(GetDlgItem(hWnd, IDC_USE_POPUPS), nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE);
+ RedrawWindow(GetDlgItem(hWnd, IDC_USE_CLISTICON), nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE);
+ RedrawWindow(GetDlgItem(hWnd, IDC_USE_DIALOG), nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE);
//fallthrough
case IDC_FOREGROUND:
@@ -307,7 +307,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
wchar_t buffer[maxSize];
GetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer, _countof(buffer));
- wchar_t *stop = NULL;
+ wchar_t *stop = nullptr;
commonData.daysInAdvance = wcstol(buffer, &stop, 10);
if (*stop) { commonData.daysInAdvance = DAYS_TO_NOTIFY; }
@@ -413,7 +413,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
case WM_SHOWWINDOW:
{
wchar_t *szTooltipText = TranslateT("Please select the module where you want the date of birth to be saved.\r\n\"UserInfo\" is the default location.\r\nUse \"Protocol module\" to make the data visible in User Details.\n\"mBirthday module\" uses the same module as mBirthday plugin.");
- wchar_t *szCurrentModuleTooltip = NULL;
+ wchar_t *szCurrentModuleTooltip = nullptr;
char *szProto = GetContactProto(hContact);
wchar_t buffer[2048];
@@ -461,7 +461,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
break;
default:
- szCurrentModuleTooltip = NULL;
+ szCurrentModuleTooltip = nullptr;
break;
}
@@ -494,7 +494,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
}
else SaveBirthday(hContact, 0, 0, 0, SAVE_MODE_DELETEALL);
- if (hBirthdaysDlg != NULL)
+ if (hBirthdaysDlg != nullptr)
SendMessage(hBirthdaysDlg, WWIM_UPDATE_BIRTHDAY, hContact, NULL);
SendMessage(hWnd, WM_CLOSE, 0, 0);
@@ -507,7 +507,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOWPOS *wndPos, int anchors)
{
- if (NULL == window) /* Wine fix. */
+ if (nullptr == window) /* Wine fix. */
return;
RECT rChild = AnchorCalcPos(window, rParent, wndPos, anchors);
hdWnds = DeferWindowPos(hdWnds, window, HWND_NOTOPMOST, rChild.left, rChild.top, rChild.right - rChild.left, rChild.bottom - rChild.top, SWP_NOZORDER);
@@ -592,7 +592,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll,
char *szProto = GetContactProto(hContact);
PROTOACCOUNT *pAcc = Proto_GetAccount(szProto);
- wchar_t *ptszAccName = (pAcc == NULL) ? TranslateT("Unknown") : pAcc->tszAccountName;
+ wchar_t *ptszAccName = (pAcc == nullptr) ? TranslateT("Unknown") : pAcc->tszAccountName;
LVITEM item = { 0 };
item.mask = LVIF_TEXT | LVIF_PARAM;
@@ -678,8 +678,8 @@ static LRESULT CALLBACK BirthdaysListSubclassProc(HWND hWnd, UINT msg, WPARAM wP
ListView_GetItem(hWnd, &item);
hContact = (MCONTACT)item.lParam;
HMENU hMenu = Menu_BuildContactMenu(hContact);
- if (hMenu != NULL) {
- Clist_MenuProcessCommand(TrackPopupMenu(hMenu, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, NULL), MPCF_CONTACTMENU, hContact);
+ if (hMenu != nullptr) {
+ Clist_MenuProcessCommand(TrackPopupMenu(hMenu, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, nullptr), MPCF_CONTACTMENU, hContact);
DestroyMenu(hMenu);
}
break;
@@ -748,7 +748,7 @@ INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
LoadBirthdays(hWnd, 0);
int column = db_get_b(NULL, ModuleName, "SortColumn", 0);
- BirthdaysSortParams params = { 0 };
+ BirthdaysSortParams params = {};
params.hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
params.column = column;
ListView_SortItemsEx(params.hList, BirthdaysCompare, (LPARAM)&params);
@@ -819,7 +819,7 @@ INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
LPNMLISTVIEW lv = (LPNMLISTVIEW)lParam;
int column = lv->iSubItem;
db_set_b(NULL, ModuleName, "SortColumn", column);
- BirthdaysSortParams params = { 0 };
+ BirthdaysSortParams params = {};
params.hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
params.column = column;
ListView_SortItemsEx(params.hList, BirthdaysCompare, (LPARAM)&params);
@@ -830,7 +830,7 @@ INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
break;
case WM_DESTROY:
- hBirthdaysDlg = NULL;
+ hBirthdaysDlg = nullptr;
Utils_SaveWindowPosition(hWnd, NULL, ModuleName, "BirthdayList");
Window_FreeIcon_IcoLib(hWnd);
lastColumn = -1;
@@ -871,7 +871,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
ListView_SetColumnWidth(hList, 0, LVSCW_AUTOSIZE);
if (timeout > 0)
- SetTimer(hWnd, UPCOMING_TIMER_ID, 1000, NULL);
+ SetTimer(hWnd, UPCOMING_TIMER_ID, 1000, nullptr);
Utils_RestoreWindowPosition(hWnd, NULL, ModuleName, "BirthdayListUpcoming");
}
return TRUE;
@@ -919,7 +919,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
mir_snwprintf(buffer, L"%d", data->dtb);
ListView_SetItemText(hList, index, 2, buffer);
- BirthdaysSortParams params = { 0 };
+ BirthdaysSortParams params = {};
params.hList = hList;
params.column = 2;
ListView_SortItemsEx(hList, BirthdaysCompare, (LPARAM)&params);
@@ -950,15 +950,15 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
int cx = rcWin.right - rcWin.left;
int cy = rcWin.bottom - rcWin.top;
- SetWindowPos(hList, NULL, 0, 0, (cx - 30), (cy - 80), (SWP_NOZORDER | SWP_NOMOVE));
+ SetWindowPos(hList, nullptr, 0, 0, (cx - 30), (cy - 80), (SWP_NOZORDER | SWP_NOMOVE));
ListView_SetColumnWidth(hList, 0, (cx - 150));
- SetWindowPos(GetDlgItem(hWnd, IDC_CLOSE), NULL, ((cx / 2) - 95), (cy - 67), 0, 0, SWP_NOSIZE);
- RedrawWindow(hWnd, NULL, NULL, (RDW_FRAME | RDW_INVALIDATE));
+ SetWindowPos(GetDlgItem(hWnd, IDC_CLOSE), nullptr, ((cx / 2) - 95), (cy - 67), 0, 0, SWP_NOSIZE);
+ RedrawWindow(hWnd, nullptr, nullptr, (RDW_FRAME | RDW_INVALIDATE));
}
break;
case WM_DESTROY:
- hUpcomingDlg = NULL;
+ hUpcomingDlg = nullptr;
Utils_SaveWindowPosition(hWnd, NULL, ModuleName, "BirthdayListUpcoming");
Window_FreeIcon_IcoLib(hWnd);
KillTimer(hWnd, UPCOMING_TIMER_ID);
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp
index 4118efa6e1..072a57f2ba 100644
--- a/plugins/WhenWasIt/src/hooked_events.cpp
+++ b/plugins/WhenWasIt/src/hooked_events.cpp
@@ -31,7 +31,7 @@ static int currentDay = 0;
static int OnTopToolBarModuleLoaded(WPARAM, LPARAM)
{
- TTBButton ttb = { 0 };
+ TTBButton ttb = {};
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszService = MS_WWI_CHECK_BIRTHDAYS;
ttb.hIconHandleUp = hCheckMenu;
@@ -144,19 +144,19 @@ int UpdateTimers()
{
UINT interval = db_get_dw(NULL, ModuleName, "Interval", CHECK_INTERVAL);
interval *= (1000 * 60 * 60); //go from miliseconds to hours
- hCheckTimer = SetTimer(NULL, 0, interval, OnCheckTimer);
+ hCheckTimer = SetTimer(nullptr, 0, interval, OnCheckTimer);
if (!hDateChangeTimer)
- hDateChangeTimer = SetTimer(NULL, 0, (1000 * DATE_CHANGE_CHECK_INTERVAL), OnDateChangeTimer);
+ hDateChangeTimer = SetTimer(nullptr, 0, (1000 * DATE_CHANGE_CHECK_INTERVAL), OnDateChangeTimer);
return 0;
}
int KillTimers()
{
- KillTimer(NULL, hCheckTimer);
+ KillTimer(nullptr, hCheckTimer);
hCheckTimer = NULL;
- KillTimer(NULL, hDateChangeTimer);
+ KillTimer(nullptr, hDateChangeTimer);
hDateChangeTimer = NULL;
return 0;
diff --git a/plugins/WhenWasIt/src/icons.cpp b/plugins/WhenWasIt/src/icons.cpp
index dbe48f467b..e4164f2e8a 100644
--- a/plugins/WhenWasIt/src/icons.cpp
+++ b/plugins/WhenWasIt/src/icons.cpp
@@ -24,14 +24,14 @@ HANDLE hCheckMenu, hListMenu, hAddBirthdayContact, hRefreshUserDetails;
HANDLE hImportBirthdays, hExportBirthdays;
const int cDTB = 10;
-HANDLE hDTB[cDTB] = { NULL };
-HANDLE hDTBMore = NULL;
+HANDLE hDTB[cDTB] = {};
+HANDLE hDTBMore = nullptr;
HANDLE hWWIExtraIcons = (HANDLE)-1;
static HANDLE AddIcon(char *name, char *description, wchar_t *tszPath, int iDefaultIdx)
{
- SKINICONDESC sid = { 0 };
+ SKINICONDESC sid = {};
sid.flags = SIDF_PATH_UNICODE;
sid.section.a = LPGEN("WhenWasIt");
sid.description.a = description;
diff --git a/plugins/WhenWasIt/src/notifiers.cpp b/plugins/WhenWasIt/src/notifiers.cpp
index 96bf7fe280..1280a06d5d 100644
--- a/plugins/WhenWasIt/src/notifiers.cpp
+++ b/plugins/WhenWasIt/src/notifiers.cpp
@@ -154,7 +154,7 @@ int DialogNotifyBirthday(MCONTACT hContact, int dtb, int age)
wchar_t text[1024];
BuildDTBText(dtb, name, text, _countof(text));
if (!hUpcomingDlg) {
- hUpcomingDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_UPCOMING), NULL, DlgProcUpcoming);
+ hUpcomingDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_UPCOMING), nullptr, DlgProcUpcoming);
ShowWindow(hUpcomingDlg, commonData.bOpenInBackground ? SW_SHOWNOACTIVATE : SW_SHOW);
}
@@ -176,7 +176,7 @@ int DialogNotifyMissedBirthday(MCONTACT hContact, int dab, int age)
wchar_t text[1024];
BuildDABText(dab, name, text, _countof(text));
if (!hUpcomingDlg) {
- hUpcomingDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_UPCOMING), NULL, DlgProcUpcoming);
+ hUpcomingDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_UPCOMING), nullptr, DlgProcUpcoming);
ShowWindow(hUpcomingDlg, commonData.bOpenInBackground ? SW_SHOWNOACTIVATE : SW_SHOW);
}
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp
index 9db7956f2a..399cf5aeb1 100644
--- a/plugins/WhenWasIt/src/services.cpp
+++ b/plugins/WhenWasIt/src/services.cpp
@@ -139,7 +139,7 @@ INT_PTR CheckBirthdaysService(WPARAM, LPARAM lParam)
INT_PTR ShowListService(WPARAM, LPARAM)
{
if (!hBirthdaysDlg)
- hBirthdaysDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_BIRTHDAYS), NULL, DlgProcBirthdays);
+ hBirthdaysDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_BIRTHDAYS), nullptr, DlgProcBirthdays);
ShowWindow(hBirthdaysDlg, SW_SHOW);
return 0;
@@ -149,7 +149,7 @@ INT_PTR AddBirthdayService(WPARAM hContact, LPARAM)
{
HWND hWnd = WindowList_Find(hAddBirthdayWndsList, hContact);
if (!hWnd)
- hWnd = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_ADD_BIRTHDAY), NULL, DlgProcAddBirthday, hContact);
+ hWnd = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_ADD_BIRTHDAY), nullptr, DlgProcAddBirthday, hContact);
return ShowWindow(hWnd, SW_SHOW);
}
@@ -184,7 +184,7 @@ void __cdecl RefreshUserDetailsWorkerThread(void*)
INT_PTR RefreshUserDetailsService(WPARAM, LPARAM)
{
- mir_forkthread(RefreshUserDetailsWorkerThread, 0);
+ mir_forkthread(RefreshUserDetailsWorkerThread, nullptr);
return 0;
}
@@ -245,7 +245,7 @@ int DoImport(wchar_t *fileName)
{
FILE *fin = _wfopen(fileName, L"rt");
if (!fin) {
- MessageBox(0, TranslateT("Could not open file to import birthdays"), TranslateT("Error"), MB_OK | MB_ICONERROR);
+ MessageBox(nullptr, TranslateT("Could not open file to import birthdays"), TranslateT("Error"), MB_OK | MB_ICONERROR);
return 1;
}
@@ -292,7 +292,7 @@ int DoExport(wchar_t *fileName)
{
FILE *fout = _wfopen(fileName, L"wt");
if (!fout) {
- MessageBox(0, TranslateT("Could not open file to export birthdays"), TranslateT("Error"), MB_OK | MB_ICONERROR);
+ MessageBox(nullptr, TranslateT("Could not open file to export birthdays"), TranslateT("Error"), MB_OK | MB_ICONERROR);
return 1;
}
fwprintf(fout, L"%c%s", COMMENT_CHAR, TranslateT("Please do not edit this file by hand. Use the export function of WhenWasIt plugin.\n"));
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp
index 2b1a8e3551..c77578adee 100644
--- a/plugins/WhenWasIt/src/utils.cpp
+++ b/plugins/WhenWasIt/src/utils.cpp
@@ -39,7 +39,7 @@ int Log(char *format, ...)
if (!fout)
return -1;
- time_t tNow = time(NULL);
+ time_t tNow = time(nullptr);
struct tm *now = localtime(&tNow);
strftime(str, sizeof(str), "%d %b %Y @ %H:%M:%S: ", now);
fputs(str, fout);
@@ -68,14 +68,14 @@ int Info(char *title, char *format, ...)
if (tBytes > 0)
str[tBytes] = 0;
va_end(vararg);
- return MessageBoxA(0, str, title, MB_OK | MB_ICONINFORMATION);
+ return MessageBoxA(nullptr, str, title, MB_OK | MB_ICONINFORMATION);
}
#define HEX_SIZE 8
char* BinToHex(int size, PBYTE data)
{
- char *szresult = NULL;
+ char *szresult = nullptr;
char buffer[32] = { 0 }; //should be more than enough
int maxSize = size * 2 + HEX_SIZE + 1;
szresult = (char *) new char[maxSize];
@@ -140,13 +140,13 @@ int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, si
wchar_t* GetContactID(MCONTACT hContact)
{
- return GetContactID(hContact, NULL);
+ return GetContactID(hContact, nullptr);
}
wchar_t* GetContactID(MCONTACT hContact, char *szProto)
{
ptrW res(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto));
- return (res) ? wcsdup(res) : NULL;
+ return (res) ? wcsdup(res) : nullptr;
}
MCONTACT GetContactFromID(wchar_t *szID, char *szProto)
@@ -167,7 +167,7 @@ MCONTACT GetContactFromID(wchar_t *szID, char *szProto)
MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto)
{
char protocol[1024];
- WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL);
+ WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), nullptr, nullptr);
return GetContactFromID(szID, protocol);
}