diff options
Diffstat (limited to 'src/mir_app')
58 files changed, 219 insertions, 219 deletions
diff --git a/src/mir_app/src/DefaultExtraIcons.cpp b/src/mir_app/src/DefaultExtraIcons.cpp index f941917f6e..29d09dd49d 100644 --- a/src/mir_app/src/DefaultExtraIcons.cpp +++ b/src/mir_app/src/DefaultExtraIcons.cpp @@ -304,7 +304,7 @@ void DefaultExtraIcons_Load() {
hExtraChat = ExtraIcon_RegisterIcolib("chat_activity", LPGEN("Chat activity"), "ChatActivity");
hExtraVisibility = ExtraIcon_RegisterIcolib("visibility", "Visibility", Skin_GetIconName(SKINICON_OTHER_VISIBLE_ALL));
- hExtraGender = ExtraIcon_RegisterIcolib("gender", "Gender", "gender_male", 0, 0, EIF_DISABLED_BY_DEFAULT);
+ hExtraGender = ExtraIcon_RegisterIcolib("gender", "Gender", "gender_male", nullptr, 0, EIF_DISABLED_BY_DEFAULT);
hExtraProto = ExtraIcon_RegisterCallback("protocol", "Account", Skin_GetIconName(SKINICON_OTHER_ACCMGR),
&ProtocolRebuildIcons, &ProtocolApplyIcon, &ProtocolOnClick, 0, EIF_DISABLED_BY_DEFAULT);
@@ -314,7 +314,7 @@ void DefaultExtraIcons_Load() if (p.OnClick)
p.hExtraIcon = ExtraIcon_RegisterIcolib(p.name, p.desc, Skin_GetIconName(p.iSkinIcon), DefaultOnClick, (LPARAM)&p, p.flags);
else
- p.hExtraIcon = ExtraIcon_RegisterIcolib(p.name, p.desc, Skin_GetIconName(p.iSkinIcon), 0, 0, p.flags);
+ p.hExtraIcon = ExtraIcon_RegisterIcolib(p.name, p.desc, Skin_GetIconName(p.iSkinIcon), nullptr, 0, p.flags);
}
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
diff --git a/src/mir_app/src/Docking.cpp b/src/mir_app/src/Docking.cpp index 88f4d99fed..ebdc031c18 100644 --- a/src/mir_app/src/Docking.cpp +++ b/src/mir_app/src/Docking.cpp @@ -323,7 +323,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) docked = 0;
GetCursorPos(&pt);
PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
- SetWindowPos(msg->hwnd, 0, pt.x - rc.right / 2,
+ SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2,
pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2,
db_get_dw(0, "CList", "Width", 0),
db_get_dw(0, "CList", "Height", 0),
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 511ee8e16c..b652bf8e25 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -345,7 +345,7 @@ static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const wchar_t *groupNam hItem = sttFindNamedTreeItemAt(hwndTree, hSection, pItemName);
if (!sectionName || !hItem) {
if (!hItem) {
- TVINSERTSTRUCT tvis = { 0 };
+ TVINSERTSTRUCT tvis = {};
TreeItem *treeItem = (TreeItem *)mir_alloc(sizeof(TreeItem));
treeItem->groupName = sectionName ? nullptr : mir_wstrdup(groupName);
treeItem->paramName = mir_u2a(itemName);
@@ -507,7 +507,7 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F) if (db_set_ws(0, F.dbSettingsGroup, str, F.value.szFace)) {
char buff[1024];
- WideCharToMultiByte(code_page, 0, F.value.szFace, -1, buff, 1024, 0, 0);
+ WideCharToMultiByte(code_page, 0, F.value.szFace, -1, buff, 1024, nullptr, nullptr);
db_set_s(0, F.dbSettingsGroup, str, buff);
}
@@ -551,7 +551,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, int selCount;
LOGFONT lf;
- static HBRUSH hBkgColourBrush = 0;
+ static HBRUSH hBkgColourBrush = nullptr;
switch (msg) {
case WM_INITDIALOG:
@@ -624,7 +624,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, if (hBkgColourBrush) {
DeleteObject(hBkgColourBrush);
- hBkgColourBrush = 0;
+ hBkgColourBrush = nullptr;
}
for (int colourId = 0; colourId < colour_id_list_w2.getCount(); colourId++) {
@@ -1208,7 +1208,7 @@ static FontInternal* sttFindFont(OBJLIST<FontInternal> &fonts, char *module, cha return &F;
}
- return 0;
+ return nullptr;
}
static FontInternal fntHeader, fntGeneral, fntSmall;
diff --git a/src/mir_app/src/FontService.cpp b/src/mir_app/src/FontService.cpp index b40410ad6c..664fc57044 100644 --- a/src/mir_app/src/FontService.cpp +++ b/src/mir_app/src/FontService.cpp @@ -115,7 +115,7 @@ void ConvertLOGFONT(LOGFONTW *lfw, LOGFONTA *lfa) lfa->lfQuality = lfw->lfQuality;
lfa->lfPitchAndFamily = lfw->lfPitchAndFamily;
- WideCharToMultiByte(code_page, 0, lfw->lfFaceName, -1, lfa->lfFaceName, LF_FACESIZE, 0, 0);
+ WideCharToMultiByte(code_page, 0, lfw->lfFaceName, -1, lfa->lfFaceName, LF_FACESIZE, nullptr, nullptr);
}
static void GetDefaultFontSetting(LOGFONT *lf, COLORREF *colour)
@@ -126,9 +126,9 @@ static void GetDefaultFontSetting(LOGFONT *lf, COLORREF *colour) lf->lfHeight = 10;
- HDC hdc = GetDC(0);
+ HDC hdc = GetDC(nullptr);
lf->lfHeight = -MulDiv(lf->lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
- ReleaseDC(0, hdc);
+ ReleaseDC(nullptr, hdc);
}
int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORREF *colour, DWORD flags)
@@ -175,7 +175,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
if (lf->lfHeight > 0) {
- HDC hdc = GetDC(0);
+ HDC hdc = GetDC(nullptr);
if (flags & FIDF_SAVEPOINTSIZE)
lf->lfHeight = -MulDiv(lf->lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
else { // assume SAVEACTUALHEIGHT
@@ -190,7 +190,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR DeleteObject(hFont);
}
- ReleaseDC(0, hdc);
+ ReleaseDC(nullptr, hdc);
}
return retval;
@@ -198,7 +198,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR int CreateFromFontSettings(FontSettingsW *fs, LOGFONT *lf)
{
- GetDefaultFontSetting(lf, 0);
+ GetDefaultFontSetting(lf, nullptr);
wcsncpy_s(lf->lfFaceName, fs->szFace, _TRUNCATE);
diff --git a/src/mir_app/src/button.cpp b/src/mir_app/src/button.cpp index a39b55e5ce..8cce3de438 100644 --- a/src/mir_app/src/button.cpp +++ b/src/mir_app/src/button.cpp @@ -614,7 +614,7 @@ int LoadButtonModule(void) wc.lpfnWndProc = MButtonWndProc;
wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
wc.cbWndExtra = sizeof(MButtonCtrl*);
- wc.hbrBackground = 0;
+ wc.hbrBackground = nullptr;
wc.style = CS_GLOBALCLASS;
RegisterClassEx(&wc);
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index b61eadf7ff..26377bad40 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -523,7 +523,7 @@ char* SM_GetUsers(SESSION_INFO *si) if (pLen + nameLen + 2 > alloced)
p = (char*)mir_realloc(p, alloced += 4096);
- WideCharToMultiByte(CP_ACP, 0, utemp->pszUID, -1, p + pLen, (int)nameLen + 1, 0, 0);
+ WideCharToMultiByte(CP_ACP, 0, utemp->pszUID, -1, p + pLen, (int)nameLen + 1, nullptr, nullptr);
mir_strcpy(p + pLen + nameLen, " ");
utemp = utemp->next;
}
@@ -644,7 +644,7 @@ static STATUSINFO* TM_FindStatus(STATUSINFO *pStatusList, const wchar_t *pszStat if (mir_wstrcmpi(pTemp->pszGroup, pszStatus) == 0)
return pTemp;
- return 0;
+ return nullptr;
}
static WORD TM_StringToWord(STATUSINFO *pStatusList, const wchar_t *pszStatus)
@@ -674,7 +674,7 @@ static wchar_t* TM_WordToString(STATUSINFO *pStatusList, WORD Status) return pTemp->pszGroup;
}
}
- return 0;
+ return nullptr;
}
static BOOL TM_RemoveAll(STATUSINFO **ppStatusList)
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index a2293e6d84..8bad7a2ef3 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -532,7 +532,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) long trimlimit = g_Settings->LoggingLimit * 1024;
if (dwSize > trimlimit) {
- time_t now = time(0);
+ time_t now = time(nullptr);
wchar_t tszTimestamp[20];
wcsftime(tszTimestamp, 20, L"%Y%m%d-%H%M%S", _localtime32((__time32_t *)&now));
@@ -551,7 +551,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) wchar_t tszNewName[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
mir_snwprintf(tszNewName, L"%s%s-%s%s", tszNewPath, tszName, tszTimestamp, tszExt);
fclose(hFile);
- hFile = 0;
+ hFile = nullptr;
if (!PathFileExists(tszNewName))
CopyFile(si->pszLogFileName, tszNewName, TRUE);
DeleteFile(si->pszLogFileName);
@@ -711,7 +711,7 @@ MIR_APP_DLL(wchar_t*) Chat_UnescapeTags(wchar_t *str_in) MIR_APP_DLL(void) Chat_AddMenuItems(HMENU hMenu, int nItems, const gc_item *Item, int _hLang)
{
if (nItems > 0)
- AppendMenu(hMenu, MF_SEPARATOR, 0, 0);
+ AppendMenu(hMenu, MF_SEPARATOR, 0, nullptr);
HMENU hSubMenu = nullptr;
for (int i = 0; i < nItems; i++) {
@@ -723,13 +723,13 @@ MIR_APP_DLL(void) Chat_AddMenuItems(HMENU hMenu, int nItems, const gc_item *Item AppendMenu(hMenu, dwState | MF_POPUP, (UINT_PTR)hSubMenu, ptszText);
}
else if (Item[i].uType == MENU_POPUPHMENU)
- AppendMenu(hSubMenu == 0 ? hMenu : hSubMenu, dwState | MF_POPUP, Item[i].dwID, ptszText);
+ AppendMenu(hSubMenu == nullptr ? hMenu : hSubMenu, dwState | MF_POPUP, Item[i].dwID, ptszText);
else if (Item[i].uType == MENU_POPUPITEM)
- AppendMenu(hSubMenu == 0 ? hMenu : hSubMenu, dwState | MF_STRING, Item[i].dwID, ptszText);
+ AppendMenu(hSubMenu == nullptr ? hMenu : hSubMenu, dwState | MF_STRING, Item[i].dwID, ptszText);
else if (Item[i].uType == MENU_POPUPCHECK)
- AppendMenu(hSubMenu == 0 ? hMenu : hSubMenu, dwState | MF_CHECKED | MF_STRING, Item[i].dwID, ptszText);
+ AppendMenu(hSubMenu == nullptr ? hMenu : hSubMenu, dwState | MF_CHECKED | MF_STRING, Item[i].dwID, ptszText);
else if (Item[i].uType == MENU_POPUPSEPARATOR)
- AppendMenu(hSubMenu == 0 ? hMenu : hSubMenu, MF_SEPARATOR, 0, ptszText);
+ AppendMenu(hSubMenu == nullptr ? hMenu : hSubMenu, MF_SEPARATOR, 0, ptszText);
else if (Item[i].uType == MENU_SEPARATOR)
AppendMenu(hMenu, MF_SEPARATOR, 0, ptszText);
else if (Item[i].uType == MENU_HMENU)
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 3e286c8176..82862617fa 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -1245,7 +1245,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam case POPUP_NEWSUBGROUP:
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS);
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_USEGROUPS);
- Clist_GroupCreate(contact->groupId, 0);
+ Clist_GroupCreate(contact->groupId, nullptr);
break;
case POPUP_RENAMEGROUP:
cli.pfnBeginRenameSelection(hwnd, dat);
diff --git a/src/mir_app/src/clcmsgs.cpp b/src/mir_app/src/clcmsgs.cpp index 25ae4e3a07..dd6a91b8fd 100644 --- a/src/mir_app/src/clcmsgs.cpp +++ b/src/mir_app/src/clcmsgs.cpp @@ -77,7 +77,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar }
case CLM_AUTOREBUILD:
- SetTimer(hwnd, TIMERID_REBUILDAFTER, 50, 0);
+ SetTimer(hwnd, TIMERID_REBUILDAFTER, 50, nullptr);
break;
case CLM_DELETEITEM:
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index 7eeb250597..77009d6fe7 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -65,7 +65,7 @@ static void fnReloadProtoMenus(void) RebuildMenuOrder();
if (db_get_b(0, "CList", "MoveProtoMenus", TRUE))
BuildProtoMenus();
- cli.pfnCluiProtocolStatusChanged(0, 0);
+ cli.pfnCluiProtocolStatusChanged(0, nullptr);
}
MIR_APP_DLL(CLIST_INTERFACE*) Clist_GetInterface(void)
diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index 2997961683..9fdb1099bc 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -81,7 +81,7 @@ static mir_cs csGroups; static int GroupNameExists(const wchar_t *ptszGroupName, int skipGroup)
{
- if (ptszGroupName == 0)
+ if (ptszGroupName == nullptr)
return 0;
wchar_t str[256];
@@ -144,7 +144,7 @@ static INT_PTR CreateGroupInternal(MGROUP hParent, const wchar_t *ptszName) MIR_APP_DLL(MGROUP) Clist_GroupCreate(MGROUP hParent, LPCTSTR ptszGroupName)
{
// no name specified. just create a new group with a default name
- if (ptszGroupName == 0)
+ if (ptszGroupName == nullptr)
return CreateGroupInternal(hParent, nullptr);
if (ptszGroupName == nullptr || ptszGroupName[0] == '\0' || ptszGroupName[0] == '\\')
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index f39d12bbab..ef6f6749ca 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -276,7 +276,7 @@ int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) POINT pt;
register int i, j, width, height, iCountedDots = 0, iNotCoveredDots = 0;
BOOL bPartiallyCovered = FALSE;
- HWND hAux = 0;
+ HWND hAux = nullptr;
if (hWnd == nullptr) {
SetLastError(0x00000006); //Wrong handle
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 1d1ffbc0b1..af0ac7c96d 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -94,7 +94,7 @@ static int MenuItem_PreBuild(WPARAM, LPARAM) GetClassName(hwndClist, cls, _countof(cls));
hwndClist = (!mir_wstrcmp(CLISTCONTROL_CLASSW, cls)) ? hwndClist : cli.hwndContactList;
HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
- Menu_ShowItem(hRenameMenuItem, hItem != 0);
+ Menu_ShowItem(hRenameMenuItem, hItem != nullptr);
return 0;
}
@@ -378,7 +378,7 @@ void fnDrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, HICON eventIcon) DeleteObject(hBr);
} //if
/* draw the icon */
- if (eventIcon != 0) {
+ if (eventIcon != nullptr) {
DrawState(dis->hDC, nullptr, nullptr, (LPARAM)eventIcon, 0, 2, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
DrawState(dis->hDC, nullptr, nullptr, (LPARAM)hIcon, 0, 4 + g_IconWidth, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
}
@@ -392,7 +392,7 @@ void fnDrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, HICON eventIcon) else if (dis->itemState & ODS_SELECTED)
DrawEdge(dis->hDC, &dis->rcItem, BDR_SUNKENOUTER, BF_RECT);
- if (eventIcon != 0) {
+ if (eventIcon != nullptr) {
DrawState(dis->hDC, nullptr, nullptr, (LPARAM)eventIcon, 0, 2, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
DrawState(dis->hDC, nullptr, nullptr, (LPARAM)hIcon, 0, 4 + g_IconWidth, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
}
@@ -445,7 +445,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM flags |= cluiopt.showgrip ? SBARS_SIZEGRIP : 0;
cli.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, cli.hInst, nullptr);
}
- cli.pfnCluiProtocolStatusChanged(0, 0);
+ cli.pfnCluiProtocolStatusChanged(0, nullptr);
//delay creation of CLC so that it can get the status icons right the first time (needs protocol modules loaded)
PostMessage(hwnd, M_CREATECLC, 0, 0);
@@ -510,7 +510,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (cluiopt.showsbar) {
SetWindowPos(cli.hwndStatus, nullptr, 0, rect.bottom - 20, rect.right - rect.left, 20, SWP_NOZORDER);
GetWindowRect(cli.hwndStatus, &rcStatus);
- cli.pfnCluiProtocolStatusChanged(0, 0);
+ cli.pfnCluiProtocolStatusChanged(0, nullptr);
}
else
rcStatus.top = rcStatus.bottom = 0;
@@ -646,7 +646,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (wParam)
SetForegroundWindow(hwnd);
AnimateWindow(hwnd, 200, AW_BLEND | (wParam ? 0 : AW_HIDE));
- SetWindowPos(cli.hwndContactTree, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ SetWindowPos(cli.hwndContactTree, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
}
break;
@@ -699,7 +699,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case POPUP_NEWGROUP:
SendMessage(cli.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
- Clist_GroupCreate(0, 0);
+ Clist_GroupCreate(0, nullptr);
break;
case POPUP_HIDEOFFLINE:
@@ -825,7 +825,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (rcWindow.bottom > rcWorkArea.bottom)
rcWindow.bottom = rcWorkArea.bottom;
}
- SetWindowPos(hwnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top,
+ SetWindowPos(hwnd, nullptr, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top,
SWP_NOZORDER | SWP_NOACTIVATE);
break;
}
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index 30c68295ff..8c3a5c06a1 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -134,7 +134,7 @@ MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *s const char* saveProto = szProto; szProto = "CList";
if (hContact != 0 && !ProcessDatabaseValueDefault(hContact, szProto, "MyHandle")) {
szProto = saveProto;
- return 0;
+ return nullptr;
}
szProto = saveProto;
}
@@ -270,7 +270,7 @@ MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *s return ProcessDatabaseValueDefault(hContact, "UserInfo", "MyNotes");
case CNF_TIMEZONE:
- HANDLE hTz = TimeZone_CreateByContact(hContact, 0, TZF_KNOWNONLY);
+ HANDLE hTz = TimeZone_CreateByContact(hContact, nullptr, TZF_KNOWNONLY);
if (hTz) {
LPTIME_ZONE_INFORMATION tzi = TimeZone_GetInfo(hTz);
int offset = tzi->Bias + tzi->StandardBias;
diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp index b1a0b64cc7..0723325a7f 100644 --- a/src/mir_app/src/database.cpp +++ b/src/mir_app/src/database.cpp @@ -312,7 +312,7 @@ static int getProfile(wchar_t *szProfile, size_t cch) return 0;
}
- PROFILEMANAGERDATA pd = { 0 };
+ PROFILEMANAGERDATA pd = {};
if (CmdLine_GetOption(L"ForceShowPM")) {
LBL_Show:
pd.ptszProfile = szProfile;
@@ -466,7 +466,7 @@ static BOOL CALLBACK EnumMirandaWindows(HWND hwnd, LPARAM lParam) static int FindMirandaForProfile(wchar_t *szProfile)
{
- ENUMMIRANDAWINDOW x = { 0 };
+ ENUMMIRANDAWINDOW x = {};
x.profile = szProfile;
x.msg = RegisterWindowMessage(L"Miranda::ProcessProfile");
x.aPath = GlobalAddAtom(szProfile);
diff --git a/src/mir_app/src/db_ini.cpp b/src/mir_app/src/db_ini.cpp index 02b241d0a1..0c22077b3d 100644 --- a/src/mir_app/src/db_ini.cpp +++ b/src/mir_app/src/db_ini.cpp @@ -241,7 +241,7 @@ void CIniImportDoneDlg::Delete_OnClick(CCtrlBase*) void CIniImportDoneDlg::Recycle_OnClick(CCtrlBase*)
{
ptrW szIniPath(m_iniPath.GetText());
- SHFILEOPSTRUCT shfo = { 0 };
+ SHFILEOPSTRUCT shfo = {};
shfo.wFunc = FO_DELETE;
shfo.pFrom = szIniPath;
szIniPath[mir_wstrlen(szIniPath) + 1] = '\0';
@@ -568,7 +568,7 @@ static void DoAutoExec(void) if (!mir_wstrcmpi(szOnCompletion, L"delete"))
DeleteFile(szIniPath);
else if (!mir_wstrcmpi(szOnCompletion, L"recycle")) {
- SHFILEOPSTRUCT shfo = { 0 };
+ SHFILEOPSTRUCT shfo = {};
shfo.wFunc = FO_DELETE;
shfo.pFrom = szIniPath;
szIniPath[mir_wstrlen(szIniPath) + 1] = 0;
diff --git a/src/mir_app/src/descbutton.cpp b/src/mir_app/src/descbutton.cpp index 1a064cfc11..a180400d1c 100644 --- a/src/mir_app/src/descbutton.cpp +++ b/src/mir_app/src/descbutton.cpp @@ -74,7 +74,7 @@ int LoadDescButtonModule() wc.lpfnWndProc = MDescButtonWndProc;
wc.hCursor = LoadCursor(nullptr, IDC_HAND);
wc.cbWndExtra = sizeof(MDescButtonCtrl *);
- wc.hbrBackground = 0; //GetStockObject(WHITE_BRUSH);
+ wc.hbrBackground = nullptr; //GetStockObject(WHITE_BRUSH);
wc.style = CS_GLOBALCLASS | CS_SAVEBITS;
RegisterClassEx(&wc);
return 0;
@@ -115,7 +115,7 @@ static void MDescButton_FillRect(HDC hdc, int x, int y, int width, int height, C COLORREF oldColor = SetBkColor(hdc, cl);
RECT rc; SetRect(&rc, x, y, x + width, y + height);
- ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, 0);
+ ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, nullptr);
SetBkMode(hdc, oldMode);
SetBkColor(hdc, oldColor);
@@ -135,7 +135,7 @@ static void MDescButton_DrawGradient(HDC hdc, int x, int y, int width, int heigh rc.top = rc.bottom = i;
++rc.bottom;
SetBkColor(hdc, color);
- ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, 0);
+ ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, nullptr);
}
SetBkMode(hdc, oldMode);
diff --git a/src/mir_app/src/dll_sniffer.cpp b/src/mir_app/src/dll_sniffer.cpp index 4b853dbba7..8d70cb75ec 100644 --- a/src/mir_app/src/dll_sniffer.cpp +++ b/src/mir_app/src/dll_sniffer.cpp @@ -62,7 +62,7 @@ MUUID* GetPluginInterfaces(const wchar_t* ptszFileName, bool& bIsPlugin) if (ptr == nullptr)
__leave;
- PIMAGE_NT_HEADERS pINTH = { 0 };
+ PIMAGE_NT_HEADERS pINTH = {};
PIMAGE_DOS_HEADER pIDH = (PIMAGE_DOS_HEADER)ptr;
if ( pIDH->e_magic == IMAGE_DOS_SIGNATURE )
pINTH = (PIMAGE_NT_HEADERS)(ptr + pIDH->e_lfanew);
diff --git a/src/mir_app/src/extracticon.cpp b/src/mir_app/src/extracticon.cpp index 4eb9f02afb..1303ddeb0b 100644 --- a/src/mir_app/src/extracticon.cpp +++ b/src/mir_app/src/extracticon.cpp @@ -230,7 +230,7 @@ UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HIC if (res)
return res;
- HANDLE hFile = CreateFile(lpszFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+ HANDLE hFile = CreateFile(lpszFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hFile == INVALID_HANDLE_VALUE)
return 0;
diff --git a/src/mir_app/src/extraicons.cpp b/src/mir_app/src/extraicons.cpp index 499d8d1505..af7fb41629 100644 --- a/src/mir_app/src/extraicons.cpp +++ b/src/mir_app/src/extraicons.cpp @@ -77,7 +77,7 @@ int ExtraImage_ExtraIDToColumnNum(int extra) int Clist_SetExtraIcon(MCONTACT hContact, int slot, HANDLE hImage)
{
- if (cli.hwndContactTree == 0)
+ if (cli.hwndContactTree == nullptr)
return -1;
int icol = ExtraImage_ExtraIDToColumnNum(ConvertToClistSlot(slot));
@@ -85,7 +85,7 @@ int Clist_SetExtraIcon(MCONTACT hContact, int slot, HANDLE hImage) return -1;
HANDLE hItem = (HANDLE)SendMessage(cli.hwndContactTree, CLM_FINDCONTACT, hContact, 0);
- if (hItem == 0)
+ if (hItem == nullptr)
return -1;
SendMessage(cli.hwndContactTree, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(icol, hImage));
@@ -280,7 +280,7 @@ static HIMAGELIST hExtraImageList; MIR_APP_DLL(HANDLE) ExtraIcon_AddIcon(HICON hIcon)
{
- if (hExtraImageList == 0 || hIcon == 0)
+ if (hExtraImageList == nullptr || hIcon == nullptr)
return INVALID_HANDLE_VALUE;
int res = ImageList_AddIcon(hExtraImageList, hIcon);
@@ -305,7 +305,7 @@ void fnReloadExtraIcons() void fnSetAllExtraIcons(MCONTACT hContact)
{
- if (cli.hwndContactTree == 0)
+ if (cli.hwndContactTree == nullptr)
return;
bool hcontgiven = (hContact != 0);
@@ -392,14 +392,14 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterCallback(const char *name, const {
// EXTRAICON_TYPE_CALLBACK
if (IsEmpty(name) || IsEmpty(description))
- return 0;
+ return nullptr;
if (ApplyIcon == nullptr || RebuildIcons == nullptr)
- return 0;
+ return nullptr;
// no way to merge
if (GetExtraIconByName(name) != nullptr)
- return 0;
+ return nullptr;
ptrW tszDesc(mir_a2u(description));
wchar_t *desc = TranslateW_LP(tszDesc, _hLang);
@@ -414,7 +414,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch MIRANDAHOOKPARAM OnClick, LPARAM onClickParam, int flags, int _hLang)
{
if (IsEmpty(name) || IsEmpty(description))
- return 0;
+ return nullptr;
ptrW tszDesc(mir_a2u(description));
wchar_t *desc = TranslateW_LP(tszDesc, _hLang);
@@ -422,7 +422,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch BaseExtraIcon *extra = GetExtraIconByName(name);
if (extra != nullptr) {
if (extra->getType() != EXTRAICON_TYPE_ICOLIB)
- return 0;
+ return nullptr;
// Found one, now merge it
if (mir_wstrcmpi(extra->getDescription(), desc)) {
diff --git a/src/mir_app/src/filter.cpp b/src/mir_app/src/filter.cpp index 53d35856df..eddc2ade65 100644 --- a/src/mir_app/src/filter.cpp +++ b/src/mir_app/src/filter.cpp @@ -151,7 +151,7 @@ void GetDialogStrings(int enableKeywordFiltering, const PageHash key, wchar_t *p if (tab) AddFilterString(key, tab);
if (name) AddFilterString(key, name);
- if ((enableKeywordFiltering) && (hWnd != 0)) {
+ if ((enableKeywordFiltering) && (hWnd != nullptr)) {
AddDialogString(hWnd, key);
EnumChildWindows(hWnd, GetDialogStringsCallback, (LPARAM)key);
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp index 7112774f6f..f01f633ef2 100644 --- a/src/mir_app/src/findadd.cpp +++ b/src/mir_app/src/findadd.cpp @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define M_SETGROUPVISIBILITIES (WM_USER+11) static HWND hwndFindAdd = nullptr; -static HANDLE hHookModulesLoaded = 0; +static HANDLE hHookModulesLoaded = nullptr; static HGENMENU hMainMenuItem = nullptr; static int OnSystemModulesLoaded(WPARAM wParam, LPARAM lParam); @@ -121,7 +121,7 @@ static void RenderThrobber(HDC hdc, RECT *rcItem, int *throbbing, int *pivot) if (*throbbing) { /* create memdc */ - HDC hMemDC = CreateCompatibleDC(0); + HDC hMemDC = CreateCompatibleDC(nullptr); HBITMAP hBitmap = (HBITMAP)SelectObject(hMemDC, CreateCompatibleBitmap(hdc, width, height)); /* flush it */ RECT rc; @@ -224,7 +224,7 @@ static void ShowAdvancedSearchDlg(HWND hwndDlg, FindAddDlgData *dat) if (dat->hwndAdvSearch != nullptr) mir_subclassWindow(dat->hwndAdvSearch, AdvancedSearchDlgSubclassProc); GetWindowRect(GetDlgItem(hwndDlg, IDC_RESULTS), &rc); - SetWindowPos(dat->hwndAdvSearch, 0, rc.left, rc.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + SetWindowPos(dat->hwndAdvSearch, nullptr, rc.left, rc.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE); } AnimateWindow(dat->hwndAdvSearch, 150, AW_ACTIVATE | AW_SLIDE | AW_HOR_POSITIVE); @@ -246,7 +246,7 @@ static void ReposTinySearchDlg(HWND hwndDlg, FindAddDlgData *dat) pt.x = rc.left; pt.y = rc.top; ScreenToClient(hwndDlg, &pt); - SetWindowPos(dat->hwndTinySearch, 0, pt.x + 5, pt.y + 15, rc.right - rc.left - 10, rc.bottom - rc.top - 30, SWP_NOZORDER); + SetWindowPos(dat->hwndTinySearch, nullptr, pt.x + 5, pt.y + 15, rc.right - rc.left - 10, rc.bottom - rc.top - 30, SWP_NOZORDER); } static void ShowTinySearchDlg(HWND hwndDlg, FindAddDlgData *dat) @@ -445,7 +445,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_MOVE: if (dat && dat->hwndAdvSearch) { GetWindowRect(hwndList, &rc); - SetWindowPos(dat->hwndAdvSearch, 0, rc.left, rc.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + SetWindowPos(dat->hwndAdvSearch, nullptr, rc.left, rc.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE); } break; @@ -543,7 +543,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetWindowRect(hwndDlg, &rc); if (rc.bottom - rc.top < mmi.ptMinTrackSize.y) - SetWindowPos(hwndDlg, 0, 0, 0, rc.right - rc.left, mmi.ptMinTrackSize.y, SWP_NOZORDER | SWP_NOMOVE); + SetWindowPos(hwndDlg, nullptr, 0, 0, rc.right - rc.left, mmi.ptMinTrackSize.y, SWP_NOZORDER | SWP_NOMOVE); } break; diff --git a/src/mir_app/src/headerbar.cpp b/src/mir_app/src/headerbar.cpp index 6a7d423cde..4d0419ca87 100644 --- a/src/mir_app/src/headerbar.cpp +++ b/src/mir_app/src/headerbar.cpp @@ -99,7 +99,7 @@ static void MHeaderbar_FillRect(HDC hdc, int x, int y, int width, int height, CO COLORREF oldColor = SetBkColor(hdc, cl);
RECT rc; SetRect(&rc, x, y, x+width, y+height);
- ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, 0);
+ ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, nullptr);
SetBkMode(hdc, oldMode);
SetBkColor(hdc, oldColor);
@@ -119,7 +119,7 @@ static void MHeaderbar_DrawGradient(HDC hdc, int x, int y, int width, int height rc.top = rc.bottom = i;
++rc.bottom;
SetBkColor(hdc, color);
- ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, 0);
+ ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, nullptr);
}
SetBkMode(hdc, oldMode);
@@ -281,7 +281,7 @@ static LRESULT CALLBACK MHeaderbarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam {
HWND hParent = GetParent(hwndDlg);
RECT rcWnd; GetWindowRect(hwndDlg, &rcWnd);
- itc->controlsToRedraw = 0;
+ itc->controlsToRedraw = nullptr;
itc->nControlsToRedraw = 0;
for (HWND hChild = FindWindowEx(hParent, nullptr, nullptr, nullptr); hChild; hChild = FindWindowEx(hParent, hChild, nullptr, nullptr)) {
if (hChild != hwndDlg) {
diff --git a/src/mir_app/src/hotkeys.cpp b/src/mir_app/src/hotkeys.cpp index 8359fd7b89..2be554b0f1 100644 --- a/src/mir_app/src/hotkeys.cpp +++ b/src/mir_app/src/hotkeys.cpp @@ -43,7 +43,7 @@ static int sttCompareHotkeys(const THotkeyItem *p1, const THotkeyItem *p2) LIST<THotkeyItem> hotkeys(10, sttCompareHotkeys);
DWORD g_pid = 0, g_hkid = 1;
HWND g_hwndHotkeyHost = nullptr, g_hwndHkOptions = nullptr;
-HANDLE hEvChanged = 0;
+HANDLE hEvChanged = nullptr;
static BOOL bModuleInitialized = FALSE;
static HHOOK hhkKeyboard = nullptr;
@@ -157,7 +157,7 @@ MIR_APP_DLL(int) Hotkey_Register(const HOTKEYDESC *desc, int _hLangpack) p->Enabled = !db_get_b(0, DBMODULENAME "Off", p->pszName, 0);
}
- p->pszService = desc->pszService ? mir_strdup(desc->pszService) : 0;
+ p->pszService = desc->pszService ? mir_strdup(desc->pszService) : nullptr;
p->DefHotkey = desc->DefHotKey & ~HKF_MIRANDA_LOCAL;
p->Hotkey = db_get_w(0, DBMODULENAME, p->pszName, p->DefHotkey);
p->type = p->pszService ?
@@ -343,7 +343,7 @@ int LoadSkinHotkeys(void) g_pid = GetCurrentProcessId();
g_hwndHotkeyHost = CreateWindow(L"MirandaHotkeyHostWnd", nullptr, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, nullptr, g_hInst, nullptr);
- SetWindowPos(g_hwndHotkeyHost, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_HIDEWINDOW);
+ SetWindowPos(g_hwndHotkeyHost, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_HIDEWINDOW);
hhkKeyboard = SetWindowsHookEx(WH_KEYBOARD, sttKeyboardProc, nullptr, hMainThreadId);
diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index 53ee612839..529c4c6c49 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -172,7 +172,7 @@ static int InternalGetDIB(HBITMAP bitmap, HPALETTE palette, void *bitmapInfo, vo {
if (InitializeBitmapInfoHeader(bitmap, (BITMAPINFOHEADER*)bitmapInfo)) return 1; // Failure
- HDC DC = CreateCompatibleDC(0);
+ HDC DC = CreateCompatibleDC(nullptr);
HPALETTE oldPal;
if (palette) {
oldPal = SelectPalette(DC, palette, FALSE);
@@ -246,8 +246,8 @@ int IconSourceItem::getIconData(HICON hIcon) ColorInfo((BYTE*)mir_calloc(ColorInfoSize)),
ColorBits((BYTE*)mir_calloc(ColorBitsSize));
- if (InternalGetDIB(iconInfo.hbmMask, 0, MonoInfo, MonoBits)
- || InternalGetDIB(iconInfo.hbmColor, 0, ColorInfo, ColorBits)) {
+ if (InternalGetDIB(iconInfo.hbmMask, nullptr, MonoInfo, MonoBits)
+ || InternalGetDIB(iconInfo.hbmColor, nullptr, ColorInfo, ColorBits)) {
DeleteObject(iconInfo.hbmColor);
DeleteObject(iconInfo.hbmMask);
return 1; // Failure
@@ -415,7 +415,7 @@ static void IcoLib_RemoveSection(SectionItem *section) IcolibItem* IcoLib_FindIcon(const char *pszIconName)
{
int indx = iconList.getIndex((IcolibItem*)&pszIconName);
- return (indx != -1) ? iconList[indx] : 0;
+ return (indx != -1) ? iconList[indx] : nullptr;
}
IcolibItem* IcoLib_FindHIcon(HICON hIcon, bool &big)
diff --git a/src/mir_app/src/iconheader.cpp b/src/mir_app/src/iconheader.cpp index ec7312a0ad..30351633f9 100644 --- a/src/mir_app/src/iconheader.cpp +++ b/src/mir_app/src/iconheader.cpp @@ -129,7 +129,7 @@ static void MIcoTab_FillRect(HDC hdc, int x, int y, int width, int height, COLOR COLORREF oldColor = SetBkColor(hdc, cl);
RECT rc; SetRect(&rc, x, y, x + width, y + height);
- ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, 0);
+ ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, nullptr);
SetBkMode(hdc, oldMode);
SetBkColor(hdc, oldColor);
@@ -151,7 +151,7 @@ static void MIcoTab_DrawGradient(HDC hdc, int x, int y, int width, int height, R rc.top = rc.bottom = i;
++rc.bottom;
SetBkColor(hdc, color);
- ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, 0);
+ ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, nullptr);
}
SetBkMode(hdc, oldMode);
diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp index 2c70ef2fce..85cb5468a9 100644 --- a/src/mir_app/src/lpopts.cpp +++ b/src/mir_app/src/lpopts.cpp @@ -35,7 +35,7 @@ static void ReloadOptions(void *hWnd) while (IsWindow((HWND)hWnd))
Sleep(50);
- CallFunctionAsync(OpenOptions, 0);
+ CallFunctionAsync(OpenOptions, nullptr);
}
MIR_CORE_DLL(int) LoadLangPackDescr(const wchar_t *szLangPack, LANGPACK_INFO *lpInfo);
@@ -132,7 +132,7 @@ void CLangpackDlg::LoadLangpacks() if (GetModuleFileName(nullptr, pack.tszFullPath, _countof(pack.tszFullPath))) {
mir_wstrcpy(pack.tszFileName, L"default");
- HANDLE hFile = CreateFile(pack.tszFileName, 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
+ HANDLE hFile = CreateFile(pack.tszFileName, 0, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr);
if (hFile != INVALID_HANDLE_VALUE) {
GetFileTime(hFile, nullptr, nullptr, &pack.ftFileDate);
CloseHandle(hFile);
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index 631944a56a..ef9cbe3281 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -172,7 +172,7 @@ MIR_APP_DLL(HGENMENU) Menu_AddMainMenuItem(TMO_MenuItem *pmi) {
MainMenuExecParam *mmep = (MainMenuExecParam*)mir_alloc(sizeof(MainMenuExecParam));
if (mmep == nullptr)
- return 0;
+ return nullptr;
//we need just one parametr.
mmep->szServiceName = mir_strdup(pmi->pszService);
@@ -718,7 +718,7 @@ static int MenuIconsChanged(WPARAM, LPARAM) {
// just rebuild menu
RebuildMenuOrder();
- cli.pfnCluiProtocolStatusChanged(0, 0);
+ cli.pfnCluiProtocolStatusChanged(0, nullptr);
return 0;
}
@@ -1122,7 +1122,7 @@ void InitCustomMenus(void) InitGenMenu();
// main menu
- hMainMenuObject = Menu_AddObject("MainMenu", LPGEN("Main menu"), 0, "MainMenuExecService");
+ hMainMenuObject = Menu_AddObject("MainMenu", LPGEN("Main menu"), nullptr, "MainMenuExecService");
Menu_ConfigureObject(hMainMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hMainMenuObject, MCO_OPT_FREE_SERVICE, (INT_PTR)"CLISTMENUS/FreeOwnerDataMainMenu");
diff --git a/src/mir_app/src/menu_groups.cpp b/src/mir_app/src/menu_groups.cpp index 8dd63adbf1..1fd344ccc3 100644 --- a/src/mir_app/src/menu_groups.cpp +++ b/src/mir_app/src/menu_groups.cpp @@ -56,7 +56,7 @@ MIR_APP_DLL(HGENMENU) Menu_AddGroupMenuItem(TMO_MenuItem *pmi, GroupMenuParam *g {
GroupMenuExecParam *mmep = (GroupMenuExecParam*)mir_calloc(sizeof(GroupMenuExecParam));
if (mmep == nullptr)
- return 0;
+ return nullptr;
// we need just one parametr.
mmep->szServiceName = mir_strdup(pmi->pszService);
@@ -135,7 +135,7 @@ static INT_PTR CreateGroupHelper(WPARAM, LPARAM) {
SendMessage(cli.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
SendMessage(cli.hwndContactTree, CLM_SETUSEGROUPS, 1, 0);
- Clist_GroupCreate(0, 0);
+ Clist_GroupCreate(0, nullptr);
return 0;
}
@@ -184,7 +184,7 @@ MIR_APP_DLL(HGENMENU) Menu_AddSubGroupMenuItem(TMO_MenuItem *pmi, GroupMenuParam {
SubGroupMenuExecParam *mmep = (SubGroupMenuExecParam*)mir_calloc(sizeof(SubGroupMenuExecParam));
if (mmep == nullptr)
- return 0;
+ return nullptr;
// we need just one parametr.
mmep->szServiceName = mir_strdup(pmi->pszService);
@@ -252,7 +252,7 @@ static HGENMENU hHideOfflineUsersHereMenuItem; static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
{
ClcGroup *group = (ClcGroup*)wParam;
- if (group != 0) // contact->group
+ if (group != nullptr) // contact->group
Menu_SetChecked(hHideOfflineUsersHereMenuItem, group->hideOffline != 0);
return 0;
}
@@ -280,7 +280,7 @@ void InitGroupMenus(void) hEventPreBuildGroupMenu = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu);
- hGroupMenuObject = Menu_AddObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
+ hGroupMenuObject = Menu_AddObject("GroupMenu", LPGEN("Group menu"), nullptr, "CLISTMENUSGroup/ExecService");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuOnAddService");
@@ -341,7 +341,7 @@ void InitGroupMenus(void) hEventPreBuildSubGroupMenu = CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
- hSubGroupMenuObject = Menu_AddObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
+ hSubGroupMenuObject = Menu_AddObject("SubGroupMenu", LPGEN("Subgroup menu"), nullptr, "CLISTMENUSSubGroup/ExecService");
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu");
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_CHECK_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuCheckService");
@@ -359,7 +359,7 @@ void InitGroupMenus(void) SET_UID(mi, 0xd85f5ff0, 0x12ca, 0x464d, 0x86, 0x51, 0x53, 0x36, 0x9f, 0x1d, 0x80, 0x45);
mi.position = 1001;
- mi.hIcolibItem = 0;
+ mi.hIcolibItem = nullptr;
mi.name.a = LPGEN("&Hide offline users in here");
gmp.wParam = POPUP_GROUPHIDEOFFLINE;
hHideOfflineUsersHereMenuItem = Menu_AddSubGroupMenuItem(&mi, &gmp);
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index b94f0e8185..ee60b96bc5 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -367,7 +367,7 @@ public: PD->name = mir_wstrdup(STR_SEPARATOR); PD->pos = ((MenuItemOptData *)tvi.lParam)->pos - 1; - TVINSERTSTRUCT tvis = { 0 }; + TVINSERTSTRUCT tvis = {}; tvis.item.lParam = (LPARAM)PD; tvis.item.pszText = PD->name; tvis.item.iImage = tvis.item.iSelectedImage = 1; @@ -405,7 +405,7 @@ public: PD->pos = pimi->mi.position; PD->pimi = pimi; - TVINSERTSTRUCT tvis = { 0 }; + TVINSERTSTRUCT tvis = {}; tvis.item.lParam = (LPARAM)PD; tvis.item.pszText = PD->name; tvis.item.iImage = tvis.item.iSelectedImage = 1; diff --git a/src/mir_app/src/menu_tray.cpp b/src/mir_app/src/menu_tray.cpp index 025a0692da..b020836cf9 100644 --- a/src/mir_app/src/menu_tray.cpp +++ b/src/mir_app/src/menu_tray.cpp @@ -110,7 +110,7 @@ void InitTrayMenus(void) hEventPreBuildTrayMenu = CreateHookableEvent(ME_CLIST_PREBUILDTRAYMENU);
// Tray menu
- hTrayMenuObject = Menu_AddObject("TrayMenu", LPGEN("Tray menu"), 0, "CLISTMENUSTRAY/ExecService");
+ hTrayMenuObject = Menu_AddObject("TrayMenu", LPGEN("Tray menu"), nullptr, "CLISTMENUSTRAY/ExecService");
Menu_ConfigureObject(hTrayMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hTrayMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSTRAY/FreeOwnerDataTrayMenu");
Menu_ConfigureObject(hTrayMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSTRAY/TrayMenuOnAddService");
diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index 05bb9445c9..5ba68d384c 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -220,7 +220,7 @@ EXTERN_C MIR_APP_DLL(BOOL) Menu_ProcessHotKey(int hMenuObject, int key) MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis)
{
if (pThis == nullptr)
- return 0;
+ return nullptr;
if (db_get_b(0, "CList", "MoveProtoMenus", TRUE)) {
if (pThis->m_hMainMenuItem != nullptr) {
@@ -747,7 +747,7 @@ MIR_APP_DLL(HGENMENU) Menu_AddItem(int hMenuObject, TMO_MenuItem *pmi, void *pUs if (pmi->uid != miid_last && pRoot->mi.uid == miid_last) {
char szUid[100];
bin2hex(&pmi->uid, sizeof(pmi->uid), szUid);
- Netlib_Logf(0, "[MENU]: fake UUID added to menu item %s", szUid);
+ Netlib_Logf(nullptr, "[MENU]: fake UUID added to menu item %s", szUid);
pRoot->mi.uid = pmi->uid;
pRoot->mi.uid.d[7]--; // and make it slightly different
@@ -1197,7 +1197,7 @@ int OnIconLibChanges(WPARAM, LPARAM) mir_cslock lck(csMenuHook);
for (int mo = 0; mo < g_menus.getCount(); mo++)
if (hStatusMenuObject != g_menus[mo]->id) //skip status menu
- MO_RecursiveWalkMenu(g_menus[mo]->m_items.first, MO_ReloadIcon, 0);
+ MO_RecursiveWalkMenu(g_menus[mo]->m_items.first, MO_ReloadIcon, nullptr);
}
cli.pfnReloadProtoMenus();
@@ -1235,7 +1235,7 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) }
}
- SKINICONDESC sid = { 0 };
+ SKINICONDESC sid = {};
sid.flags = SIDF_UNICODE;
sid.section.w = sectionName;
sid.pszName = iconame;
@@ -1259,7 +1259,7 @@ int RegisterAllIconsInIconLib() if (hStatusMenuObject == g_menus[mo]->id) //skip status menu
continue;
- MO_RecursiveWalkMenu(g_menus[mo]->m_items.first, MO_RegisterIcon, 0);
+ MO_RecursiveWalkMenu(g_menus[mo]->m_items.first, MO_RegisterIcon, nullptr);
}
return 0;
@@ -1272,7 +1272,7 @@ int posttimerid; static VOID CALLBACK PostRegisterIcons(HWND, UINT, UINT_PTR, DWORD)
{
- KillTimer(0, posttimerid);
+ KillTimer(nullptr, posttimerid);
RegisterAllIconsInIconLib();
}
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index 7695ed0b98..0d40feaab0 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -336,7 +336,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara case IDC_BTN_SETDEFAULT:
sel = ListView_GetNextItem(hwndList, -1, LVNI_FOCUSED | LVNI_SELECTED);
- InvalidateRect(hwndList, 0, TRUE);
+ InvalidateRect(hwndList, nullptr, TRUE);
g_data.hDefaultContact = g_data.hContact[sel];
SendMessage(hwndDlg, WMU_SETTITLE, 0, (LPARAM)g_data.hContact[sel]);
@@ -348,7 +348,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara case IDC_BTN_SETOFFLINE:
sel = ListView_GetNextItem(hwndList, -1, LVNI_FOCUSED | LVNI_SELECTED);
- InvalidateRect(hwndList, 0, TRUE);
+ InvalidateRect(hwndList, nullptr, TRUE);
if (g_data.hContact[sel] != g_data.hOfflineContact)
g_data.hOfflineContact = g_data.hContact[sel];
else
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index f072e66bb7..ce279883c1 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -72,7 +72,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM) // Assign the contact to the MetaContact just created (and make default).
if (!Meta_Assign(wParam, hMetaContact, TRUE)) {
- MessageBox(0, TranslateT("There was a problem in assigning the contact to the metacontact"), TranslateT("Error"), MB_ICONEXCLAMATION);
+ MessageBox(nullptr, TranslateT("There was a problem in assigning the contact to the metacontact"), TranslateT("Error"), MB_ICONEXCLAMATION);
db_delete_contact(hMetaContact);
return 0;
}
@@ -207,7 +207,7 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion) return 2;
if (cc->nSubs == 1) {
- if (IDYES == MessageBox(0, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
+ if (IDYES == MessageBox(nullptr, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
Meta_Delete(cc->contactID, 1);
return 0;
@@ -405,7 +405,7 @@ void InitMenus() SET_UID(mi, 0xd31e772d, 0xf85a, 0x45e9, 0xb3, 0xa8, 0xf7, 0xa5, 0xf4, 0xfc, 0xf9, 0x6e);
mi.position = -99000;
mi.flags = CMIF_HIDDEN;
- mi.hIcolibItem = 0;
+ mi.hIcolibItem = nullptr;
mi.name.a = LPGEN("Subcontacts");
hMenuRoot = Menu_AddContactMenuItem(&mi);
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 350b30187f..f1dbaa3124 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern "C" MIR_CORE_DLL(void) db_mc_notifyDefChange(WPARAM wParam, LPARAM lParam);
-char *pendingACK = 0; // Name of the protocol in which an ACK is about to come.
+char *pendingACK = nullptr; // Name of the protocol in which an ACK is about to come.
int previousMode, // Previous status of the MetaContacts Protocol
mcStatus; // Current status of the MetaContacts Protocol
@@ -144,7 +144,7 @@ void CALLBACK SetStatusThread(HWND, UINT, UINT_PTR, DWORD) mcStatus = ID_STATUS_ONLINE;
ProtoBroadcastAck(META_PROTO, 0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)previousMode, mcStatus);
- KillTimer(0, setStatusTimerId);
+ KillTimer(nullptr, setStatusTimerId);
}
/** Changes the status and notifies everybody
@@ -157,7 +157,7 @@ INT_PTR Meta_SetStatus(WPARAM wParam, LPARAM) // firstSetOnline starts out true - used to delay metacontact's 'onlineness' to prevent double status notifications on startup
if (mcStatus == ID_STATUS_OFFLINE && firstSetOnline) {
// causes crash on exit if miranda is closed in under options.set_status_from_offline milliseconds!
- setStatusTimerId = SetTimer(0, 0, g_metaOptions.set_status_from_offline_delay, SetStatusThread);
+ setStatusTimerId = SetTimer(nullptr, 0, g_metaOptions.set_status_from_offline_delay, SetStatusThread);
firstSetOnline = FALSE;
}
else {
@@ -306,7 +306,7 @@ int Meta_HandleACK(WPARAM, LPARAM lParam) return ProtoBroadcastAck(META_PROTO, cc->contactID, ack->type, ack->result, (HANDLE)&ai, ack->lParam);
}
- return ProtoBroadcastAck(META_PROTO, cc->contactID, ack->type, ack->result, 0, ack->lParam);
+ return ProtoBroadcastAck(META_PROTO, cc->contactID, ack->type, ack->result, nullptr, ack->lParam);
}
}
@@ -823,7 +823,7 @@ int Meta_PreShutdown(WPARAM, LPARAM) Meta_SetStatus(ID_STATUS_OFFLINE, 0);
Meta_SuppressStatus(FALSE);
if (setStatusTimerId)
- KillTimer(0, setStatusTimerId);
+ KillTimer(nullptr, setStatusTimerId);
return 0;
}
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index b59e268b1a..9faf308c9f 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -65,7 +65,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) char *szProto = GetContactProto(hSub);
if (szProto == nullptr) {
- MessageBox(0, TranslateT("Could not retrieve contact protocol"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
+ MessageBox(nullptr, TranslateT("Could not retrieve contact protocol"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
@@ -73,19 +73,19 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) char *field = (char *)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
DBVARIANT dbv;
if (db_get(hSub, szProto, field, &dbv)) {
- MessageBox(0, TranslateT("Could not get unique ID of contact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
+ MessageBox(nullptr, TranslateT("Could not get unique ID of contact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
// Check that is is 'on the list'
if (db_get_b(hSub, "CList", "NotOnList", 0) == 1) {
- MessageBox(0, TranslateT("Contact is 'not on list' - please add the contact to your contact list before assigning."), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
+ MessageBox(nullptr, TranslateT("Contact is 'not on list' - please add the contact to your contact list before assigning."), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
return FALSE;
}
if (ccDest->nSubs >= MAX_CONTACTS) {
- MessageBox(0, TranslateT("Metacontact is full"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
+ MessageBox(nullptr, TranslateT("Metacontact is full"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
return FALSE;
}
@@ -94,7 +94,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) char buffer[512];
mir_snprintf(buffer, "Protocol%d", ccDest->nSubs);
if (db_set_s(hMeta, META_PROTO, buffer, szProto)) {
- MessageBox(0, TranslateT("Could not write contact protocol to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
+ MessageBox(nullptr, TranslateT("Could not write contact protocol to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
return FALSE;
}
@@ -102,7 +102,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) // write the login
mir_snprintf(buffer, "Login%d", ccDest->nSubs);
if (db_set(hMeta, META_PROTO, buffer, &dbv)) {
- MessageBox(0, TranslateT("Could not write unique ID of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
+ MessageBox(nullptr, TranslateT("Could not write unique ID of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
return FALSE;
}
@@ -114,7 +114,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) // write the nickname
mir_snprintf(buffer, "Nick%d", ccDest->nSubs);
if (db_set(hMeta, META_PROTO, buffer, &dbv)) {
- MessageBox(0, TranslateT("Could not write nickname of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
+ MessageBox(nullptr, TranslateT("Could not write nickname of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
return FALSE;
}
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index 9070274cd1..16babee8e5 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -273,7 +273,7 @@ int WINAPI mir_main(LPTSTR cmdLine) getBufferedPaintBits = (pfnGetBufferedPaintBits)GetProcAddress(hThemeAPI, "GetBufferedPaintBits");
}
}
- else hDwmApi = hThemeAPI = 0;
+ else hDwmApi = hThemeAPI = nullptr;
if (bufferedPaintInit)
bufferedPaintInit();
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp index 0481c118aa..a1336a27f2 100644 --- a/src/mir_app/src/movetogroup.cpp +++ b/src/mir_app/src/movetogroup.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-static HGENMENU hMoveToGroupItem = 0, hPriorityItem = 0, hFloatingItem = 0;
+static HGENMENU hMoveToGroupItem = nullptr, hPriorityItem = nullptr, hFloatingItem = nullptr;
static LIST<HANDLE> lphGroupsItems(5);
#define MTG_MOVE "MoveToGroup/Move"
diff --git a/src/mir_app/src/netlib.cpp b/src/mir_app/src/netlib.cpp index a6e59fc49b..faa1b44cac 100644 --- a/src/mir_app/src/netlib.cpp +++ b/src/mir_app/src/netlib.cpp @@ -139,7 +139,7 @@ MIR_APP_DLL(HNETLIBUSER) Netlib_RegisterUser(const NETLIBUSER *nlu) {
if (nlu == nullptr || nlu->szSettingsModule == nullptr || (!(nlu->flags & NUF_NOOPTIONS) && nlu->szDescriptiveName.w == nullptr)) {
SetLastError(ERROR_INVALID_PARAMETER);
- return 0;
+ return nullptr;
}
HNETLIBUSER thisUser = (HNETLIBUSER)mir_calloc(sizeof(NetlibUser));
@@ -154,7 +154,7 @@ MIR_APP_DLL(HNETLIBUSER) Netlib_RegisterUser(const NETLIBUSER *nlu) if (idx != -1) {
mir_free(thisUser);
SetLastError(ERROR_DUP_NAME);
- return 0;
+ return nullptr;
}
if (nlu->szDescriptiveName.w)
@@ -166,7 +166,7 @@ MIR_APP_DLL(HNETLIBUSER) Netlib_RegisterUser(const NETLIBUSER *nlu) {
mir_free(thisUser);
SetLastError(ERROR_OUTOFMEMORY);
- return 0;
+ return nullptr;
}
if (nlu->szHttpGatewayHello)
thisUser->user.szHttpGatewayHello = mir_strdup(nlu->szHttpGatewayHello);
@@ -320,7 +320,7 @@ MIR_APP_DLL(int) Netlib_CloseHandle(HANDLE hNetlib) MIR_APP_DLL(UINT_PTR) Netlib_GetSocket(HNETLIBCONN hConnection)
{
SOCKET s;
- if (hConnection == 0) {
+ if (hConnection == nullptr) {
s = INVALID_SOCKET;
SetLastError(ERROR_INVALID_PARAMETER);
}
diff --git a/src/mir_app/src/netlibbind.cpp b/src/mir_app/src/netlibbind.cpp index eb1ecb92b6..3700a7a4b9 100644 --- a/src/mir_app/src/netlibbind.cpp +++ b/src/mir_app/src/netlibbind.cpp @@ -168,7 +168,7 @@ static void NetlibBindAcceptThread(void* param) }
NetlibUPnPDeletePortMapping(nlbp->wExPort, "TCP");
- nlbp->hThread = 0;
+ nlbp->hThread = nullptr;
Netlib_Logf(nlbp->nlu, "NetlibBindAcceptThread: (%p) thread for port %u closed", nlbp->s, nlbp->wPort);
}
diff --git a/src/mir_app/src/netlibhttp.cpp b/src/mir_app/src/netlibhttp.cpp index 2b06b8816a..137907481f 100644 --- a/src/mir_app/src/netlibhttp.cpp +++ b/src/mir_app/src/netlibhttp.cpp @@ -821,7 +821,7 @@ MIR_APP_DLL(NETLIBHTTPREQUEST*) Netlib_HttpTransaction(HNETLIBUSER nlu, NETLIBHT nlhr->szUrl == nullptr || nlhr->szUrl[0] == 0)
{
SetLastError(ERROR_INVALID_PARAMETER);
- return 0;
+ return nullptr;
}
if (nlhr->nlc != nullptr && GetNetlibHandleType(nlhr->nlc) != NLH_CONNECTION)
@@ -829,7 +829,7 @@ MIR_APP_DLL(NETLIBHTTPREQUEST*) Netlib_HttpTransaction(HNETLIBUSER nlu, NETLIBHT NetlibConnection *nlc = NetlibHttpProcessUrl(nlhr, nlu, (NetlibConnection*)nlhr->nlc);
if (nlc == nullptr)
- return 0;
+ return nullptr;
NETLIBHTTPREQUEST nlhrSend = *nlhr;
nlhrSend.flags |= NLHRF_SMARTREMOVEHOST;
@@ -869,7 +869,7 @@ MIR_APP_DLL(NETLIBHTTPREQUEST*) Netlib_HttpTransaction(HNETLIBUSER nlu, NETLIBHT if (!doneUserAgentHeader || !doneAcceptEncoding) mir_free(nlhrSend.headers);
nlhr->resultCode = nlhrSend.resultCode;
Netlib_CloseHandle(nlc);
- return 0;
+ return nullptr;
}
if (!doneUserAgentHeader || !doneAcceptEncoding)
mir_free(nlhrSend.headers);
diff --git a/src/mir_app/src/netliblog.cpp b/src/mir_app/src/netliblog.cpp index cfd56e8b92..b08196bfcb 100644 --- a/src/mir_app/src/netliblog.cpp +++ b/src/mir_app/src/netliblog.cpp @@ -44,7 +44,7 @@ struct { int textDumps, autoDetectText;
CMStringW tszFile, tszUserFile;
}
-static logOptions = { 0 };
+static logOptions = {};
struct LOGMSG
{
@@ -122,7 +122,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa HWND hwndFilter = GetDlgItem(hwndDlg, IDC_FILTER);
SetWindowLongPtr(hwndFilter, GWL_STYLE, GetWindowLongPtr(hwndFilter, GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
- TVINSERTSTRUCT tvis = { 0 };
+ TVINSERTSTRUCT tvis = {};
tvis.hInsertAfter = TVI_SORT;
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
diff --git a/src/mir_app/src/netlibopenconn.cpp b/src/mir_app/src/netlibopenconn.cpp index 12e0cf7a79..57514b824c 100644 --- a/src/mir_app/src/netlibopenconn.cpp +++ b/src/mir_app/src/netlibopenconn.cpp @@ -67,7 +67,7 @@ int WaitUntilReadable(SOCKET s, DWORD dwTimeout, bool check) FD_ZERO(&readfd); FD_SET(s, &readfd); - int result = select(0, &readfd, 0, 0, &tv); + int result = select(0, &readfd, nullptr, nullptr, &tv); if (result == 0 && !check) SetLastError(ERROR_TIMEOUT); return result; } @@ -83,7 +83,7 @@ int WaitUntilWritable(SOCKET s, DWORD dwTimeout) FD_ZERO(&writefd); FD_SET(s, &writefd); - switch(select(0, 0, &writefd, 0, &tv)) { + switch(select(0, nullptr, &writefd, nullptr, &tv)) { case 0: SetLastError(ERROR_TIMEOUT); case SOCKET_ERROR: @@ -774,7 +774,7 @@ bool NetlibDoConnect(NetlibConnection *nlc) Netlib_Logf(nlu, "(%d) Connected to %s:%d", nlc->s, nloc->szHost, nloc->wPort); if (NLOCF_SSL & nloc->flags) - return Netlib_StartSsl(nlc, 0) != 0; + return Netlib_StartSsl(nlc, nullptr) != 0; return true; } @@ -840,7 +840,7 @@ MIR_APP_DLL(HNETLIBCONN) Netlib_OpenConnection(NetlibUser *nlu, const NETLIBOPEN if (!NetlibDoConnect(nlc)) { FreePartiallyInitedConnection(nlc); - return 0; + return nullptr; } if (iUPnPCleanup == 0) { diff --git a/src/mir_app/src/netlibupnp.cpp b/src/mir_app/src/netlibupnp.cpp index 20ed26b7df..93ad70943f 100644 --- a/src/mir_app/src/netlibupnp.cpp +++ b/src/mir_app/src/netlibupnp.cpp @@ -192,7 +192,7 @@ void parseURL(char* szUrl, char* szHost, unsigned short* sPort, char* szPath) static void LongLog(char* szData)
{
- Netlib_Logf(0, szData);
+ Netlib_Logf(nullptr, szData);
}
static void closeRouterConnection(void)
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index ed8b47670c..72cf664159 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -921,5 +921,5 @@ void UnloadNewPluginsModule(void) if (hPluginListHeap)
HeapDestroy(hPluginListHeap);
- hPluginListHeap = 0;
+ hPluginListHeap = nullptr;
}
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index 33962626fb..2ec51ee4cb 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -263,7 +263,7 @@ struct OptionsPageData : public MZeroedObject void FindFilterStrings(int enableKeywordFiltering, int current, HWND hWndParent)
{
- HWND hWnd = 0;
+ HWND hWnd = nullptr;
if (enableKeywordFiltering) {
if (current)
hWnd = getHwnd();
diff --git a/src/mir_app/src/options_ei.cpp b/src/mir_app/src/options_ei.cpp index 490c1769b0..986520b831 100644 --- a/src/mir_app/src/options_ei.cpp +++ b/src/mir_app/src/options_ei.cpp @@ -29,7 +29,7 @@ int SortFunc(const ExtraIcon *p1, const ExtraIcon *p2); struct intlist
{
- intlist() : count(0), data(0) {}
+ intlist() : count(0), data(nullptr) {}
~intlist() { mir_free(data); }
void add(int val)
@@ -97,7 +97,7 @@ class CExtraIconOptsDlg : public CDlgBase intlist *ids = new intlist();
ids->add(extra->getID());
- TVINSERTSTRUCT tvis = { 0 };
+ TVINSERTSTRUCT tvis = {};
tvis.hInsertAfter = hAfter;
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
@@ -125,7 +125,7 @@ class CExtraIconOptsDlg : public CDlgBase desc += extra->getDescription();
}
- TVINSERTSTRUCT tvis = { 0 };
+ TVINSERTSTRUCT tvis = {};
tvis.hInsertAfter = hAfter;
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
@@ -291,7 +291,7 @@ public: else Tree_AddExtraIcon((BaseExtraIcon *)extra, extra->isEnabled());
}
- TVSORTCB sort = { 0 };
+ TVSORTCB sort = {};
sort.hParent = nullptr;
sort.lParam = 0;
sort.lpfnCompare = CompareFunc;
diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp index 6d69012470..5c97c7efde 100644 --- a/src/mir_app/src/path.cpp +++ b/src/mir_app/src/path.cpp @@ -286,7 +286,7 @@ XCHAR *ReplaceVariables(const XCHAR *str, MCONTACT hContact, REPLACEVARSARRAY *v if (!str)
return nullptr;
- const XCHAR *varStart = 0, *p;
+ const XCHAR *varStart = nullptr, *p;
size_t length = 0;
bool bFree;
@@ -302,7 +302,7 @@ XCHAR *ReplaceVariables(const XCHAR *str, MCONTACT hContact, REPLACEVARSARRAY *v else // variable not found
length += p-varStart+2;
- varStart = 0;
+ varStart = nullptr;
}
else varStart = p+1;
}
@@ -331,7 +331,7 @@ XCHAR *ReplaceVariables(const XCHAR *str, MCONTACT hContact, REPLACEVARSARRAY *v _xcsncpy(q, varStart-1, p-varStart+2);
q += p-varStart+2;
}
- varStart = 0;
+ varStart = nullptr;
}
else varStart = p+1;
}
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index 081ecbcd73..696300befd 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -241,7 +241,7 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP ListView_EnsureVisible(hwnd, idx, FALSE);
if (timerID != 0)
KillTimer(hwnd, timerID);
- timerID = SetTimer(hwnd, 1, 1500, 0);
+ timerID = SetTimer(hwnd, 1, 1500, nullptr);
return TRUE;
}
}
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index 6093275ec0..ffecb64982 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -74,7 +74,7 @@ static int findProfiles(wchar_t *szProfileDir, ENUMPROFILECALLBACK callback, LPA static LRESULT CALLBACK ProfileNameValidate(HWND edit, UINT msg, WPARAM wParam, LPARAM lParam) { if (msg == WM_CHAR) { - if (wcschr(L".?/\\#' ", (wchar_t)wParam) != 0) + if (wcschr(L".?/\\#' ", (wchar_t)wParam) != nullptr) return 0; PostMessage(GetParent(edit), WM_INPUTCHANGED, 0, 0); } @@ -102,7 +102,7 @@ class CCreateProfileDlg : public CDlgBase return 0; // move the file - SHFILEOPSTRUCT sf = { 0 }; + SHFILEOPSTRUCT sf = {}; sf.wFunc = FO_DELETE; sf.pFrom = buf; sf.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO; @@ -348,7 +348,7 @@ class CChooseProfileDlg : public CDlgBase mir_snwprintf(profilef, L"%s\\%s%c", m_pd->ptszProfileDir, profile, 0); - SHFILEOPSTRUCT sf = { 0 }; + SHFILEOPSTRUCT sf = {}; sf.wFunc = FO_DELETE; sf.pFrom = profilef; sf.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_ALLOWUNDO; diff --git a/src/mir_app/src/proto_internal.cpp b/src/mir_app/src/proto_internal.cpp index bf5603a41c..817f947f56 100644 --- a/src/mir_app/src/proto_internal.cpp +++ b/src/mir_app/src/proto_internal.cpp @@ -226,7 +226,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE ccs.wParam = (WPARAM)mir_u2a(szDescription);
ccs.lParam = (LPARAM)Proto_FilesMatrixA(ppszFiles);
HANDLE res = (HANDLE)ProtoCallService(m_szModuleName, PSS_FILE, 0, (LPARAM)&ccs);
- if (res == 0) FreeFilesMatrix((wchar_t***)&ccs.lParam);
+ if (res == nullptr) FreeFilesMatrix((wchar_t***)&ccs.lParam);
mir_free((char*)ccs.wParam);
return res;
}
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index 9bd0d101bf..b40c692c77 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -296,7 +296,7 @@ class CAccountManagerDlg : public CDlgBase m_btnEdit.Enable(!pa->bOldProto && !pa->bDynDisabled);
m_btnRemove.Enable(true);
m_btnUpgrade.Enable(pa->bOldProto || pa->bDynDisabled);
- m_btnOptions.Enable(pa->ppro != 0);
+ m_btnOptions.Enable(pa->ppro != nullptr);
if (m_iSelected >= 0) {
PROTOACCOUNT *pa_old = (PROTOACCOUNT *)m_accList.GetItemData(m_iSelected);
diff --git a/src/mir_app/src/searchresults.cpp b/src/mir_app/src/searchresults.cpp index 97cc49279e..b20ad38017 100644 --- a/src/mir_app/src/searchresults.cpp +++ b/src/mir_app/src/searchresults.cpp @@ -190,7 +190,7 @@ static void BeginSearchFailed(void *arg) mir_free((char*)arg);
}
else mir_wstrncpy(buf, TranslateT("Could not search on any of the protocols, are you online?"), _countof(buf));
- MessageBox(0, buf, TranslateT("Problem with search"), MB_OK | MB_ICONERROR);
+ MessageBox(nullptr, buf, TranslateT("Problem with search"), MB_OK | MB_ICONERROR);
}
int BeginSearch(HWND, struct FindAddDlgData *dat, const char *szProto, const char *szSearchService, DWORD requiredCapability, void *pvSearchParams)
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index ce57bb3403..a5a5e2d3e2 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -406,7 +406,7 @@ class CIcoLibOptsDlg : public CDlgBase hItem = FindNamedTreeItemAt(hSection, pItemName);
if (!sectionName || !hItem) {
if (!hItem) {
- TVINSERTSTRUCT tvis = { 0 };
+ TVINSERTSTRUCT tvis = {};
TreeItem *treeItem = (TreeItem *)mir_alloc(sizeof(TreeItem));
treeItem->value = SECTIONPARAM_MAKE(indx, sectionLevel, sectionName ? 0 : SECTIONPARAM_HAVEPAGE);
treeItem->paramName = mir_u2a(itemName);
@@ -441,7 +441,7 @@ class CIcoLibOptsDlg : public CDlgBase ShowWindow(m_categoryList.GetHwnd(), SW_SHOW);
- m_categoryList.SelectItem(FindNamedTreeItemAt(0, nullptr));
+ m_categoryList.SelectItem(FindNamedTreeItemAt(nullptr, nullptr));
}
int OpenPopupMenu()
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index 065c09aebd..485b172d54 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -36,62 +36,62 @@ struct StandardIconDescription static struct StandardIconDescription mainIcons[] =
{
- { SKINICON_OTHER_MIRANDA, LPGEN("Miranda NG"), -IDI_MIRANDA, 0, 0 }, // 0
- { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG, 0, 0 }, // 1
- { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL, 0, 0 }, // 2
- { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE, 0, 0 }, // 3
- { SKINICON_OTHER_USERONLINE, LPGEN("User online"), -IDI_USERONLINE, 0, 0 }, // 4
- { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (open)"), -IDI_GROUPOPEN, 0, 0 }, // 5
- { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (closed)"), -IDI_GROUPSHUT, 0, 0 }, // 6
- { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD, 0, 0 }, // 7
- { SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact"), -IDI_ADDCONTACT, 0, 0 }, // 8
- { SKINICON_OTHER_USERDETAILS, LPGEN("User details"), -IDI_USERDETAILS, 0, 0 }, // 9
- { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY, 0, 0 }, // 10
- { SKINICON_OTHER_DOWNARROW, LPGEN("Down arrow"), -IDI_DOWNARROW, 0, 0 }, // 11
- { SKINICON_OTHER_FINDUSER, LPGEN("Find user"), -IDI_FINDUSER, 0, 0 }, // 12
- { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS, 0, 0 }, // 13
- { SKINICON_OTHER_SENDEMAIL, LPGEN("Send e-mail"), -IDI_SENDEMAIL, 0, 0 }, // 14
- { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE, 0, 0 }, // 15
- { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME, 0, 0 }, // 16
- { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS, 0, 0 }, // 17
- { SKINICON_OTHER_SEARCHALL, LPGEN("Search all"), -IDI_SEARCHALL, 0, 0 }, // 18
- { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK, 0, 0 }, // 19
- { SKINICON_OTHER_NOTICK, LPGEN("No tick"), -IDI_NOTICK, 0, 0 }, // 20
- { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP, 0, 0 }, // 21
- { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda website"), -IDI_MIRANDAWEBSITE, 0, 0 }, // 22
- { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING, 0, 0 }, // 23
- { SKINICON_OTHER_SMALLDOT, LPGEN("Small dot"), -IDI_SMALLDOT, 0, 0 }, // 24
- { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled blob"), -IDI_FILLEDBLOB, 0, 0 }, // 25
- { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty blob"), -IDI_EMPTYBLOB, 0, 0 }, // 26
- { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE, 0, 0 }, // 27
- { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI, 0, 0 }, // 28
- { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED, 0, 0 }, // 29
- { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED, 0, 0 }, // 30
- { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO, 0, 0 }, // 31
- { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW, 0, 0 }, // 32
- { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS, 0, 0 }, // 33
- { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR, 0, 0 }, // 34
- { SKINICON_OTHER_SHOWHIDE, LPGEN("Show/Hide"), -IDI_SHOWHIDE, 0, 0 }, // 35
- { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT, 0, 0 }, // 36
- { SKINICON_OTHER_MAINMENU, LPGEN("Main menu"), -IDI_MAINMENU, 0, 0 }, // 37
- { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE, 0, 0 }, // 38
- { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT, 0, 0 }, // 39
- { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT, 0, 0 }, // 40
- { SKINICON_OTHER_GROUP, LPGEN("Move to group"), -IDI_MOVETOGROUP, 0, 0 }, // 41
- { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON, 0, 0 }, // 42
- { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF, 0, 0 }, // 43
- { SKINICON_OTHER_LOADEDGRAY, LPGEN("Running core plugin"), -IDI_LOADED_GRAY, 0, 0 }, // 44
- { SKINICON_OTHER_NOTLOADEDGRAY, LPGEN("Non-loadable plugin"), -IDI_NOTLOADED_GRAY, 0, 0 }, // 45
- { SKINICON_OTHER_FRAME, LPGEN("Frames"), -IDI_FRAME, 0, 0 }, // 46
- { SKINICON_OTHER_GROUPADD, LPGEN("Add group"), -IDI_ADDGROUP, 0, 0 }, // 47
- { SKINICON_AUTH_ADD, LPGEN("Add to list"), -IDI_AUTH_ADD, 0, 0 }, // 48
- { SKINICON_AUTH_REQUEST, LPGEN("Request authorization"), -IDI_AUTH_REQUEST, 0, 0 }, // 49
- { SKINICON_AUTH_GRANT, LPGEN("Grant authorization"), -IDI_AUTH_GRANT, 0, 0 }, // 50
- { SKINICON_AUTH_REVOKE, LPGEN("Revoke authorization"), -IDI_AUTH_REVOKE, 0, 0 }, // 51
- { SKINICON_FATAL, LPGEN("Fatal error"), -IDI_MFATAL, 0, 0 }, // 52
- { SKINICON_ERROR, LPGEN("Error"), -IDI_MERROR, 0, 0 }, // 53
- { SKINICON_WARNING, LPGEN("Warning"), -IDI_MWARNING, 0, 0 }, // 54
- { SKINICON_INFORMATION, LPGEN("Information"), -IDI_MINFO, 0, 0 }, // 55
+ { SKINICON_OTHER_MIRANDA, LPGEN("Miranda NG"), -IDI_MIRANDA, 0, nullptr }, // 0
+ { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG, 0, nullptr }, // 1
+ { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL, 0, nullptr }, // 2
+ { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE, 0, nullptr }, // 3
+ { SKINICON_OTHER_USERONLINE, LPGEN("User online"), -IDI_USERONLINE, 0, nullptr }, // 4
+ { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (open)"), -IDI_GROUPOPEN, 0, nullptr }, // 5
+ { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (closed)"), -IDI_GROUPSHUT, 0, nullptr }, // 6
+ { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD, 0, nullptr }, // 7
+ { SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact"), -IDI_ADDCONTACT, 0, nullptr }, // 8
+ { SKINICON_OTHER_USERDETAILS, LPGEN("User details"), -IDI_USERDETAILS, 0, nullptr }, // 9
+ { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY, 0, nullptr }, // 10
+ { SKINICON_OTHER_DOWNARROW, LPGEN("Down arrow"), -IDI_DOWNARROW, 0, nullptr }, // 11
+ { SKINICON_OTHER_FINDUSER, LPGEN("Find user"), -IDI_FINDUSER, 0, nullptr }, // 12
+ { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS, 0, nullptr }, // 13
+ { SKINICON_OTHER_SENDEMAIL, LPGEN("Send e-mail"), -IDI_SENDEMAIL, 0, nullptr }, // 14
+ { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE, 0, nullptr }, // 15
+ { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME, 0, nullptr }, // 16
+ { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS, 0, nullptr }, // 17
+ { SKINICON_OTHER_SEARCHALL, LPGEN("Search all"), -IDI_SEARCHALL, 0, nullptr }, // 18
+ { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK, 0, nullptr }, // 19
+ { SKINICON_OTHER_NOTICK, LPGEN("No tick"), -IDI_NOTICK, 0, nullptr }, // 20
+ { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP, 0, nullptr }, // 21
+ { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda website"), -IDI_MIRANDAWEBSITE, 0, nullptr }, // 22
+ { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING, 0, nullptr }, // 23
+ { SKINICON_OTHER_SMALLDOT, LPGEN("Small dot"), -IDI_SMALLDOT, 0, nullptr }, // 24
+ { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled blob"), -IDI_FILLEDBLOB, 0, nullptr }, // 25
+ { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty blob"), -IDI_EMPTYBLOB, 0, nullptr }, // 26
+ { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE, 0, nullptr }, // 27
+ { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI, 0, nullptr }, // 28
+ { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED, 0, nullptr }, // 29
+ { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED, 0, nullptr }, // 30
+ { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO, 0, nullptr }, // 31
+ { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW, 0, nullptr }, // 32
+ { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS, 0, nullptr }, // 33
+ { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR, 0, nullptr }, // 34
+ { SKINICON_OTHER_SHOWHIDE, LPGEN("Show/Hide"), -IDI_SHOWHIDE, 0, nullptr }, // 35
+ { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT, 0, nullptr }, // 36
+ { SKINICON_OTHER_MAINMENU, LPGEN("Main menu"), -IDI_MAINMENU, 0, nullptr }, // 37
+ { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE, 0, nullptr }, // 38
+ { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT, 0, nullptr }, // 39
+ { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT, 0, nullptr }, // 40
+ { SKINICON_OTHER_GROUP, LPGEN("Move to group"), -IDI_MOVETOGROUP, 0, nullptr }, // 41
+ { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON, 0, nullptr }, // 42
+ { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF, 0, nullptr }, // 43
+ { SKINICON_OTHER_LOADEDGRAY, LPGEN("Running core plugin"), -IDI_LOADED_GRAY, 0, nullptr }, // 44
+ { SKINICON_OTHER_NOTLOADEDGRAY, LPGEN("Non-loadable plugin"), -IDI_NOTLOADED_GRAY, 0, nullptr }, // 45
+ { SKINICON_OTHER_FRAME, LPGEN("Frames"), -IDI_FRAME, 0, nullptr }, // 46
+ { SKINICON_OTHER_GROUPADD, LPGEN("Add group"), -IDI_ADDGROUP, 0, nullptr }, // 47
+ { SKINICON_AUTH_ADD, LPGEN("Add to list"), -IDI_AUTH_ADD, 0, nullptr }, // 48
+ { SKINICON_AUTH_REQUEST, LPGEN("Request authorization"), -IDI_AUTH_REQUEST, 0, nullptr }, // 49
+ { SKINICON_AUTH_GRANT, LPGEN("Grant authorization"), -IDI_AUTH_GRANT, 0, nullptr }, // 50
+ { SKINICON_AUTH_REVOKE, LPGEN("Revoke authorization"), -IDI_AUTH_REVOKE, 0, nullptr }, // 51
+ { SKINICON_FATAL, LPGEN("Fatal error"), -IDI_MFATAL, 0, nullptr }, // 52
+ { SKINICON_ERROR, LPGEN("Error"), -IDI_MERROR, 0, nullptr }, // 53
+ { SKINICON_WARNING, LPGEN("Warning"), -IDI_MWARNING, 0, nullptr }, // 54
+ { SKINICON_INFORMATION, LPGEN("Information"), -IDI_MINFO, 0, nullptr }, // 55
{ SKINICON_OTHER_VISIBLE_ALL, LPGEN("Always visible"), -IDI_ALWAYSVIS, 0, LPGEN("Contact list") },
{ SKINICON_OTHER_INVISIBLE_ALL, LPGEN("Always invisible"), -IDI_NEVERVIS, 0, LPGEN("Contact list") },
@@ -280,7 +280,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) wchar_t tszSection[MAX_PATH];
mir_snwprintf(tszSection, _T(PROTOCOLS_PREFIX)L"/%s", pa->tszAccountName);
- SKINICONDESC sid = { 0 };
+ SKINICONDESC sid = {};
sid.section.w = tszSection;
sid.flags = SIDF_ALL_UNICODE;
@@ -383,7 +383,7 @@ int LoadSkinIcons(void) GetModuleFileName(g_hInst, modulePath, _countof(modulePath));
char iconName[MAX_PATH];
- SKINICONDESC sid = { 0 };
+ SKINICONDESC sid = {};
sid.defaultFile.w = modulePath;
sid.flags = SIDF_PATH_UNICODE;
sid.pszName = iconName;
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index 41b854e354..c77f68bfd4 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -81,11 +81,11 @@ CSrmmBaseDialog::CSrmmBaseDialog(HINSTANCE hInst, int idDialog, SESSION_INFO *si } CSrmmBaseDialog::CSrmmBaseDialog(const CSrmmBaseDialog&) : - CDlgBase(0, 0), - m_btnColor(0, 0), m_btnBkColor(0, 0), - m_btnBold(0, 0), m_btnItalic(0, 0), m_btnUnderline(0, 0), - m_btnFilter(0, 0), m_btnChannelMgr(0, 0), m_btnHistory(0, 0), m_btnNickList(0, 0), - m_nickList(0, 0), m_log(0, 0), m_message(0, 0) + CDlgBase(nullptr, 0), + m_btnColor(nullptr, 0), m_btnBkColor(nullptr, 0), + m_btnBold(nullptr, 0), m_btnItalic(nullptr, 0), m_btnUnderline(nullptr, 0), + m_btnFilter(nullptr, 0), m_btnChannelMgr(nullptr, 0), m_btnHistory(nullptr, 0), m_btnNickList(nullptr, 0), + m_nickList(nullptr, 0), m_log(nullptr, 0), m_message(nullptr, 0) { } diff --git a/src/mir_app/src/srmm_toolbar.cpp b/src/mir_app/src/srmm_toolbar.cpp index 9d05d9c202..82758f7478 100644 --- a/src/mir_app/src/srmm_toolbar.cpp +++ b/src/mir_app/src/srmm_toolbar.cpp @@ -435,7 +435,7 @@ MIR_APP_DLL(void) Srmm_RedrawToolbarIcons(HWND hwndDlg) CustomButtonData *cbd = arButtonsList[i]; HWND hwnd = GetDlgItem(hwndDlg, cbd->m_dwButtonCID); if (hwnd) - InvalidateRect(hwnd, 0, TRUE); + InvalidateRect(hwnd, nullptr, TRUE); } } @@ -852,10 +852,10 @@ void LoadSrmmToolbarModule() hHookButtonPressedEvt = CreateHookableEvent(ME_MSG_BUTTONPRESSED); hHookToolBarLoadedEvt = CreateHookableEvent(ME_MSG_TOOLBARLOADED); - HDC hScrnDC = GetDC(0); + HDC hScrnDC = GetDC(nullptr); g_DPIscaleX = GetDeviceCaps(hScrnDC, LOGPIXELSX) / 96.0; g_DPIscaleY = GetDeviceCaps(hScrnDC, LOGPIXELSY) / 96.0; - ReleaseDC(0, hScrnDC); + ReleaseDC(nullptr, hScrnDC); // old data? convert them if (db_get_dw(0, "Tab" MODULENAME, "SeparatorsCount", -1) != -1) { diff --git a/src/mir_app/src/xmlParser.cpp b/src/mir_app/src/xmlParser.cpp index 7048ad65b6..26add898ee 100644 --- a/src/mir_app/src/xmlParser.cpp +++ b/src/mir_app/src/xmlParser.cpp @@ -2100,7 +2100,7 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma case eNodeChild: { // Recursively add child nodes - nResult += CreateXMLStringR(pEntry->pChild[j>>2].d, lpszMarker ? lpszMarker + nResult : 0, nChildFormat); + nResult += CreateXMLStringR(pEntry->pChild[j>>2].d, lpszMarker ? lpszMarker + nResult : nullptr, nChildFormat); break; } default: break; @@ -2178,7 +2178,7 @@ XMLSTR XMLNode::createXMLString(int nFormat, int *pnSize) const // Recursively Calculate the size of the XML string if (!dropWhiteSpace) nFormat = 0; nFormat = nFormat ? 0 : -1; - cbStr = CreateXMLStringR(d, 0, nFormat); + cbStr = CreateXMLStringR(d, nullptr, nFormat); // Alllocate memory for the XML string + the nullptr terminator and // create the recursively XML string. lpszResult = (XMLSTR)malloc((cbStr+1)*sizeof(XMLCHAR)); |