From a7c24ca48995cf2bf436156302f96b91bf135409 Mon Sep 17 00:00:00 2001 From: Goraf <22941576+Goraf@users.noreply.github.com> Date: Mon, 13 Nov 2017 15:03:31 +0100 Subject: Code modernize ... * replace 0/NULL with nullptr [using clang-tidy] --- plugins/QuickMessages/src/Utils.cpp | 42 ++++++------- plugins/QuickMessages/src/main.cpp | 20 +++---- plugins/QuickMessages/src/options.cpp | 108 +++++++++++++++++----------------- 3 files changed, 85 insertions(+), 85 deletions(-) (limited to 'plugins/QuickMessages/src') diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index 015c19f6e0..ba4cccf945 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -21,7 +21,7 @@ along with this program. If not, see . ListData* ButtonsList[100]; -SortedList* QuickList = NULL; +SortedList* QuickList = nullptr; typedef void(*ItemDestuctor)(void*); @@ -29,7 +29,7 @@ int sstSortButtons(const void * vmtbi1, const void * vmtbi2) { ButtonData * mtbi1 = (ButtonData *)*((ButtonData **)vmtbi1); ButtonData * mtbi2 = (ButtonData *)*((ButtonData **)vmtbi2); - if (mtbi1 == NULL || mtbi2 == NULL) return (mtbi1 - mtbi2); + if (mtbi1 == nullptr || mtbi2 == nullptr) return (mtbi1 - mtbi2); return mtbi1->dwPos - mtbi2->dwPos; } @@ -37,7 +37,7 @@ int sstQuickSortButtons(const void * vmtbi1, const void * vmtbi2) { QuickData * mtbi1 = (QuickData *)*((QuickData **)vmtbi1); QuickData * mtbi2 = (QuickData *)*((QuickData **)vmtbi2); - if (mtbi1 == NULL || mtbi2 == NULL) return (mtbi1 - mtbi2); + if (mtbi1 == nullptr || mtbi2 == nullptr) return (mtbi1 - mtbi2); return mtbi1->dwPos - mtbi2->dwPos; } @@ -46,7 +46,7 @@ int sstOpSortButtons(const void * vmtbi1, const void * vmtbi2) { ButtonData * mtbi1 = (ButtonData *)*((ButtonData **)vmtbi1); ButtonData * mtbi2 = (ButtonData *)*((ButtonData **)vmtbi2); - if (mtbi1 == NULL || mtbi2 == NULL) return (mtbi1 - mtbi2); + if (mtbi1 == nullptr || mtbi2 == nullptr) return (mtbi1 - mtbi2); return mtbi1->dwOPPos - mtbi2->dwOPPos; } @@ -81,7 +81,7 @@ void li_SortList(SortedList *pList, FSortFunc pSortFunct) FSortFunc pOldSort = pList->sortFunc; int i; if (!pSortFunct) pSortFunct = pOldSort; - pList->sortFunc = NULL; + pList->sortFunc = nullptr; for (i = 0; i < pList->realCount - 1; i++) if (pOldSort(pList->items[i], pList->items[i + 1]) < 0) { void * temp = pList->items[i]; @@ -100,8 +100,8 @@ void li_ZeroQuickList(SortedList *pList) QuickData * qd = (QuickData *)pList->items[i]; qd->dwPos = 0; qd->bIsService = 0; - qd->ptszValue = NULL; - qd->ptszValueName = NULL; + qd->ptszValue = nullptr; + qd->ptszValueName = nullptr; List_Remove(pList, i); i--; } @@ -140,10 +140,10 @@ void DestroyButton(int listnum) li_ListDestruct((SortedList*)ld->sl, listdestructor); mir_free(ld); - ButtonsList[i] = NULL; + ButtonsList[i] = nullptr; while (ButtonsList[i + 1]) { ButtonsList[i] = ButtonsList[i + 1]; - ButtonsList[i + 1] = NULL; + ButtonsList[i + 1] = nullptr; i++; } } @@ -227,7 +227,7 @@ static HANDLE AddIcon(char* szIcoName) wchar_t tszPath[MAX_PATH]; GetModuleFileName(hinstance, tszPath, _countof(tszPath)); - SKINICONDESC sid = { 0 }; + SKINICONDESC sid = {}; sid.flags = SIDF_PATH_UNICODE; sid.section.a = "Quick Messages"; sid.description.a = szIcoName; @@ -266,8 +266,8 @@ void InitButtonsList() int i, j, k = 0; QuickList = List_Create(0, 1); for (i = 0; i < g_iButtonsCount; i++) { - wchar_t* pszBName = NULL; - ListData* ld = NULL; + wchar_t* pszBName = nullptr; + ListData* ld = nullptr; if (!(pszBName = getMenuEntry(i, 0, 3))) { g_iButtonsCount = i; db_set_b(NULL, PLGNAME, "ButtonsCount", (BYTE)g_iButtonsCount); @@ -283,8 +283,8 @@ void InitButtonsList() ld->dwOPFlags = 0; ld->bIsServName = ld->bIsOpServName = getEntryByte(i, 0, 3); for (j = 0;; j++) { - wchar_t* pszEntry = NULL; - ButtonData *bd = NULL; + wchar_t* pszEntry = nullptr; + ButtonData *bd = nullptr; if (!(pszEntry = getMenuEntry(i, j, 0))) break; @@ -330,7 +330,7 @@ void DestructButtonsList() wchar_t* getMenuEntry(int buttonnum, int entrynum, BYTE mode) { - wchar_t* buffer = NULL; + wchar_t* buffer = nullptr; char szMEntry[256]; DBVARIANT dbv; @@ -384,13 +384,13 @@ int RegisterCustomButton(WPARAM, LPARAM) wchar_t* ParseString(MCONTACT hContact, wchar_t* ptszQValIn, wchar_t* ptszText, wchar_t* ptszClip, int QVSize, int TextSize, int ClipSize) { int i = 0, iOffset = 0; - wchar_t* tempPointer = NULL; + wchar_t* tempPointer = nullptr; wchar_t* ptszQValue = wcsdup(ptszQValIn); wchar_t* tempQValue = ptszQValue; wchar_t varstr = '%'; - wchar_t* p = NULL; + wchar_t* p = nullptr; int NameLenght = 0; - wchar_t* ptszName = NULL; + wchar_t* ptszName = nullptr; if (!wcschr(ptszQValue, varstr)) return ptszQValue; @@ -404,7 +404,7 @@ wchar_t* ParseString(MCONTACT hContact, wchar_t* ptszQValIn, wchar_t* ptszText, if (ptszQValue[i] != '%') goto move_next; NameLenght = 0; - ptszName = NULL; + ptszName = nullptr; switch (ptszQValue[i + 1]) { case 't': @@ -493,7 +493,7 @@ wchar_t* ParseString(MCONTACT hContact, wchar_t* ptszQValIn, wchar_t* ptszText, break; case 'F': ptszName = Contact_GetInfo(CNF_FIRSTNAME, hContact); - if (ptszName == NULL) + if (ptszName == nullptr) break; NameLenght = (int)mir_wstrlen(ptszName); p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t)); @@ -519,7 +519,7 @@ wchar_t* ParseString(MCONTACT hContact, wchar_t* ptszQValIn, wchar_t* ptszText, break; case 'L': ptszName = Contact_GetInfo(CNF_LASTNAME, hContact); - if (ptszName == NULL) + if (ptszName == nullptr) break; NameLenght = (int)mir_wstrlen(ptszName); diff --git a/plugins/QuickMessages/src/main.cpp b/plugins/QuickMessages/src/main.cpp index c889776178..f16c798875 100644 --- a/plugins/QuickMessages/src/main.cpp +++ b/plugins/QuickMessages/src/main.cpp @@ -55,7 +55,7 @@ int PreShutdown(WPARAM, LPARAM) static int InputMenuPopup(WPARAM, LPARAM lParam) { - HMENU hSubMenu = NULL; + HMENU hSubMenu = nullptr; int i = 0; MessageWindowPopupData *mwpd = (MessageWindowPopupData *)lParam; if (mwpd->uFlags == MSG_WINDOWPOPUP_LOG || !g_bQuickMenu || !QuickList->realCount) @@ -65,12 +65,12 @@ static int InputMenuPopup(WPARAM, LPARAM lParam) hSubMenu = CreatePopupMenu(); InsertMenu((HMENU)mwpd->hMenu, 6, MF_STRING | MF_POPUP | MF_BYPOSITION, (UINT_PTR)hSubMenu, TranslateT("Quick Messages")); - InsertMenu((HMENU)mwpd->hMenu, 7, MF_SEPARATOR | MF_BYPOSITION, 0, 0); + InsertMenu((HMENU)mwpd->hMenu, 7, MF_SEPARATOR | MF_BYPOSITION, 0, nullptr); qsort(QuickList->items, QuickList->realCount, sizeof(QuickData *), sstQuickSortButtons); for (i = 0; i < QuickList->realCount; i++) { QuickData *qd = (QuickData*)QuickList->items[i]; if (qd->fEntryType & QMF_EX_SEPARATOR) - AppendMenu(hSubMenu, MF_SEPARATOR, 0, NULL); + AppendMenu(hSubMenu, MF_SEPARATOR, 0, nullptr); else AppendMenu(hSubMenu, MF_STRING, qd->dwPos + 254, qd->ptszValueName); } @@ -87,8 +87,8 @@ static int InputMenuPopup(WPARAM, LPARAM lParam) if (IsClipboardFormatAvailable(CF_TEXT)) { if (OpenClipboard(mwpd->hwnd)) { - HANDLE hData = NULL; - wchar_t* chBuffer = NULL; + HANDLE hData = nullptr; + wchar_t* chBuffer = nullptr; int textLength = 0; hData = GetClipboardData(CF_UNICODETEXT); @@ -200,7 +200,7 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam) if (!g_iButtonsCount) break; - HMENU hMenu = CreatePopupMenu(), hSubMenu = NULL; + HMENU hMenu = CreatePopupMenu(), hSubMenu = nullptr; for (int menunum = 0; menunum < sl->realCount; menunum++) { ButtonData *bd = (ButtonData *)sl->items[menunum]; @@ -208,23 +208,23 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam) continue; BOOL bSetPopupMark = FALSE; - if (bd->pszValue == 0 && bd->fEntryType == 0) { + if (bd->pszValue == nullptr && bd->fEntryType == 0) { hSubMenu = CreatePopupMenu(); bSetPopupMark = TRUE; } if (bd->pszValue && bd->fEntryType == 0) - hSubMenu = NULL; + hSubMenu = nullptr; if (bd->fEntryType & QMF_EX_SEPARATOR) - AppendMenu((HMENU)((hSubMenu && !bSetPopupMark) ? hSubMenu : hMenu), MF_SEPARATOR, 0, NULL); + AppendMenu((HMENU)((hSubMenu && !bSetPopupMark) ? hSubMenu : hMenu), MF_SEPARATOR, 0, nullptr); else AppendMenu((HMENU)((hSubMenu && !bSetPopupMark) ? hSubMenu : hMenu), MF_STRING | (bSetPopupMark ? MF_POPUP : 0), (bSetPopupMark ? (UINT_PTR)hSubMenu : (menunum + 1)), bd->pszName); } - int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, cbcd->pt.x, cbcd->pt.y, 0, cbcd->hwndFrom, NULL); + int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, cbcd->pt.x, cbcd->pt.y, 0, cbcd->hwndFrom, nullptr); if (res == 0) break; diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index e26d36c13a..a9799aa64d 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -22,12 +22,12 @@ along with this program. If not, see . int g_iOPButtonsCount; BOOL bNeedRestart = FALSE; BOOL drag = FALSE, bOptionsInit = TRUE; -HTREEITEM hDragItem = NULL; -HWND hButtonsList = NULL; -HWND hMenuTree = NULL; -HWND hwndEdit = NULL; +HTREEITEM hDragItem = nullptr; +HWND hButtonsList = nullptr; +HWND hMenuTree = nullptr; +HWND hwndEdit = nullptr; -HWND g_opHdlg = NULL, g_varhelpDlg = NULL; +HWND g_opHdlg = nullptr, g_varhelpDlg = nullptr; INT_PTR CALLBACK HelpDlgProc(HWND hdlg, UINT msg, WPARAM, LPARAM lparam) { @@ -54,7 +54,7 @@ INT_PTR CALLBACK HelpDlgProc(HWND hdlg, UINT msg, WPARAM, LPARAM lparam) SendDlgItemMessage(hdlg, IDC_VARCLNAME, WM_SETFONT, (WPARAM)hFont, 0); GetWindowRect(g_opHdlg, &rc); - SetWindowPos(hdlg, 0, rc.left, rc.top, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE); + SetWindowPos(hdlg, nullptr, rc.left, rc.top, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE); } break; @@ -65,7 +65,7 @@ INT_PTR CALLBACK HelpDlgProc(HWND hdlg, UINT msg, WPARAM, LPARAM lparam) case WM_CLOSE: case WM_DESTROY: DestroyWindow(g_varhelpDlg); - g_varhelpDlg = NULL; + g_varhelpDlg = nullptr; break; default: @@ -110,7 +110,7 @@ static LRESULT CALLBACK EditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPA void SetMenuEntryProperties(HWND hdlg) { TVITEM tvi; - HTREEITEM hItem = NULL; + HTREEITEM hItem = nullptr; int pos = 0; if (TreeView_GetCount(hButtonsList) && (tvi.hItem = TreeView_GetSelection(hButtonsList))) { @@ -130,7 +130,7 @@ void SetMenuEntryProperties(HWND hdlg) } } - tvi.hItem = NULL; + tvi.hItem = nullptr; if (TreeView_GetCount(hMenuTree) && (tvi.hItem = TreeView_GetSelection(hMenuTree))) { tvi.mask = TVIF_HANDLE | TVIF_PARAM; TreeView_GetItem(hMenuTree, &tvi); @@ -163,7 +163,7 @@ void SetMenuEntryProperties(HWND hdlg) if (bd->pszOpValue) { mir_free(bd->pszOpValue); - bd->pszOpValue = NULL; + bd->pszOpValue = nullptr; } tvi.hItem = hItem; continue; @@ -172,7 +172,7 @@ void SetMenuEntryProperties(HWND hdlg) if (bd->fEntryOpType&QMF_EX_SEPARATOR) { if (bd->pszOpValue) { mir_free(bd->pszOpValue); - bd->pszOpValue = NULL; + bd->pszOpValue = nullptr; } } else { @@ -199,7 +199,7 @@ void SaveMenuTree() BOOL bDeleted = FALSE; char szMEntry[256] = { '\0' }; wchar_t strbuf[256]; - HTREEITEM hti = NULL; + HTREEITEM hti = nullptr; TVITEM tvi; g_iButtonsCount = TreeView_GetCount(hButtonsList); @@ -216,7 +216,7 @@ void SaveMenuTree() BalanceButtons(iBtd, g_iButtonsCount); while (ButtonsList[iBl]) { - SortedList * sl = NULL; + SortedList * sl = nullptr; ListData* ld = ButtonsList[iBl]; if (!ld->sl) break; @@ -233,7 +233,7 @@ void SaveMenuTree() if (ld->ptszQValue) mir_free(ld->ptszQValue); - ld->ptszQValue = (ld->ptszOPQValue) ? ld->ptszOPQValue : NULL; + ld->ptszQValue = (ld->ptszOPQValue) ? ld->ptszOPQValue : nullptr; } if (ld->ptszButtonName) @@ -253,7 +253,7 @@ void SaveMenuTree() } if (((ld->dwOPFlags & QMF_NEW) || (ld->dwOPFlags & QMF_RENAMED) || bDeleted)) { - BBButton bb = { 0 }; + BBButton bb = {}; bb.pszModuleName = PLGNAME; bb.dwButtonID = iBl; bb.pwszTooltip = ld->ptszButtonName; @@ -289,13 +289,13 @@ void SaveMenuTree() if (bd->pszName != bd->pszOpName) { if (bd->pszName) mir_free(bd->pszName); - bd->pszName = bd->pszOpName ? bd->pszOpName : NULL; + bd->pszName = bd->pszOpName ? bd->pszOpName : nullptr; } if (bd->pszValue != bd->pszOpValue) { if (bd->pszValue) mir_free(bd->pszValue); - bd->pszValue = bd->pszOpValue ? bd->pszOpValue : NULL; + bd->pszValue = bd->pszOpValue ? bd->pszOpValue : nullptr; } if (bd->bInQMenu) { QuickData* qd = (QuickData *)mir_alloc(sizeof(QuickData)); @@ -322,7 +322,7 @@ void RestoreModuleData() int iBl = 0, i = 0; while (ButtonsList[iBl]) { - SortedList * sl = NULL; + SortedList * sl = nullptr; ListData* ld = ButtonsList[iBl]; if (!(sl = ld->sl)) break; @@ -336,7 +336,7 @@ void RestoreModuleData() if (ld->ptszOPQValue) mir_free(ld->ptszOPQValue); - ld->ptszOPQValue = (ld->ptszQValue) ? ld->ptszQValue : NULL; + ld->ptszOPQValue = (ld->ptszQValue) ? ld->ptszQValue : nullptr; } ld->bIsOpServName = ld->bIsServName; @@ -360,13 +360,13 @@ void RestoreModuleData() if (bd->pszName != bd->pszOpName) { if (bd->pszOpName) mir_free(bd->pszOpName); - bd->pszOpName = bd->pszName ? bd->pszName : NULL; + bd->pszOpName = bd->pszName ? bd->pszName : nullptr; } if (bd->pszValue != bd->pszOpValue) { if (bd->pszOpValue) mir_free(bd->pszOpValue); - bd->pszOpValue = bd->pszValue ? bd->pszValue : NULL; + bd->pszOpValue = bd->pszValue ? bd->pszValue : nullptr; } } iBl++; @@ -377,8 +377,8 @@ static int BuildMenuTree(HWND hToolBarTree, SortedList * sl) { TVINSERTSTRUCT tvis; int i; - HTREEITEM hParent = NULL; - tvis.hParent = NULL; + HTREEITEM hParent = nullptr; + tvis.hParent = nullptr; tvis.hInsertAfter = TVI_LAST; tvis.item.mask = TVIF_PARAM | TVIF_TEXT; @@ -397,7 +397,7 @@ static int BuildMenuTree(HWND hToolBarTree, SortedList * sl) tvis.item.pszText = bd->pszOpName; if (bd->fEntryOpType == 0) - tvis.hParent = NULL; + tvis.hParent = nullptr; hParent = TreeView_InsertItem(hToolBarTree, &tvis); if (tvis.hParent) TreeView_Expand(hMenuTree, tvis.hParent, TVE_EXPAND); @@ -412,7 +412,7 @@ static int BuildButtonsList(HWND hToolBarTree) { TVINSERTSTRUCT tvis; int i = 0; - tvis.hParent = NULL; + tvis.hParent = nullptr; tvis.hInsertAfter = TVI_LAST; tvis.item.mask = TVIF_PARAM | TVIF_TEXT; @@ -563,8 +563,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) case WM_LBUTTONUP: if (drag) { TVHITTESTINFO hti; - HTREEITEM htiAfter = NULL; - ButtonData* bd = NULL; + HTREEITEM htiAfter = nullptr; + ButtonData* bd = nullptr; TVITEM tvi; RECT rc; BYTE height; @@ -572,7 +572,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) TreeView_SetInsertMark(hMenuTree, NULL, 0); ReleaseCapture(); - SetCursor(LoadCursor(NULL, IDC_ARROW)); + SetCursor(LoadCursor(nullptr, IDC_ARROW)); hti.pt.x = (SHORT)LOWORD(lparam); hti.pt.y = (SHORT)HIWORD(lparam); @@ -658,17 +658,17 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) BYTE height = (BYTE)(rc.bottom - rc.top); if (hti.pt.y - (height / 3) < rc.top) { - SetCursor(LoadCursor(NULL, IDC_ARROW)); + SetCursor(LoadCursor(nullptr, IDC_ARROW)); TreeView_SetInsertMark(hMenuTree, hti.hItem, 0); } else if (hti.pt.y + (height / 3) > rc.bottom) { - SetCursor(LoadCursor(NULL, IDC_ARROW)); + SetCursor(LoadCursor(nullptr, IDC_ARROW)); TreeView_SetInsertMark(hMenuTree, hti.hItem, 1); } else { TreeView_SetInsertMark(hMenuTree, NULL, 0); - SetCursor(LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(183))); + SetCursor(LoadCursor(GetModuleHandle(nullptr), MAKEINTRESOURCE(183))); } } } @@ -683,7 +683,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) case WM_DESTROY: if (g_varhelpDlg) DestroyWindow(g_varhelpDlg); - g_varhelpDlg = NULL; + g_varhelpDlg = nullptr; break; case WM_NOTIFY: @@ -724,7 +724,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) case TVN_ENDLABELEDIT: { TVITEM tvi; - ButtonData* bd = NULL; + ButtonData* bd = nullptr; wchar_t strbuf[256]; wchar_t szLabel[256]; @@ -735,7 +735,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) TreeView_GetItem(hMenuTree, &tvi); GetWindowText(hwndEdit, szLabel, _countof(szLabel)); - hwndEdit = NULL; + hwndEdit = nullptr; if (!mir_wstrlen(szLabel)) break; if (bd = (ButtonData*)tvi.lParam) { if (!mir_wstrcmp(szLabel, L"---")) { @@ -778,7 +778,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) case TVN_SELCHANGING: { HTREEITEM hti = TreeView_GetSelection(hMenuTree); - if (hti == NULL) + if (hti == nullptr) break; TVITEM tvi; @@ -806,7 +806,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) case TVN_SELCHANGED: { HTREEITEM hti = TreeView_GetSelection(hMenuTree); - if (hti == NULL) + if (hti == nullptr) break; TVITEM tvi; @@ -864,7 +864,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) TreeView_GetItem(hButtonsList, &tvi); GetWindowText(hwndEdit, szLabel, _countof(szLabel)); - hwndEdit = NULL; + hwndEdit = nullptr; if (!mir_wstrlen(szLabel)) break; tvi.pszText = szLabel; @@ -882,7 +882,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) case TVN_SELCHANGED: { HTREEITEM hti = TreeView_GetSelection(hButtonsList); - if (hti == NULL || !TreeView_GetCount(hButtonsList)) { + if (hti == nullptr || !TreeView_GetCount(hButtonsList)) { EnableWindow(GetDlgItem(hdlg, IDC_MENUVALUE), FALSE); EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME), FALSE); EnableWindow(GetDlgItem(hdlg, IDC_INQMENU), FALSE); @@ -920,20 +920,20 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) switch (LOWORD(wparam)) { case IDC_VARHELP: if (!g_varhelpDlg) - g_varhelpDlg = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_HELPDIALOG), 0, HelpDlgProc); + g_varhelpDlg = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_HELPDIALOG), nullptr, HelpDlgProc); else //ShowWindow(g_varhelpDlg,SW_SHOWDEFAULT); - SetWindowPos(g_varhelpDlg, 0, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE); + SetWindowPos(g_varhelpDlg, nullptr, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE); break; case IDC_BLISTADD: { TVINSERTSTRUCT tvis; - ListData* ld = NULL; + ListData* ld = nullptr; wchar_t namebuff[MAX_PATH] = { '\0' }; int count = TreeView_GetCount(hButtonsList); if (count > 10) break; if (g_iOPButtonsCount == 99) { - MessageBox(NULL, TranslateT("Congratulation!\r\nYou have clicked this button 100 times!\r\nThere was access violation at this point...\r\nAnd now function for freeing resources must be called...\r\nBut no! there's only break :D"), TranslateT("You win!"), MB_OK); + MessageBox(nullptr, TranslateT("Congratulation!\r\nYou have clicked this button 100 times!\r\nThere was access violation at this point...\r\nAnd now function for freeing resources must be called...\r\nBut no! there's only break :D"), TranslateT("You win!"), MB_OK); break; } @@ -943,10 +943,10 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) ld->sl = List_Create(0, 1); ld->dwOPFlags = QMF_NEW; ld->bIsOpServName = 0; - ld->ptszButtonName = NULL; - ld->ptszOPQValue = NULL; - ld->ptszQValue = NULL; - tvis.hParent = NULL; + ld->ptszButtonName = nullptr; + ld->ptszOPQValue = nullptr; + ld->ptszQValue = nullptr; + tvis.hParent = nullptr; tvis.hInsertAfter = TVI_LAST; GetDlgItemText(hdlg, IDC_BUTTONNAME, namebuff, _countof(namebuff)); @@ -989,8 +989,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) { TVINSERTSTRUCT tvis; TVITEM tvi; - ButtonData *bd = NULL; - SortedList *sl = NULL; + ButtonData *bd = nullptr; + SortedList *sl = nullptr; wchar_t namebuff[MAX_PATH] = { '\0' }; if (!TreeView_GetCount(hButtonsList)) break; @@ -1006,8 +1006,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) bd->pszOpValue = mir_wstrdup(bd->pszOpName); bd->fEntryOpType = !mir_wstrcmp(namebuff, L"---") ? QMF_EX_SEPARATOR : 0; bd->dwOPFlags = QMF_NEW; - bd->pszName = NULL; - bd->pszValue = NULL; + bd->pszName = nullptr; + bd->pszValue = nullptr; tvi.mask = TVIF_HANDLE | TVIF_PARAM; @@ -1018,7 +1018,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) List_InsertPtr(sl, bd); - tvis.hParent = NULL; + tvis.hParent = nullptr; tvis.hInsertAfter = TVI_LAST; tvis.item.mask = TVIF_PARAM | TVIF_TEXT; tvis.item.pszText = bd->pszOpName; @@ -1030,8 +1030,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) { TVITEM tvi; TVINSERTSTRUCT tvis; - HTREEITEM hti = NULL; - ButtonData *bd = NULL; + HTREEITEM hti = nullptr; + ButtonData *bd = nullptr; tvi.mask = TVIF_HANDLE | TVIF_PARAM; if (!(tvi.hItem = TreeView_GetSelection(hMenuTree))) break; @@ -1050,7 +1050,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT; TreeView_GetItem(hMenuTree, &tvi); - tvis.hParent = NULL; + tvis.hParent = nullptr; tvis.item = tvi; TreeView_InsertItem(hMenuTree, &tvis); tvi.hItem = TreeView_GetNextSibling(hMenuTree, tvi.hItem); -- cgit v1.2.3