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
pull/11174/head
Don Ho 2022-02-09 16:41:56 +01:00
parent 2e9342ae24
commit 785453147b
49 changed files with 168 additions and 167 deletions

View File

@ -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(&currentTime);
generic_string dateTimeStrW = getDateTimeStrFrom(TEXT("yyyy-MM-dd HH:mm:ss"), currentTime);
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> 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;

View File

@ -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);

View File

@ -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;

View File

@ -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<LPARAM>(_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<LPARAM>(_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<LPARAM>(_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<LPARAM>(_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<LPARAM>(_pFuncList->getHSelf()));

View File

@ -94,7 +94,7 @@ struct VisibleGUIConf final
bool _isStatusbarShown = true;
//used by fullscreen
WINDOWPLACEMENT _winPlace = {0};
WINDOWPLACEMENT _winPlace = {};
//used by distractionFree
bool _was2ViewModeOn = false;

View File

@ -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<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return 0;

View File

@ -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(&currentTime);
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, &currentTime, 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(&currentTime);
NppGUI& nppGUI = NppParameters::getInstance().getNppGUI();

View File

@ -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<DWORD>(SendMessage(hwnd, BM_GETSTATE, 0, 0));
DWORD uiState = static_cast<DWORD>(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<HDC>(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<HFONT>(::SelectObject(hdc, hFont));
WCHAR szText[256] = { 0 };
WCHAR szText[256] = { '\0' };
GetWindowText(hwnd, szText, _countof(szText));
auto style = static_cast<long>(::GetWindowLongPtr(hwnd, GWL_STYLE));
@ -1038,7 +1038,7 @@ namespace NppDarkMode
if (szText[0])
{
SIZE textSize = { 0 };
SIZE textSize = {};
GetTextExtentPoint32(hdc, szText, static_cast<int>(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<HDC>(wParam);
if (!hdc)
{
@ -1196,7 +1196,7 @@ namespace NppDarkMode
HFONT hFont = reinterpret_cast<HFONT>(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<Params*>(lParam);
const size_t classNameLen = 16;
TCHAR className[classNameLen] = { 0 };
TCHAR className[classNameLen] = { '\0' };
GetClassName(hwnd, className, classNameLen);
if (wcscmp(className, WC_COMBOBOX) == 0)

View File

@ -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))

View File

@ -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;

View File

@ -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)

View File

@ -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<HDC>(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<HDC>(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<LPARAM>(_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<WPARAM>(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<HDC>(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<HDC>(wparam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;

View File

@ -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<Finder *> _findersOfFinder;
std::vector<Finder*> _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);

View File

@ -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<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;

View File

@ -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;

View File

@ -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<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;

View File

@ -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;

View File

@ -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<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;

View File

@ -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);

View File

@ -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;

View File

@ -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
};

View File

@ -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<LPARAM>(&tcItem));
@ -239,7 +239,7 @@ tTbData* DockingCont::getDataOfActiveTb()
vector<tTbData*> DockingCont::getDataOfVisTb()
{
vector<tTbData*> vTbData;
TCITEM tcItem = {0};
TCITEM tcItem = {};
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
tcItem.mask = TCIF_PARAM;
@ -254,7 +254,7 @@ vector<tTbData*> DockingCont::getDataOfVisTb()
bool DockingCont::isTbVis(tTbData* data)
{
TCITEM tcItem = {0};
TCITEM tcItem = {};
int iItemCnt = static_cast<int32_t>(::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<HDC>(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<int32_t>(::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<LPARAM>(&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<int32_t>(::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<int32_t>(::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<int32_t>(::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)

View File

@ -187,7 +187,7 @@ private:
BOOL _isMouseDown = FALSE;
BOOL _isMouseClose = FALSE;
BOOL _isMouseOver = FALSE;
RECT _rcCaption = {0};
RECT _rcCaption = {};
// tab style
BOOL _bDrawOgLine = FALSE;

View File

@ -104,7 +104,7 @@ protected :
break;
}
RECT rc = { 0 };
RECT rc = {};
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;

View File

@ -85,8 +85,8 @@ public :
private :
Window **_ppWindow = nullptr;
RECT _rcWork = { 0 };
RECT _rect = { 0 };
RECT _rcWork = {};
RECT _rect = {};
Window **_ppMainWindow = nullptr;
std::vector<HWND> _vImageList;
HIMAGELIST _hImageList = nullptr;

View File

@ -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<HDC>(wParam), &rc, NppDarkMode::getBackgroundBrush());
return TRUE;

View File

@ -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<DockingCont*> vCont = _pDockMgr->getContainerInfo();
/* at first test if cursor points into a visible container */

View File

@ -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;

View File

@ -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<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;

View File

@ -107,7 +107,7 @@ private:
TreeView _treeView;
TreeView _treeViewSearchResult;
SCROLLINFO si = { 0 };
SCROLLINFO si = {};
long _findLine = -1;
long _findEndLine = -1;
HTREEITEM _findItem = nullptr;

View File

@ -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;

View File

@ -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<DWORD>(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)

View File

@ -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;

View File

@ -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);

View File

@ -23,7 +23,7 @@ public:
private:
LPCTSTR _szFile = nullptr;
DWORD _dwNotifyFilter = 0;
WIN32_FILE_ATTRIBUTE_DATA _lastFileInfo = { 0 };
WIN32_FILE_ATTRIBUTE_DATA _lastFileInfo = {};
};

View File

@ -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<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());

View File

@ -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);

View File

@ -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<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -62,6 +62,6 @@ protected:
HFONT _hFontSelected = nullptr;
int _nbItem = 0;
int _currentIndex = 0;
RECT _rc = { 0 };
RECT _rc = {};
};

View File

@ -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;

View File

@ -111,7 +111,7 @@ private :
size_t _nbTotalButtons = 0;
size_t _nbCurrentButtons = 0;
ReBar * _pRebar = nullptr;
REBARBANDINFO _rbBand = { 0 };
REBARBANDINFO _rbBand = {};
std::vector<iconLocator> _customIconVect;
TiXmlNode *_toolIcons = nullptr;

View File

@ -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));

View File

@ -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;

View File

@ -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<int> _idxMap;
int _currentColumn = -1;

View File

@ -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<HDC>(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<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;