From 785453147bc870417d6f58b017da198631c474b4 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Wed, 9 Feb 2022 16:41:56 +0100 Subject: [PATCH] Inialize all memebers of struct (instead of its 1st member) to zero The curly brace initiator in C/C++ is quite confusing (at least to me). The C style array uses {0} for initializing all the array to 0, whereas C++ struct uses {0} for initializing only the 1st member's value to 0. If we want to set all members' value in a struct to 0, we should use {} instread of {0}. This commit fix the error which initialize only the 1st member's value to 0 in the structures. Ref: 1. https://docs.microsoft.com/en-us/cpp/cpp/initializing-classes-and-structs-without-constructors-cpp?view=msvc-170 2. https://en.cppreference.com/w/c/language/struct_initialization --- PowerEditor/src/MISC/Common/Common.cpp | 10 +-- .../src/MISC/Common/verifySignedfile.cpp | 6 +- PowerEditor/src/MISC/Process/Processus.cpp | 2 +- PowerEditor/src/Notepad_plus.cpp | 16 ++--- PowerEditor/src/Notepad_plus.h | 2 +- PowerEditor/src/NppBigSwitch.cpp | 2 +- PowerEditor/src/NppCommands.cpp | 8 +-- PowerEditor/src/NppDarkMode.cpp | 44 ++++++------ PowerEditor/src/NppIO.cpp | 2 +- PowerEditor/src/Parameters.h | 10 +-- PowerEditor/src/ScintillaComponent/Buffer.cpp | 4 +- .../src/ScintillaComponent/FindReplaceDlg.cpp | 16 ++--- .../src/ScintillaComponent/FindReplaceDlg.h | 8 +-- .../src/ScintillaComponent/GoToLineDlg.cpp | 2 +- PowerEditor/src/ScintillaComponent/Printer.h | 8 +-- .../ScintillaComponent/UserDefineDialog.cpp | 2 +- .../src/ScintillaComponent/UserDefineDialog.h | 2 +- .../src/ScintillaComponent/columnEditor.cpp | 2 +- .../WinControls/ColourPicker/ColourPopup.h | 2 +- .../WinControls/ColourPicker/WordStyleDlg.cpp | 2 +- .../src/WinControls/DockingWnd/Docking.h | 4 +- .../WinControls/DockingWnd/DockingCont.cpp | 72 +++++++++---------- .../src/WinControls/DockingWnd/DockingCont.h | 2 +- .../DockingWnd/DockingDlgInterface.h | 2 +- .../WinControls/DockingWnd/DockingManager.h | 4 +- .../DockingWnd/DockingSplitter.cpp | 2 +- .../src/WinControls/DockingWnd/Gripper.cpp | 24 +++---- .../src/WinControls/DockingWnd/Gripper.h | 8 +-- .../FindCharsInRange/FindCharsInRange.cpp | 2 +- .../FunctionList/functionListPanel.h | 2 +- .../WinControls/ImageListSet/ImageListSet.cpp | 4 +- .../OpenSaveFileDialog/CustomFileDialog.cpp | 4 +- .../WinControls/Preference/preferenceDlg.cpp | 2 +- .../WinControls/Preference/preferenceDlg.h | 7 +- .../ReadDirectoryChanges/ReadFileChanges.h | 2 +- .../SplitterContainer/Splitter.cpp | 2 +- .../WinControls/SplitterContainer/Splitter.h | 4 +- .../StaticDialog/RunDlg/RunDlg.cpp | 2 +- .../WinControls/StaticDialog/StaticDialog.cpp | 4 +- .../WinControls/StaticDialog/StaticDialog.h | 2 +- .../src/WinControls/StatusBar/StatusBar.cpp | 8 +-- PowerEditor/src/WinControls/TabBar/TabBar.cpp | 4 +- .../src/WinControls/TaskList/TaskList.h | 2 +- .../src/WinControls/ToolBar/ToolBar.cpp | 2 +- PowerEditor/src/WinControls/ToolBar/ToolBar.h | 2 +- PowerEditor/src/WinControls/ToolTip/ToolTip.h | 2 +- .../VerticalFileSwitcher.cpp | 2 +- .../src/WinControls/WindowsDlg/WindowsDlg.h | 4 +- PowerEditor/src/lesDlgs.cpp | 4 +- 49 files changed, 168 insertions(+), 167 deletions(-) diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index 13df546df..46dcf59e9 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -136,7 +136,7 @@ void writeLog(const TCHAR *logFileName, const char *log2write) offset.QuadPart = 0; ::SetFilePointerEx(hFile, offset, NULL, FILE_END); - SYSTEMTIME currentTime = { 0 }; + SYSTEMTIME currentTime = {}; ::GetLocalTime(¤tTime); generic_string dateTimeStrW = getDateTimeStrFrom(TEXT("yyyy-MM-dd HH:mm:ss"), currentTime); std::wstring_convert> converter; @@ -1064,7 +1064,7 @@ HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText, NppDarkMode::setDarkTooltips(hwndTip, NppDarkMode::ToolTipsType::tooltip); // Associate the tooltip with the tool. - TOOLINFO toolInfo = { 0 }; + TOOLINFO toolInfo = {}; toolInfo.cbSize = sizeof(toolInfo); toolInfo.hwnd = hDlg; toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS; @@ -1105,7 +1105,7 @@ HWND CreateToolTipRect(int toolID, HWND hWnd, HINSTANCE hInst, const PTSTR pszTe } // Associate the tooltip with the tool. - TOOLINFO toolInfo = { 0 }; + TOOLINFO toolInfo = {}; toolInfo.cbSize = sizeof(toolInfo); toolInfo.hwnd = hWnd; toolInfo.uFlags = TTF_SUBCLASS; @@ -1307,7 +1307,7 @@ bool deleteFileOrFolder(const generic_string& f2delete) actionFolder[len] = 0; actionFolder[len + 1] = 0; - SHFILEOPSTRUCT fileOpStruct = { 0 }; + SHFILEOPSTRUCT fileOpStruct = {}; fileOpStruct.hwnd = NULL; fileOpStruct.pFrom = actionFolder; fileOpStruct.pTo = NULL; @@ -1504,7 +1504,7 @@ HFONT createFont(const TCHAR* fontName, int fontSize, bool isBold, HWND hDestPar { HDC hdc = GetDC(hDestParent); - LOGFONT logFont = { 0 }; + LOGFONT logFont = {}; logFont.lfHeight = -MulDiv(fontSize, GetDeviceCaps(hdc, LOGPIXELSY), 72); if (isBold) logFont.lfWeight = FW_BOLD; diff --git a/PowerEditor/src/MISC/Common/verifySignedfile.cpp b/PowerEditor/src/MISC/Common/verifySignedfile.cpp index c076cbabd..91490675d 100644 --- a/PowerEditor/src/MISC/Common/verifySignedfile.cpp +++ b/PowerEditor/src/MISC/Common/verifySignedfile.cpp @@ -127,12 +127,12 @@ bool SecurityGard::verifySignedLibrary(const std::wstring& filepath, NppModule m // Initialize the WINTRUST_FILE_INFO structure. LPCWSTR pwszfilepath = filepath.c_str(); - WINTRUST_FILE_INFO file_data = { 0 }; + WINTRUST_FILE_INFO file_data = {}; file_data.cbStruct = sizeof(WINTRUST_FILE_INFO); file_data.pcwszFilePath = pwszfilepath; // Initialise WinTrust data - WINTRUST_DATA winTEXTrust_data = { 0 }; + WINTRUST_DATA winTEXTrust_data = {}; winTEXTrust_data.cbStruct = sizeof(winTEXTrust_data); winTEXTrust_data.dwUIChoice = WTD_UI_NONE; // do not display optional dialog boxes winTEXTrust_data.dwUnionChoice = WTD_CHOICE_FILE; // we are not checking catalog signed files @@ -229,7 +229,7 @@ bool SecurityGard::verifySignedLibrary(const std::wstring& filepath, NppModule m } // Get the signer certificate from temporary certificate store. - CERT_INFO cert_info = { 0 }; + CERT_INFO cert_info = {}; cert_info.Issuer = pSignerInfo->Issuer; cert_info.SerialNumber = pSignerInfo->SerialNumber; PCCERT_CONTEXT context = ::CertFindCertificateInStore(hStore, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, CERT_FIND_SUBJECT_CERT, (PVOID)&cert_info, NULL); diff --git a/PowerEditor/src/MISC/Process/Processus.cpp b/PowerEditor/src/MISC/Process/Processus.cpp index cfa72a6cd..d76b240b3 100644 --- a/PowerEditor/src/MISC/Process/Processus.cpp +++ b/PowerEditor/src/MISC/Process/Processus.cpp @@ -27,7 +27,7 @@ void Process::run(bool isElevationRequired) const unsigned long Process::runSync(bool isElevationRequired) const { - SHELLEXECUTEINFO ShExecInfo = { 0 }; + SHELLEXECUTEINFO ShExecInfo = {}; ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; ShExecInfo.hwnd = NULL; diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 3770aeaa2..b8c4987a9 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -2264,7 +2264,7 @@ void Notepad_plus::setupColorSampleBitmapsOnMainMenuItems() { IDM_SEARCH_GONEXTMARKER_DEF, SCE_UNIVERSAL_FOUND_STYLE, { IDM_SEARCH_GOPREVMARKER_DEF, IDM_SEARCH_MARKEDTOCLIP } } }; - for (int j = 0; j < sizeof(bitmapOnStyleMenuItemsInfo) / sizeof(bitmapOnStyleMenuItemsInfo[0]); ++j) + for (size_t j = 0; j < sizeof(bitmapOnStyleMenuItemsInfo) / sizeof(bitmapOnStyleMenuItemsInfo[0]); ++j) { const Style * pStyle = NppParameters::getInstance().getMiscStylerArray().findByID(bitmapOnStyleMenuItemsInfo[j].styleIndic); if (pStyle) @@ -5778,7 +5778,7 @@ bool Notepad_plus::dumpFiles(const TCHAR * outdir, const TCHAR * fileprefix) //start dumping unsaved files to recovery directory bool somethingsaved = false; bool somedirty = false; - TCHAR savePath[MAX_PATH] = {0}; + TCHAR savePath[MAX_PATH] = { '\0' }; //rescue primary for (size_t i = 0; i < MainFileManager.getNbBuffers(); ++i) @@ -6578,7 +6578,7 @@ void Notepad_plus::launchClipboardHistoryPanel() NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker(); bool isRTL = pNativeSpeaker->isRTL(); - tTbData data = {0}; + tTbData data = {}; _pClipboardHistoryPanel->create(&data, isRTL); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pClipboardHistoryPanel->getHSelf())); @@ -6631,7 +6631,7 @@ void Notepad_plus::launchDocumentListPanel() _pDocumentListPanel->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), hImgLst); NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker(); bool isRTL = pNativeSpeaker->isRTL(); - tTbData data = {0}; + tTbData data = {}; _pDocumentListPanel->create(&data, isRTL); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pDocumentListPanel->getHSelf())); @@ -6682,7 +6682,7 @@ void Notepad_plus::launchAnsiCharPanel() NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker(); bool isRTL = pNativeSpeaker->isRTL(); - tTbData data = {0}; + tTbData data = {}; _pAnsiCharPanel->create(&data, isRTL); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pAnsiCharPanel->getHSelf())); @@ -6806,7 +6806,7 @@ void Notepad_plus::checkProjectMenuItem() { UINT const ids [] = {IDM_VIEW_PROJECT_PANEL_1, IDM_VIEW_PROJECT_PANEL_2, IDM_VIEW_PROJECT_PANEL_3}; UINT id = GetMenuItemID (subMenu, j); - for (int k = 0; k < _countof(ids); k++) + for (size_t k = 0; k < _countof(ids); k++) { if (id == ids [k]) { @@ -6905,7 +6905,7 @@ void Notepad_plus::launchDocMap() _pDocMap = new DocumentMap(); _pDocMap->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), &_pEditView); - tTbData data = {0}; + tTbData data = {}; _pDocMap->create(&data); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pDocMap->getHSelf())); @@ -6952,7 +6952,7 @@ void Notepad_plus::launchFunctionList() _pFuncList = new FunctionListPanel(); _pFuncList->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), &_pEditView); - tTbData data = {0}; + tTbData data = {}; _pFuncList->create(&data); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pFuncList->getHSelf())); diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index 9806125ec..be7ef528e 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -94,7 +94,7 @@ struct VisibleGUIConf final bool _isStatusbarShown = true; //used by fullscreen - WINDOWPLACEMENT _winPlace = {0}; + WINDOWPLACEMENT _winPlace = {}; //used by distractionFree bool _was2ViewModeOn = false; diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 52eb5dd5a..0d757a47e 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -181,7 +181,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa { if (NppDarkMode::isEnabled()) { - RECT rc = { 0 }; + RECT rc = {}; GetClientRect(hwnd, &rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return 0; diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 7753fa7a8..1dcd7adad 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -70,11 +70,11 @@ void Notepad_plus::command(int id) case IDM_EDIT_INSERT_DATETIME_SHORT: case IDM_EDIT_INSERT_DATETIME_LONG: { - SYSTEMTIME currentTime = { 0 }; + SYSTEMTIME currentTime = {}; ::GetLocalTime(¤tTime); - wchar_t dateStr[128] = { 0 }; - wchar_t timeStr[128] = { 0 }; + wchar_t dateStr[128] = { '\0' }; + wchar_t timeStr[128] = { '\0' }; int dateFlag = (id == IDM_EDIT_INSERT_DATETIME_SHORT) ? DATE_SHORTDATE : DATE_LONGDATE; GetDateFormatEx(LOCALE_NAME_USER_DEFAULT, dateFlag, ¤tTime, NULL, dateStr, sizeof(dateStr) / sizeof(dateStr[0]), NULL); @@ -103,7 +103,7 @@ void Notepad_plus::command(int id) case IDM_EDIT_INSERT_DATETIME_CUSTOMIZED: { - SYSTEMTIME currentTime = { 0 }; + SYSTEMTIME currentTime = {}; ::GetLocalTime(¤tTime); NppGUI& nppGUI = NppParameters::getInstance().getNppGUI(); diff --git a/PowerEditor/src/NppDarkMode.cpp b/PowerEditor/src/NppDarkMode.cpp index 724083995..a0a175af3 100644 --- a/PowerEditor/src/NppDarkMode.cpp +++ b/PowerEditor/src/NppDarkMode.cpp @@ -551,7 +551,7 @@ namespace NppDarkMode case WM_UAHDRAWMENU: { UAHMENU* pUDM = (UAHMENU*)lParam; - RECT rc = { 0 }; + RECT rc = {}; // get the menubar rect { @@ -579,7 +579,7 @@ namespace NppDarkMode UAHDRAWMENUITEM* pUDMI = (UAHDRAWMENUITEM*)lParam; // get the menu item string - wchar_t menuString[256] = { 0 }; + wchar_t menuString[256] = { '\0' }; MENUITEMINFO mii = { sizeof(mii), MIIM_STRING }; { mii.dwTypeData = menuString; @@ -677,11 +677,11 @@ namespace NppDarkMode return; } - RECT rcClient = { 0 }; + RECT rcClient = {}; GetClientRect(hWnd, &rcClient); MapWindowPoints(hWnd, nullptr, (POINT*)&rcClient, 2); - RECT rcWindow = { 0 }; + RECT rcWindow = {}; GetWindowRect(hWnd, &rcWindow); OffsetRect(&rcClient, -rcWindow.left, -rcWindow.top); @@ -760,8 +760,8 @@ namespace NppDarkMode void renderButton(HWND hwnd, HDC hdc, HTHEME hTheme, int iPartID, int iStateID) { - RECT rcClient = { 0 }; - WCHAR szText[256] = { 0 }; + RECT rcClient = {}; + WCHAR szText[256] = { '\0' }; DWORD nState = static_cast(SendMessage(hwnd, BM_GETSTATE, 0, 0)); DWORD uiState = static_cast(SendMessage(hwnd, WM_QUERYUISTATE, 0, 0)); DWORD nStyle = GetWindowLong(hwnd, GWL_STYLE); @@ -769,7 +769,7 @@ namespace NppDarkMode HFONT hFont = nullptr; HFONT hOldFont = nullptr; HFONT hCreatedFont = nullptr; - LOGFONT lf = { 0 }; + LOGFONT lf = {}; if (SUCCEEDED(GetThemeFont(hTheme, hdc, iPartID, iStateID, TMT_FONT, &lf))) { hCreatedFont = CreateFontIndirect(&lf); @@ -881,7 +881,7 @@ namespace NppDarkMode GetThemeTransitionDuration(buttonData.hTheme, iPartID, buttonData.iStateID, iStateID, TMT_TRANSITIONDURATIONS, &animParams.dwDuration); } - RECT rcClient = { 0 }; + RECT rcClient = {}; GetClientRect(hwnd, &rcClient); HDC hdcFrom = nullptr; @@ -953,7 +953,7 @@ namespace NppDarkMode case WM_PAINT: if (NppDarkMode::isEnabled() && pButtonData->ensureTheme(hWnd)) { - PAINTSTRUCT ps = { 0 }; + PAINTSTRUCT ps = {}; HDC hdc = reinterpret_cast(wParam); if (!hdc) { @@ -1007,7 +1007,7 @@ namespace NppDarkMode iStateID = GBS_DISABLED; } - RECT rcClient = { 0 }; + RECT rcClient = {}; GetClientRect(hwnd, &rcClient); RECT rcText = rcClient; @@ -1016,7 +1016,7 @@ namespace NppDarkMode HFONT hFont = nullptr; HFONT hOldFont = nullptr; HFONT hCreatedFont = nullptr; - LOGFONT lf = { 0 }; + LOGFONT lf = {}; if (SUCCEEDED(GetThemeFont(buttonData.hTheme, hdc, iPartID, iStateID, TMT_FONT, &lf))) { hCreatedFont = CreateFontIndirect(&lf); @@ -1030,7 +1030,7 @@ namespace NppDarkMode hOldFont = static_cast(::SelectObject(hdc, hFont)); - WCHAR szText[256] = { 0 }; + WCHAR szText[256] = { '\0' }; GetWindowText(hwnd, szText, _countof(szText)); auto style = static_cast(::GetWindowLongPtr(hwnd, GWL_STYLE)); @@ -1038,7 +1038,7 @@ namespace NppDarkMode if (szText[0]) { - SIZE textSize = { 0 }; + SIZE textSize = {}; GetTextExtentPoint32(hdc, szText, static_cast(wcslen(szText)), &textSize); int centerPosX = isCenter ? ((rcClient.right - rcClient.left - textSize.cx) / 2) : 7; @@ -1052,7 +1052,7 @@ namespace NppDarkMode } else { - SIZE textSize = { 0 }; + SIZE textSize = {}; GetTextExtentPoint32(hdc, L"M", 1, &textSize); rcBackground.top += textSize.cy / 2; } @@ -1120,7 +1120,7 @@ namespace NppDarkMode case WM_PAINT: if (NppDarkMode::isEnabled() && pButtonData->ensureTheme(hWnd)) { - PAINTSTRUCT ps = { 0 }; + PAINTSTRUCT ps = {}; HDC hdc = reinterpret_cast(wParam); if (!hdc) { @@ -1196,7 +1196,7 @@ namespace NppDarkMode HFONT hFont = reinterpret_cast(SendMessage(hWnd, WM_GETFONT, 0, 0)); auto hOldFont = SelectObject(hdc, hFont); - POINT ptCursor = { 0 }; + POINT ptCursor = {}; ::GetCursorPos(&ptCursor); ScreenToClient(hWnd, &ptCursor); @@ -1205,10 +1205,10 @@ namespace NppDarkMode int nSelTab = TabCtrl_GetCurSel(hWnd); for (int i = 0; i < nTabs; ++i) { - RECT rcItem = { 0 }; + RECT rcItem = {}; TabCtrl_GetItemRect(hWnd, i, &rcItem); - RECT rcIntersect = { 0 }; + RECT rcIntersect = {}; if (IntersectRect(&rcIntersect, &ps.rcPaint, &rcItem)) { bool bHot = PtInRect(&rcItem, ptCursor); @@ -1235,7 +1235,7 @@ namespace NppDarkMode SetBkMode(hdc, TRANSPARENT); TCHAR label[MAX_PATH]; - TCITEM tci = { 0 }; + TCITEM tci = {}; tci.mask = TCIF_TEXT; tci.pszText = label; tci.cchTextMax = MAX_PATH - 1; @@ -1305,7 +1305,7 @@ namespace NppDarkMode break; } - RECT rc = { 0 }; + RECT rc = {}; ::GetClientRect(hWnd, &rc); PAINTSTRUCT ps; @@ -1354,7 +1354,7 @@ namespace NppDarkMode } } - POINT ptCursor = { 0 }; + POINT ptCursor = {}; ::GetCursorPos(&ptCursor); ScreenToClient(hWnd, &ptCursor); @@ -1418,7 +1418,7 @@ namespace NppDarkMode EnumChildWindows(hwndParent, [](HWND hwnd, LPARAM lParam) WINAPI_LAMBDA { auto& p = *reinterpret_cast(lParam); const size_t classNameLen = 16; - TCHAR className[classNameLen] = { 0 }; + TCHAR className[classNameLen] = { '\0' }; GetClassName(hwnd, className, classNameLen); if (wcscmp(className, WC_COMBOBOX) == 0) diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 38479b3c9..867461456 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -124,7 +124,7 @@ void resolveLinkFile(generic_string& linkFilePath) { IShellLink* psl; WCHAR targetFilePath[MAX_PATH]; - WIN32_FIND_DATA wfd = {0}; + WIN32_FIND_DATA wfd = {}; HRESULT hres = CoInitialize(NULL); if (SUCCEEDED(hres)) diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 0c0b2ee82..1c12b5cc6 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -232,7 +232,7 @@ struct CmdLineParams int _column2go = -1; int _pos2go = -1; - POINT _point = { 0 }; + POINT _point = {}; bool _isPointXValid = false; bool _isPointYValid = false; @@ -298,7 +298,7 @@ struct CmdLineParamsDTO struct FloatingWindowInfo { int _cont = 0; - RECT _pos = { 0 }; + RECT _pos = {}; FloatingWindowInfo(int cont, int x, int y, int w, int h) : _cont(cont) @@ -573,7 +573,7 @@ struct PrintSettings final { int _footerFontStyle = 0; int _footerFontSize = 0; - RECT _marge = {0}; + RECT _marge = {}; PrintSettings() { _marge.left = 0; _marge.top = 0; _marge.right = 0; _marge.bottom = 0; @@ -742,9 +742,9 @@ struct NppGUI final bool _checkHistoryFiles = false; - RECT _appPos = {0}; + RECT _appPos = {}; - RECT _findWindowPos = { 0 }; + RECT _findWindowPos = {}; bool _isMaximized = false; bool _isMinimizedToTray = false; diff --git a/PowerEditor/src/ScintillaComponent/Buffer.cpp b/PowerEditor/src/ScintillaComponent/Buffer.cpp index fb3053206..4cff782b5 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScintillaComponent/Buffer.cpp @@ -846,7 +846,7 @@ bool FileManager::deleteFile(BufferID id) if (!PathFileExists(fileNamePath.c_str())) return false; - SHFILEOPSTRUCT fileOpStruct = {0}; + SHFILEOPSTRUCT fileOpStruct = {}; fileOpStruct.hwnd = NULL; fileOpStruct.pFrom = fileNamePath.c_str(); fileOpStruct.pTo = NULL; @@ -1462,7 +1462,7 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const TCHAR * fil bool success = true; EolType format = EolType::unknown; int sciStatus = SC_STATUS_OK; - TCHAR szException[64] = { 0 }; + TCHAR szException[64] = { '\0' }; __try { // First allocate enough memory for the whole file (this will reduce memory copy during loading) diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 58ee97503..b15c0f984 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -751,7 +751,7 @@ intptr_t CALLBACK FindInFinderDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR { if (NppDarkMode::isEnabled()) { - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; @@ -932,7 +932,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA { if (NppDarkMode::isEnabled()) { - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; @@ -2614,7 +2614,7 @@ void FindReplaceDlg::findAllIn(InWhat op) _pFinder->init(_hInst, (*_ppEditView)->getHParent(), _ppEditView); _pFinder->setVolatiled(false); - tTbData data = {0}; + tTbData data = {}; _pFinder->create(&data); ::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pFinder->getHSelf())); // define the default docking behaviour @@ -2746,7 +2746,7 @@ Finder * FindReplaceDlg::createFinder() Finder *pFinder = new Finder(); pFinder->init(_hInst, (*_ppEditView)->getHParent(), _ppEditView); - tTbData data = { 0 }; + tTbData data = {}; bool isRTL = _pFinder->_scintView.isTextDirectionRTL(); pFinder->create(&data, isRTL); ::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(pFinder->getHSelf())); @@ -4698,7 +4698,7 @@ intptr_t CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPA { if (NppDarkMode::isEnabled()) { - RECT rcClient = { 0 }; + RECT rcClient = {}; GetClientRect(_hSelf, &rcClient); ::FillRect(reinterpret_cast(wParam), &rcClient, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; @@ -4848,7 +4848,7 @@ Progress::Progress(HINSTANCE hInst) : _hwnd(NULL), _hCallerWnd(NULL) { _hInst = hInst; - WNDCLASSEX wcex = {0}; + WNDCLASSEX wcex = {}; wcex.cbSize = sizeof(wcex); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = wndProc; @@ -4859,7 +4859,7 @@ Progress::Progress(HINSTANCE hInst) : _hwnd(NULL), _hCallerWnd(NULL) ::RegisterClassEx(&wcex); - INITCOMMONCONTROLSEX icex = {0}; + INITCOMMONCONTROLSEX icex = {}; icex.dwSize = sizeof(icex); icex.dwICC = ICC_STANDARD_CLASSES | ICC_PROGRESS_CLASS; @@ -5078,7 +5078,7 @@ LRESULT APIENTRY Progress::wndProc(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM l { if (NppDarkMode::isEnabled()) { - RECT rc = { 0 }; + RECT rc = {}; GetClientRect(hwnd, &rc); ::FillRect(reinterpret_cast(wparam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h index fa3e37dbe..f0d4b48fc 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h @@ -362,11 +362,11 @@ protected : void combo2ExtendedMode(int comboID); private : - RECT _initialWindowRect = {0}; + RECT _initialWindowRect = {}; LONG _deltaWidth = 0; LONG _initialClientWidth = 0; - DIALOG_TYPE _currentStatus = FIND_DLG; + DIALOG_TYPE _currentStatus = DIALOG_TYPE::FIND_DLG; RECT _findClosePos, _replaceClosePos, _findInFilesClosePos, _markClosePos; RECT _countInSelFramePos, _replaceInSelFramePos; RECT _countInSelCheckPos, _replaceInSelCheckPos; @@ -375,7 +375,7 @@ private : Finder *_pFinder = nullptr; generic_string _findResTitle; - std::vector _findersOfFinder; + std::vector _findersOfFinder{}; HWND _shiftTrickUpTip = nullptr; HWND _2ButtonsTip = nullptr; @@ -471,7 +471,7 @@ private : FindStatus _findStatus = FSFound; ReBar* _pRebar = nullptr; - REBARBANDINFO _rbBand = { 0 }; + REBARBANDINFO _rbBand = {}; virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); void markSelectedTextInc(bool enable, FindOption *opt = NULL); diff --git a/PowerEditor/src/ScintillaComponent/GoToLineDlg.cpp b/PowerEditor/src/ScintillaComponent/GoToLineDlg.cpp index 77bace253..a20f3871e 100644 --- a/PowerEditor/src/ScintillaComponent/GoToLineDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/GoToLineDlg.cpp @@ -63,7 +63,7 @@ intptr_t CALLBACK GoToLineDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) { if (NppDarkMode::isEnabled()) { - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; diff --git a/PowerEditor/src/ScintillaComponent/Printer.h b/PowerEditor/src/ScintillaComponent/Printer.h index bb7e80704..6ea2ccb60 100644 --- a/PowerEditor/src/ScintillaComponent/Printer.h +++ b/PowerEditor/src/ScintillaComponent/Printer.h @@ -23,9 +23,9 @@ struct NPP_RangeToFormat { HDC hdc = nullptr; HDC hdcTarget = nullptr; - RECT rc = { 0 }; - RECT rcPage = { 0 }; - Sci_CharacterRange chrg = { 0 }; + RECT rc = {}; + RECT rcPage = {}; + Sci_CharacterRange chrg = {}; }; class Printer @@ -43,7 +43,7 @@ public : size_t doPrint(bool justDoIt); private : - PRINTDLG _pdlg = { 0 }; + PRINTDLG _pdlg = {}; ScintillaEditView *_pSEView = nullptr; size_t _startPos = 0; size_t _endPos = 0; diff --git a/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp b/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp index c6d6fc844..3ed6eb83b 100644 --- a/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp +++ b/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp @@ -1592,7 +1592,7 @@ intptr_t CALLBACK StringDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) { if (NppDarkMode::isEnabled()) { - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; diff --git a/PowerEditor/src/ScintillaComponent/UserDefineDialog.h b/PowerEditor/src/ScintillaComponent/UserDefineDialog.h index 95e80acc4..21f4835cb 100644 --- a/PowerEditor/src/ScintillaComponent/UserDefineDialog.h +++ b/PowerEditor/src/ScintillaComponent/UserDefineDialog.h @@ -368,7 +368,7 @@ private : CommentStyleDialog _commentStyleDlg; SymbolsStyleDialog _symbolsStyleDlg; bool _status = UNDOCK; - RECT _dlgPos = { 0 }; + RECT _dlgPos = {}; int _currentHight = 0; int _yScrollPos = 0; int _prevHightVal = 0; diff --git a/PowerEditor/src/ScintillaComponent/columnEditor.cpp b/PowerEditor/src/ScintillaComponent/columnEditor.cpp index 67728c6ba..c1ec83095 100644 --- a/PowerEditor/src/ScintillaComponent/columnEditor.cpp +++ b/PowerEditor/src/ScintillaComponent/columnEditor.cpp @@ -83,7 +83,7 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR { if (NppDarkMode::isEnabled()) { - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; diff --git a/PowerEditor/src/WinControls/ColourPicker/ColourPopup.h b/PowerEditor/src/WinControls/ColourPicker/ColourPopup.h index 1af8962e7..6f9c05631 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPopup.h +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPopup.h @@ -58,7 +58,7 @@ public : COLORREF getSelColour(){return _colour;}; private : - RECT _rc = {0}; + RECT _rc = {}; COLORREF _colour = RGB(0xFF, 0xFF, 0xFF); static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp index de54ff934..cdc00a920 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp @@ -599,7 +599,7 @@ bool WordStyleDlg::isDocumentMapStyle() return false; constexpr size_t styleNameLen = 128; - TCHAR styleName[styleNameLen + 1] = { 0 }; + TCHAR styleName[styleNameLen + 1] = { '\0' }; const auto lbTextLen = ::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_GETTEXTLEN, i, 0); if (lbTextLen > styleNameLen) return false; diff --git a/PowerEditor/src/WinControls/DockingWnd/Docking.h b/PowerEditor/src/WinControls/DockingWnd/Docking.h index 463298b2e..5a2d6b222 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Docking.h +++ b/PowerEditor/src/WinControls/DockingWnd/Docking.h @@ -57,7 +57,7 @@ struct tTbData { const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations // internal data, do not use !!! - RECT rcFloat = {0}; // floating position + RECT rcFloat = {}; // floating position int iPrevCont = 0; // stores the privious container (toggling between float and dock) const TCHAR* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin }; @@ -65,7 +65,7 @@ struct tTbData { struct tDockMgr { HWND hWnd = nullptr; // the docking manager wnd - RECT rcRegion[DOCKCONT_MAX] = {{0}}; // position of docked dialogs + RECT rcRegion[DOCKCONT_MAX] = {{}}; // position of docked dialogs }; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp index 37b2b3378..17f74ae89 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp @@ -226,7 +226,7 @@ tTbData* DockingCont::getDataOfActiveTb() if (iItem != -1) { - TCITEM tcItem = {0}; + TCITEM tcItem = {}; tcItem.mask = TCIF_PARAM; ::SendMessage(_hContTab, TCM_GETITEM, iItem, reinterpret_cast(&tcItem)); @@ -239,7 +239,7 @@ tTbData* DockingCont::getDataOfActiveTb() vector DockingCont::getDataOfVisTb() { vector vTbData; - TCITEM tcItem = {0}; + TCITEM tcItem = {}; int iItemCnt = static_cast(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0)); tcItem.mask = TCIF_PARAM; @@ -254,7 +254,7 @@ vector DockingCont::getDataOfVisTb() bool DockingCont::isTbVis(tTbData* data) { - TCITEM tcItem = {0}; + TCITEM tcItem = {}; int iItemCnt = static_cast(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0)); tcItem.mask = TCIF_PARAM; @@ -335,7 +335,7 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR } case WM_MOUSEMOVE: { - POINT pt = {0}; + POINT pt = {}; // get correct cursor position ::GetCursorPos(&pt); @@ -394,8 +394,8 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR } case WM_MOUSEHOVER: { - RECT rc = {0}; - POINT pt = {0}; + RECT rc = {}; + POINT pt = {}; // get mouse position @@ -445,7 +445,7 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct) RECT rc = pDrawItemStruct->rcItem; HDC hDc = pDrawItemStruct->hDC; HPEN hPen = ::CreatePen(PS_SOLID, 1, ::GetSysColor(COLOR_BTNSHADOW)); - BITMAP bmp = {0}; + BITMAP bmp = {}; HBITMAP hBmpCur = NULL; HBITMAP hBmpOld = NULL; HBITMAP hBmpNew = NULL; @@ -510,7 +510,7 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct) ::DrawText(hDc, _pszCaption.c_str(), length, &rc, DT_LEFT | DT_SINGLELINE | DT_VCENTER | DT_END_ELLIPSIS | DT_NOPREFIX); // calculate text size and if its trankated... - SIZE size = {0}; + SIZE size = {}; GetTextExtentPoint32(hDc, _pszCaption.c_str(), length, &size); _bCaptionTT = (((rc.right - rc.left) < size.cx) ? TRUE : FALSE); @@ -561,7 +561,7 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct) ::DrawText(hDc, _pszCaption.c_str(), length, &rc, DT_BOTTOM | DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOPREFIX); // calculate text size and if its trankated... - SIZE size = {0}; + SIZE size = {}; GetTextExtentPoint32(hDc, _pszCaption.c_str(), length, &size); _bCaptionTT = (((rc.bottom - rc.top) < size.cy) ? TRUE : FALSE); @@ -731,7 +731,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l dis.itemState |= ODS_NOFOCUSRECT; // maybe, does it handle it already? - RECT rcIntersect = { 0 }; + RECT rcIntersect = {}; if (IntersectRect(&rcIntersect, &ps.rcPaint, &dis.rcItem)) { dis.rcItem.top += NppParameters::getInstance()._dpiManager.scaleY(1); @@ -788,7 +788,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l case WM_LBUTTONUP: { int iItem = 0; - TCHITTESTINFO info = {0}; + TCHITTESTINFO info = {}; // get selected sub item info.pt.x = LOWORD(lParam); @@ -807,8 +807,8 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l case WM_MBUTTONUP: { int iItem = 0; - TCITEM tcItem = {0}; - TCHITTESTINFO info = {0}; + TCITEM tcItem = {}; + TCHITTESTINFO info = {}; // get selected sub item info.pt.x = LOWORD(lParam); @@ -835,7 +835,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l case WM_MOUSEMOVE: { int iItem = 0; - TCHITTESTINFO info = {0}; + TCHITTESTINFO info = {}; // get selected sub item info.pt.x = LOWORD(lParam); @@ -873,8 +873,8 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l } else if (iItem != _iLastHovered) { - TCITEM tcItem = {0}; - RECT rc = {0}; + TCITEM tcItem = {}; + RECT rc = {}; // destroy old tooltip toolTip.destroy(); @@ -904,9 +904,9 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l case WM_MOUSEHOVER: { int iItem = 0; - TCITEM tcItem = {0}; - RECT rc = {0}; - TCHITTESTINFO info = {0}; + TCITEM tcItem = {}; + RECT rc = {}; + TCHITTESTINFO info = {}; // get selected sub item info.pt.x = LOWORD(lParam); @@ -941,7 +941,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l if ((lpnmhdr->hwndFrom == _hContTab) && (lpnmhdr->code == TCN_GETOBJECT)) { int iItem = 0; - TCHITTESTINFO info = {0}; + TCHITTESTINFO info = {}; // get selected sub item info.pt.x = LOWORD(lParam); @@ -961,7 +961,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l void DockingCont::drawTabItem(DRAWITEMSTRUCT *pDrawItemStruct) { - TCITEM tcItem = {0}; + TCITEM tcItem = {}; RECT rc = pDrawItemStruct->rcItem; int nTab = pDrawItemStruct->itemID; @@ -1023,7 +1023,7 @@ void DockingCont::drawTabItem(DRAWITEMSTRUCT *pDrawItemStruct) if ((hImageList != NULL) && (iPosImage >= 0)) { // Get height of image so we - IMAGEINFO info = {0}; + IMAGEINFO info = {}; RECT & imageRect = info.rcImage; ImageList_GetImageInfo(hImageList, iPosImage, &info); @@ -1106,7 +1106,7 @@ intptr_t CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l { break; } - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; @@ -1133,8 +1133,8 @@ intptr_t CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l } case WM_NCLBUTTONDBLCLK : { - RECT rcWnd = {0}; - RECT rcClient = {0}; + RECT rcWnd = {}; + RECT rcClient = {}; POINT pt = {HIWORD(lParam), LOWORD(lParam)}; getWindowRect(rcWnd); @@ -1184,9 +1184,9 @@ intptr_t CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l void DockingCont::onSize() { - TCITEM tcItem = {0}; - RECT rc = {0}; - RECT rcTemp = {0}; + TCITEM tcItem = {}; + RECT rc = {}; + RECT rcTemp = {}; UINT iItemCnt = static_cast(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0)); UINT iTabOff = 0; @@ -1309,7 +1309,7 @@ void DockingCont::doClose(BOOL closeAll) // Always close active tab first int iItemCur = getActiveTb(); - TCITEM tcItem = {0}; + TCITEM tcItem = {}; tcItem.mask = TCIF_PARAM; ::SendMessage(_hContTab, TCM_GETITEM, iItemCur, reinterpret_cast(&tcItem)); if (tcItem.lParam) @@ -1329,7 +1329,7 @@ void DockingCont::doClose(BOOL closeAll) int iItemOff = 0; for (int iItem = 0; iItem < iItemCnt; ++iItem) { - TCITEM tcItem = {0}; + TCITEM tcItem = {}; // get item data selectTab(iItemOff); tcItem.mask = TCIF_PARAM; @@ -1427,7 +1427,7 @@ int DockingCont::hideToolbar(tTbData *pTbData, BOOL hideClient) void DockingCont::viewToolbar(tTbData *pTbData) { - TCITEM tcItem = {0}; + TCITEM tcItem = {}; int iItemCnt = static_cast(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0)); if (iItemCnt > 0) @@ -1474,7 +1474,7 @@ void DockingCont::viewToolbar(tTbData *pTbData) int DockingCont::searchPosInTab(tTbData* pTbData) { - TCITEM tcItem = {0}; + TCITEM tcItem = {}; int iItemCnt = static_cast(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0)); tcItem.mask = TCIF_PARAM; @@ -1496,8 +1496,8 @@ void DockingCont::selectTab(int iTab) if (iTab != -1) { const TCHAR *pszMaxTxt = NULL; - TCITEM tcItem = {0}; - SIZE size = {0}; + TCITEM tcItem = {}; + SIZE size = {}; int maxWidth = 0; int iItemCnt = static_cast(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0)); @@ -1592,7 +1592,7 @@ bool DockingCont::updateCaption() if (!_hContTab) return false; - TCITEM tcItem = {0}; + TCITEM tcItem = {}; int iItem = getActiveTb(); if (iItem < 0) @@ -1628,7 +1628,7 @@ bool DockingCont::updateCaption() void DockingCont::focusClient() { - TCITEM tcItem = {0}; + TCITEM tcItem = {}; int iItem = getActiveTb(); if (iItem != -1) diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h index 1526662cd..d99ead982 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h @@ -187,7 +187,7 @@ private: BOOL _isMouseDown = FALSE; BOOL _isMouseClose = FALSE; BOOL _isMouseOver = FALSE; - RECT _rcCaption = {0}; + RECT _rcCaption = {}; // tab style BOOL _bDrawOgLine = FALSE; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h index d58532a29..ecfd00525 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h @@ -104,7 +104,7 @@ protected : break; } - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingManager.h b/PowerEditor/src/WinControls/DockingWnd/DockingManager.h index 3a6655c33..b90883142 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingManager.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingManager.h @@ -85,8 +85,8 @@ public : private : Window **_ppWindow = nullptr; - RECT _rcWork = { 0 }; - RECT _rect = { 0 }; + RECT _rcWork = {}; + RECT _rect = {}; Window **_ppMainWindow = nullptr; std::vector _vImageList; HIMAGELIST _hImageList = nullptr; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp index ca1f3ebd8..cb4540a97 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp @@ -152,7 +152,7 @@ LRESULT DockingSplitter::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM break; } - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getBackgroundBrush()); return TRUE; diff --git a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp index d41c47310..043110e70 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp @@ -209,8 +209,8 @@ LRESULT Gripper::runProc(UINT message, WPARAM wParam, LPARAM lParam) void Gripper::create() { - RECT rc = {0}; - POINT pt = {0}; + RECT rc = {}; + POINT pt = {}; // start hooking ::SetWindowPos(_pCont->getHSelf(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); @@ -283,8 +283,8 @@ void Gripper::onButtonUp() { POINT pt = {0,0}; POINT ptBuf = {0,0}; - RECT rc = {0}; - RECT rcCorr = {0}; + RECT rc = {}; + RECT rcCorr = {}; ::GetCursorPos(&pt); getMousePoints(&pt, &ptBuf); @@ -381,14 +381,14 @@ void Gripper::doTabReordering(POINT pt) /* search only if container is visible */ if (::IsWindowVisible(hTab) == TRUE) { - RECT rc = {0}; + RECT rc = {}; ::GetWindowRect(hTab, &rc); /* test if cursor points in tab window */ if (::PtInRect(&rc, pt) == TRUE) { - TCHITTESTINFO info = {0}; + TCHITTESTINFO info = {}; if (_hTab == NULL) { @@ -512,8 +512,8 @@ void Gripper::drawRectangle(const POINT* pPt) { HBRUSH hbrushOrig= NULL; HBITMAP hbmOrig = NULL; - RECT rc = {0}; - RECT rcNew = {0}; + RECT rc = {}; + RECT rcNew = {}; RECT rcOld = _rcPrev; // Get a screen device context with backstage redrawing disabled - to have a consistently @@ -632,7 +632,7 @@ void Gripper::getMousePoints(POINT* pt, POINT* ptPrev) void Gripper::getMovingRect(POINT pt, RECT *rc) { - RECT rcCorr = {0}; + RECT rcCorr = {}; DockingCont* pContHit = NULL; /* test if mouse hits a container */ @@ -695,7 +695,7 @@ DockingCont* Gripper::contHitTest(POINT pt) { if (vCont[iCont]->isFloating()) { - RECT rc = {0}; + RECT rc = {}; vCont[iCont]->getWindowRect(rc); if ((rc.top < pt.y) && (pt.y < (rc.top + 24))) @@ -721,7 +721,7 @@ DockingCont* Gripper::contHitTest(POINT pt) if (::IsWindowVisible(vCont[iCont]->getTabWnd())) { /* test if within tab (rect test is used, because of drag and drop behaviour) */ - RECT rc = {0}; + RECT rc = {}; ::GetWindowRect(vCont[iCont]->getTabWnd(), &rc); if (::PtInRect(&rc, pt)) @@ -738,7 +738,7 @@ DockingCont* Gripper::contHitTest(POINT pt) DockingCont* Gripper::workHitTest(POINT pt, RECT *rc) { - RECT rcCont = {0}; + RECT rcCont = {}; vector vCont = _pDockMgr->getContainerInfo(); /* at first test if cursor points into a visible container */ diff --git a/PowerEditor/src/WinControls/DockingWnd/Gripper.h b/PowerEditor/src/WinControls/DockingWnd/Gripper.h index 84a964b2c..884c6e64a 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Gripper.h +++ b/PowerEditor/src/WinControls/DockingWnd/Gripper.h @@ -121,21 +121,21 @@ private: DockingCont *_pCont = nullptr; // mouse offset in moving rectangle - POINT _ptOffset = { 0 }; + POINT _ptOffset = {}; // remembers old mouse point - POINT _ptOld = { 0 }; + POINT _ptOld = {}; BOOL _bPtOldValid = FALSE; // remember last drawn rectangle (jg) - RECT _rcPrev = { 0 }; + RECT _rcPrev = {}; // for sorting tabs HWND _hTab = nullptr; HWND _hTabSource = nullptr; BOOL _startMovingFromTab = FALSE; int _iItem = 0; - RECT _rcItem = { 0 }; + RECT _rcItem = {}; TCITEM _tcItem; HDC _hdc = nullptr; diff --git a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp index 528f16aa7..809402617 100644 --- a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp +++ b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp @@ -68,7 +68,7 @@ intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam, { if (NppDarkMode::isEnabled()) { - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.h b/PowerEditor/src/WinControls/FunctionList/functionListPanel.h index 29f0861b6..550bcb028 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.h +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.h @@ -107,7 +107,7 @@ private: TreeView _treeView; TreeView _treeViewSearchResult; - SCROLLINFO si = { 0 }; + SCROLLINFO si = {}; long _findLine = -1; long _findEndLine = -1; HTREEITEM _findItem = nullptr; diff --git a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.cpp b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.cpp index 52b4f2b42..643dda918 100644 --- a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.cpp +++ b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.cpp @@ -150,7 +150,7 @@ void ToolBarIcons::reInit(int size) } else { - BITMAPINFOHEADER bi = { 0 }; + BITMAPINFOHEADER bi = {}; bi.biSize = sizeof(BITMAPINFOHEADER); bi.biWidth = bmp.bmWidth; @@ -197,7 +197,7 @@ void ToolBarIcons::reInit(int size) ::ReleaseDC(NULL, dcScreen); - ICONINFO iconinfoDest = { 0 }; + ICONINFO iconinfoDest = {}; iconinfoDest.fIcon = TRUE; iconinfoDest.hbmColor = hBmpNew; iconinfoDest.hbmMask = iconinfoSrc.hbmMask; diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp b/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp index ede02441b..0a48a9ba7 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp @@ -93,7 +93,7 @@ namespace // anonymous void expandEnv(generic_string& s) { - TCHAR buffer[MAX_PATH] = { 0 }; + TCHAR buffer[MAX_PATH] = { '\0' }; // This returns the resulting string length or 0 in case of error. DWORD ret = ExpandEnvironmentStrings(s.c_str(), buffer, static_cast(std::size(buffer))); if (ret != 0) @@ -452,7 +452,7 @@ private: { if (::PathIsRelative(fileName.c_str())) { - TCHAR buffer[MAX_PATH] = { 0 }; + TCHAR buffer[MAX_PATH] = { '\0' }; const generic_string folder = getDialogFolder(_dialog); LPTSTR ret = ::PathCombine(buffer, folder.c_str(), fileName.c_str()); if (ret) diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 3b199b41e..b70882cb0 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -347,7 +347,7 @@ bool PreferenceDlg::renameDialogTitle(const TCHAR *internalName, const TCHAR *ne return false; const size_t lenMax = 256; - TCHAR oldName[lenMax] = {0}; + TCHAR oldName[lenMax] = { '\0' }; size_t txtLen = ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETTEXTLEN, i, 0); if (txtLen >= lenMax) return false; diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.h b/PowerEditor/src/WinControls/Preference/preferenceDlg.h index 4a37074b4..ae21d3f8d 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.h +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.h @@ -217,9 +217,10 @@ public : }; private : - POINT _singleLineModePoint, _multiLineModePoint; - RECT _closerRect = { 0 }; - RECT _closerLabelRect = { 0 }; + POINT _singleLineModePoint = {}; + POINT _multiLineModePoint = {}; + RECT _closerRect = {}; + RECT _closerLabelRect = {}; HWND _tip = nullptr; intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); diff --git a/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadFileChanges.h b/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadFileChanges.h index 6e24bc225..9a53ce11e 100644 --- a/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadFileChanges.h +++ b/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadFileChanges.h @@ -23,7 +23,7 @@ public: private: LPCTSTR _szFile = nullptr; DWORD _dwNotifyFilter = 0; - WIN32_FILE_ATTRIBUTE_DATA _lastFileInfo = { 0 }; + WIN32_FILE_ATTRIBUTE_DATA _lastFileInfo = {}; }; diff --git a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp index d9584a900..11ccad83e 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp @@ -397,7 +397,7 @@ LRESULT CALLBACK Splitter::spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lPara break; } - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); diff --git a/PowerEditor/src/WinControls/SplitterContainer/Splitter.h b/PowerEditor/src/WinControls/SplitterContainer/Splitter.h index eced93f40..eb2a24760 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/Splitter.h +++ b/PowerEditor/src/WinControls/SplitterContainer/Splitter.h @@ -81,8 +81,8 @@ private: static bool _isHorizontalFixedRegistered; static bool _isVerticalFixedRegistered; - RECT _clickZone2TL = { 0 }; - RECT _clickZone2BR = { 0 }; + RECT _clickZone2TL = {}; + RECT _clickZone2BR = {}; static LRESULT CALLBACK staticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lParam); diff --git a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp index ce100f8dd..992ab72aa 100644 --- a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp @@ -280,7 +280,7 @@ intptr_t CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam { if (NppDarkMode::isEnabled()) { - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; diff --git a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp index 07077921e..367776a0f 100644 --- a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp @@ -89,8 +89,8 @@ void StaticDialog::display(bool toShow, bool enhancedPositioningCheckWhenShowing { // If the user has switched from a dual monitor to a single monitor since we last // displayed the dialog, then ensure that it's still visible on the single monitor. - RECT workAreaRect = { 0 }; - RECT rc = { 0 }; + RECT workAreaRect = {}; + RECT rc = {}; ::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0); ::GetWindowRect(_hSelf, &rc); int newLeft = rc.left; diff --git a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h index 9d89b099e..a28f99297 100644 --- a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h +++ b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h @@ -68,7 +68,7 @@ public : virtual void destroy() override; protected: - RECT _rc = { 0 }; + RECT _rc = {}; static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0; diff --git a/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp b/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp index 74aa6089c..ba79fd8cb 100644 --- a/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp +++ b/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp @@ -110,7 +110,7 @@ LRESULT CALLBACK StatusBarSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l int horizontal; int vertical; int between; - } borders = { 0 }; + } borders = {}; SendMessage(hWnd, SB_GETBORDERS, 0, (LPARAM)&borders); @@ -133,9 +133,9 @@ LRESULT CALLBACK StatusBarSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l std::wstring str; for (int i = 0; i < nParts; ++i) { - RECT rcPart = { 0 }; + RECT rcPart = {}; SendMessage(hWnd, SB_GETRECT, i, (LPARAM)&rcPart); - RECT rcIntersect = { 0 }; + RECT rcIntersect = {}; if (!IntersectRect(&rcIntersect, &rcPart, &ps.rcPaint)) { continue; @@ -200,7 +200,7 @@ LRESULT CALLBACK StatusBarSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l if (isSizeGrip) { pStatusBarInfo->ensureTheme(hWnd); - SIZE gripSize = { 0 }; + SIZE gripSize = {}; GetThemePartSize(pStatusBarInfo->hTheme, hdc, SP_GRIPPER, 0, &rcClient, TS_DRAW, &gripSize); RECT rc = rcClient; rc.left = rc.right - gripSize.cx; diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index 5cc45948c..6ea5723bf 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -870,7 +870,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara break; } - RECT rc = { 0 }; + RECT rc = {}; GetClientRect(hwnd, &rc); FillRect((HDC)wParam, &rc, NppDarkMode::getDarkerBackgroundBrush()); @@ -926,7 +926,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara dis.itemState |= ODS_NOFOCUSRECT; // maybe, does it handle it already? - RECT rcIntersect = { 0 }; + RECT rcIntersect = {}; if (IntersectRect(&rcIntersect, &ps.rcPaint, &dis.rcItem)) { if (dwStyle & TCS_VERTICAL) diff --git a/PowerEditor/src/WinControls/TaskList/TaskList.h b/PowerEditor/src/WinControls/TaskList/TaskList.h index d98358973..a23af958e 100644 --- a/PowerEditor/src/WinControls/TaskList/TaskList.h +++ b/PowerEditor/src/WinControls/TaskList/TaskList.h @@ -62,6 +62,6 @@ protected: HFONT _hFontSelected = nullptr; int _nbItem = 0; int _currentIndex = 0; - RECT _rc = { 0 }; + RECT _rc = {}; }; diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp index 0cec13cd6..69cc6ead0 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp @@ -408,7 +408,7 @@ void ToolBar::registerDynBtn(UINT messageID, toolbarIcons* iconHandles, HICON ab { HBITMAP hbmMask = ::CreateCompatibleBitmap(::GetDC(NULL), bmp.bmWidth, bmp.bmHeight); - ICONINFO iconinfoDest = { 0 }; + ICONINFO iconinfoDest = {}; iconinfoDest.fIcon = TRUE; iconinfoDest.hbmColor = iconHandles->hToolbarBmp; iconinfoDest.hbmMask = hbmMask; diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.h b/PowerEditor/src/WinControls/ToolBar/ToolBar.h index 1fff5db54..aaa37ba15 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.h +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.h @@ -111,7 +111,7 @@ private : size_t _nbTotalButtons = 0; size_t _nbCurrentButtons = 0; ReBar * _pRebar = nullptr; - REBARBANDINFO _rbBand = { 0 }; + REBARBANDINFO _rbBand = {}; std::vector _customIconVect; TiXmlNode *_toolIcons = nullptr; diff --git a/PowerEditor/src/WinControls/ToolTip/ToolTip.h b/PowerEditor/src/WinControls/ToolTip/ToolTip.h index b2a46b712..066e7dbde 100644 --- a/PowerEditor/src/WinControls/ToolTip/ToolTip.h +++ b/PowerEditor/src/WinControls/ToolTip/ToolTip.h @@ -37,7 +37,7 @@ public: protected: WNDPROC _defaultProc = nullptr; BOOL _bTrackMouse = FALSE; - TOOLINFO _ti = { 0 }; + TOOLINFO _ti = {}; static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { return (((ToolTip *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(Message, wParam, lParam)); diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp index 05f8c01a2..18e87a637 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp @@ -205,7 +205,7 @@ intptr_t CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, LPNMHEADER test = (LPNMHEADER)lParam; HWND hwndHD = ListView_GetHeader(_fileListView.getHSelf()); TCHAR HDtext[MAX_PATH]; - HDITEM hdi = { 0 }; + HDITEM hdi = {}; hdi.mask = HDI_TEXT | HDI_WIDTH; hdi.pszText = HDtext; hdi.cchTextMax = MAX_PATH; diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h index 2cdb18cd8..18162faae 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h @@ -83,8 +83,8 @@ protected : HWND _hList = nullptr; static RECT _lastKnownLocation; - SIZE _szMinButton = { 0 }; - SIZE _szMinListCtrl = { 0 }; + SIZE _szMinButton = {}; + SIZE _szMinListCtrl = {}; DocTabView *_pTab = nullptr; std::vector _idxMap; int _currentColumn = -1; diff --git a/PowerEditor/src/lesDlgs.cpp b/PowerEditor/src/lesDlgs.cpp index 656a2538f..387d427b6 100644 --- a/PowerEditor/src/lesDlgs.cpp +++ b/PowerEditor/src/lesDlgs.cpp @@ -124,7 +124,7 @@ intptr_t CALLBACK ValueDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) { if (NppDarkMode::isEnabled()) { - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; @@ -206,7 +206,7 @@ intptr_t CALLBACK ButtonDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) { if (NppDarkMode::isEnabled()) { - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE;