Code improvement, remove unnecessary part

Fix pedantic warnings, add initializers.

Close #12093
This commit is contained in:
ozone10 2022-09-03 17:13:06 +02:00 committed by Don Ho
parent ea1e9295eb
commit ebe7648ee1
20 changed files with 63 additions and 71 deletions

View File

@ -77,7 +77,7 @@ bool isInListA(const char *token, const char *list)
if ((!token) || (!list)) if ((!token) || (!list))
return false; return false;
char word[64]; char word[64] = { '\0' };
size_t i = 0; size_t i = 0;
size_t j = 0; size_t j = 0;
for (size_t len = strlen(list); i <= len; ++i) for (size_t len = strlen(list); i <= len; ++i)
@ -100,7 +100,7 @@ bool isInListA(const char *token, const char *list)
} }
} }
return false; return false;
}; }
int EncodingMapper::getEncodingFromIndex(int index) const int EncodingMapper::getEncodingFromIndex(int index) const
{ {
@ -144,4 +144,4 @@ int EncodingMapper::getEncodingFromString(const char *encodingAlias) const
} }
} }
return enc; return enc;
} }

View File

@ -240,7 +240,7 @@ void HashFromFilesDlg::doDialog(bool isRTL)
// Adjust the position in the center // Adjust the position in the center
goToCenter(); goToCenter();
}; }
void HashFromTextDlg::generateHash() void HashFromTextDlg::generateHash()
{ {
@ -500,4 +500,4 @@ void HashFromTextDlg::doDialog(bool isRTL)
// Adjust the position in the center // Adjust the position in the center
goToCenter(); goToCenter();
}; }

View File

@ -3358,7 +3358,7 @@ void Notepad_plus::setLanguage(LangType langType)
_subEditView.execute(SCI_SETDOCPOINTER, 0, prev); _subEditView.execute(SCI_SETDOCPOINTER, 0, prev);
_subEditView.restoreCurrentPosPreStep(); _subEditView.restoreCurrentPosPreStep();
} }
}; }
LangType Notepad_plus::menuID2LangType(int cmdID) LangType Notepad_plus::menuID2LangType(int cmdID)
{ {
@ -4703,7 +4703,7 @@ static generic_string extractSymbol(TCHAR firstChar, TCHAR secondChar, const TCH
} }
} }
return generic_string(extracted); return generic_string(extracted);
}; }
bool Notepad_plus::doBlockComment(comment_mode currCommentMode) bool Notepad_plus::doBlockComment(comment_mode currCommentMode)
{ {

View File

@ -43,14 +43,14 @@ void addText2Combo(const TCHAR * txt2add, HWND hCombo)
i = ::SendMessage(hCombo, CB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(txt2add)); i = ::SendMessage(hCombo, CB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(txt2add));
::SendMessage(hCombo, CB_SETCURSEL, i, 0); ::SendMessage(hCombo, CB_SETCURSEL, i, 0);
}; }
generic_string getTextFromCombo(HWND hCombo) generic_string getTextFromCombo(HWND hCombo)
{ {
TCHAR str[FINDREPLACE_MAXLENGTH] = { '\0' }; TCHAR str[FINDREPLACE_MAXLENGTH] = { '\0' };
::SendMessage(hCombo, WM_GETTEXT, FINDREPLACE_MAXLENGTH - 1, reinterpret_cast<LPARAM>(str)); ::SendMessage(hCombo, WM_GETTEXT, FINDREPLACE_MAXLENGTH - 1, reinterpret_cast<LPARAM>(str));
return generic_string(str); return generic_string(str);
}; }
void delLeftWordInEdit(HWND hEdit) void delLeftWordInEdit(HWND hEdit)
{ {
@ -75,7 +75,7 @@ void delLeftWordInEdit(HWND hEdit)
::SendMessage(hEdit, EM_SETSEL, (WPARAM)wordstart, (LPARAM)cursor); ::SendMessage(hEdit, EM_SETSEL, (WPARAM)wordstart, (LPARAM)cursor);
::SendMessage(hEdit, EM_REPLACESEL, (WPARAM)TRUE, reinterpret_cast<LPARAM>(L"")); ::SendMessage(hEdit, EM_REPLACESEL, (WPARAM)TRUE, reinterpret_cast<LPARAM>(L""));
} }
}; }
int Searching::convertExtendedToString(const TCHAR * query, TCHAR * result, int length) int Searching::convertExtendedToString(const TCHAR * query, TCHAR * result, int length)
{ //query may equal to result, since it always gets smaller { //query may equal to result, since it always gets smaller

View File

@ -3387,7 +3387,7 @@ bool ScintillaEditView::getIndicatorRange(size_t indicatorNumber, size_t* from,
if (to) *to = endPos; if (to) *to = endPos;
if (cur) *cur = curPos; if (cur) *cur = curPos;
return true; return true;
}; }
void ScintillaEditView::scrollPosToCenter(size_t pos) void ScintillaEditView::scrollPosToCenter(size_t pos)
@ -3894,7 +3894,7 @@ pair<size_t, size_t> ScintillaEditView::getSelectedCharsAndLinesCount(long long
} }
return selectedCharsAndLines; return selectedCharsAndLines;
}; }
size_t ScintillaEditView::getUnicodeSelectedLength() const size_t ScintillaEditView::getUnicodeSelectedLength() const
{ {
@ -3909,7 +3909,7 @@ size_t ScintillaEditView::getUnicodeSelectedLength() const
} }
return length; return length;
}; }
void ScintillaEditView::markedTextToClipboard(int indiStyle, bool doAll /*= false*/) void ScintillaEditView::markedTextToClipboard(int indiStyle, bool doAll /*= false*/)

View File

@ -84,7 +84,7 @@ void convertTo(TCHAR *dest, int destLen, const TCHAR *toConvert, const TCHAR *pr
} }
} }
dest[index] = '\0'; dest[index] = '\0';
}; }
bool SharedParametersDialog::setPropertyByCheck(HWND hwnd, WPARAM id, bool & bool2set) bool SharedParametersDialog::setPropertyByCheck(HWND hwnd, WPARAM id, bool & bool2set)
{ {

View File

@ -51,4 +51,4 @@ namespace Utf8 { // could be a static class, instead of a namespace, if it needs
++charContinuationBytes; ++charContinuationBytes;
return startingIndex-charContinuationBytes; return startingIndex-charContinuationBytes;
} }
}; }

View File

@ -584,7 +584,7 @@ bool Utf16_Iter::get(utf8 *c)
return true; return true;
} }
return false; return false;
}; }
void Utf16_Iter::pushout(ubyte c) void Utf16_Iter::pushout(ubyte c)
{ {

View File

@ -43,8 +43,8 @@ static const WORD DotPattern[] =
class Gripper final class Gripper final
{ {
public: public:
Gripper() = default;; Gripper() = default;
void init(HINSTANCE hInst, HWND hParent) { void init(HINSTANCE hInst, HWND hParent) {
_hInst = hInst; _hInst = hInst;
_hParent = hParent; _hParent = hParent;
@ -148,4 +148,3 @@ private:
// get layout direction // get layout direction
bool _isRTL = false; bool _isRTL = false;
}; };

View File

@ -493,7 +493,7 @@ void ViewZoneDlg::doDialog()
create(win10 ? IDD_VIEWZONE : IDD_VIEWZONE_CLASSIC); create(win10 ? IDD_VIEWZONE : IDD_VIEWZONE_CLASSIC);
} }
display(); display();
}; }
intptr_t CALLBACK ViewZoneDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) intptr_t CALLBACK ViewZoneDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{ {

View File

@ -70,7 +70,7 @@ vector<generic_string> split(const generic_string & string2split, TCHAR sep)
} }
} }
return splitedStrings; return splitedStrings;
}; }
bool isRelatedRootFolder(const generic_string & relatedRoot, const generic_string & subFolder) bool isRelatedRootFolder(const generic_string & relatedRoot, const generic_string & subFolder)
{ {
@ -1605,7 +1605,7 @@ LPCWSTR explainAction(DWORD dwAction)
default: default:
return L"BAD DATA"; return L"BAD DATA";
} }
}; }
DWORD WINAPI FolderUpdater::watching(void *params) DWORD WINAPI FolderUpdater::watching(void *params)

View File

@ -25,7 +25,7 @@ void ShortcutMapper::initTabs()
{ {
HWND hTab = _hTabCtrl = ::GetDlgItem(_hSelf, IDC_BABYGRID_TABBAR); HWND hTab = _hTabCtrl = ::GetDlgItem(_hSelf, IDC_BABYGRID_TABBAR);
NppDarkMode::subclassTabControl(hTab); NppDarkMode::subclassTabControl(hTab);
TCITEM tie; TCITEM tie{};
tie.mask = TCIF_TEXT; tie.mask = TCIF_TEXT;
for (size_t i = 0; i < _nbTab; ++i) for (size_t i = 0; i < _nbTab; ++i)
@ -39,8 +39,8 @@ void ShortcutMapper::initTabs()
TabCtrl_SetCurSel(_hTabCtrl, int(_currentState)); TabCtrl_SetCurSel(_hTabCtrl, int(_currentState));
// force alignment to babygrid // force alignment to babygrid
RECT rcTab; RECT rcTab{};
WINDOWPLACEMENT wp; WINDOWPLACEMENT wp{};
wp.length = sizeof(wp); wp.length = sizeof(wp);
::GetWindowPlacement(hTab, &wp); ::GetWindowPlacement(hTab, &wp);
@ -56,13 +56,13 @@ void ShortcutMapper::getClientRect(RECT & rc) const
{ {
Window::getClientRect(rc); Window::getClientRect(rc);
RECT tabRect, btnRect; RECT tabRect{}, btnRect{};
::GetClientRect(::GetDlgItem(_hSelf, IDC_BABYGRID_TABBAR), &tabRect); ::GetClientRect(::GetDlgItem(_hSelf, IDC_BABYGRID_TABBAR), &tabRect);
int tabH = tabRect.bottom - tabRect.top; int tabH = tabRect.bottom - tabRect.top;
int paddingTop = tabH / 2; int paddingTop = tabH / 2;
rc.top += tabH + paddingTop; rc.top += tabH + paddingTop;
RECT infoRect, filterRect; RECT infoRect{}, filterRect{};
::GetClientRect(::GetDlgItem(_hSelf, IDC_BABYGRID_INFO), &infoRect); ::GetClientRect(::GetDlgItem(_hSelf, IDC_BABYGRID_INFO), &infoRect);
::GetClientRect(::GetDlgItem(_hSelf, IDC_BABYGRID_FILTER), &filterRect); ::GetClientRect(::GetDlgItem(_hSelf, IDC_BABYGRID_FILTER), &filterRect);
::GetClientRect(::GetDlgItem(_hSelf, IDOK), &btnRect); ::GetClientRect(::GetDlgItem(_hSelf, IDOK), &btnRect);
@ -104,7 +104,7 @@ generic_string ShortcutMapper::getTabString(size_t i) const
void ShortcutMapper::initBabyGrid() void ShortcutMapper::initBabyGrid()
{ {
RECT rect; RECT rect{};
getClientRect(rect); getClientRect(rect);
_lastHomeRow.resize(5, 1); _lastHomeRow.resize(5, 1);
@ -190,7 +190,7 @@ generic_string ShortcutMapper::getTextFromCombo(HWND hCombo)
::SendMessage(hCombo, WM_GETTEXT, NB_MAX, reinterpret_cast<LPARAM>(str)); ::SendMessage(hCombo, WM_GETTEXT, NB_MAX, reinterpret_cast<LPARAM>(str));
generic_string res(str); generic_string res(str);
return stringToLower(res); return stringToLower(res);
}; }
bool ShortcutMapper::isFilterValid(Shortcut sc) bool ShortcutMapper::isFilterValid(Shortcut sc)
{ {
@ -1065,7 +1065,7 @@ intptr_t CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARA
case BGN_CELLRCLICKED: //a cell was clicked in the properties grid case BGN_CELLRCLICKED: //a cell was clicked in the properties grid
{ {
POINT p; POINT p{};
::GetCursorPos(&p); ::GetCursorPos(&p);
if (!_rightClickMenu.isCreated()) if (!_rightClickMenu.isCreated())
{ {

View File

@ -29,7 +29,7 @@ void IconList::init(HINSTANCE hInst, int iconSize)
_hImglst = ImageList_Create(iconSize, iconSize, ILC_COLOR32 | ILC_MASK, 0, nbMore); _hImglst = ImageList_Create(iconSize, iconSize, ILC_COLOR32 | ILC_MASK, 0, nbMore);
if (!_hImglst) if (!_hImglst)
throw std::runtime_error("IconList::create : ImageList_Create() function returns null"); throw std::runtime_error("IconList::create : ImageList_Create() function returns null");
}; }
void IconList::create(int iconSize, HINSTANCE hInst, int *iconIDArray, int iconIDArraySize) void IconList::create(int iconSize, HINSTANCE hInst, int *iconIDArray, int iconIDArraySize)
{ {
@ -39,7 +39,7 @@ void IconList::create(int iconSize, HINSTANCE hInst, int *iconIDArray, int iconI
for (int i = 0 ; i < iconIDArraySize ; ++i) for (int i = 0 ; i < iconIDArraySize ; ++i)
addIcon(iconIDArray[i]); addIcon(iconIDArray[i]);
}; }
void IconList::addIcon(int iconID) const void IconList::addIcon(int iconID) const
{ {
@ -49,14 +49,13 @@ void IconList::addIcon(int iconID) const
ImageList_AddIcon(_hImglst, hIcon); ImageList_AddIcon(_hImglst, hIcon);
::DestroyIcon(hIcon); ::DestroyIcon(hIcon);
}; }
void IconList::addIcon(HICON hIcon) const void IconList::addIcon(HICON hIcon) const
{ {
if (hIcon) if (hIcon)
ImageList_AddIcon(_hImglst, hIcon); ImageList_AddIcon(_hImglst, hIcon);
}; }
bool IconList::changeIcon(size_t index, const TCHAR *iconLocation) const bool IconList::changeIcon(size_t index, const TCHAR *iconLocation) const
{ {
@ -141,7 +140,7 @@ void ToolBarIcons::reInit(int size)
HDC dcScreen = ::GetDC(NULL); HDC dcScreen = ::GetDC(NULL);
BITMAP bmp; BITMAP bmp{};
int nbByteBmp = ::GetObject(iconinfoSrc.hbmColor, sizeof(BITMAP), &bmp); int nbByteBmp = ::GetObject(iconinfoSrc.hbmColor, sizeof(BITMAP), &bmp);
if (!nbByteBmp) if (!nbByteBmp)
@ -216,7 +215,6 @@ void ToolBarIcons::reInit(int size)
} }
} }
void ToolBarIcons::create(HINSTANCE hInst, int iconSize) void ToolBarIcons::create(HINSTANCE hInst, int iconSize)
{ {
_iconListVector.push_back(IconList()); _iconListVector.push_back(IconList());
@ -250,7 +248,3 @@ void ToolBarIcons::destroy()
_iconListVector[HLIST_DISABLE].destroy(); _iconListVector[HLIST_DISABLE].destroy();
_iconListVector[HLIST_DISABLE2].destroy(); _iconListVector[HLIST_DISABLE2].destroy();
} }

View File

@ -126,7 +126,7 @@ void expandNppEnvironmentStrs(const TCHAR *strSrc, TCHAR *stringDest, size_t str
{ {
if (iEnd != -1) if (iEnd != -1)
{ {
TCHAR str[MAX_PATH]; TCHAR str[MAX_PATH] = { '\0' };
int m = 0; int m = 0;
for (int k = iBegin ; k <= iEnd ; ++k) for (int k = iBegin ; k <= iEnd ; ++k)
str[m++] = strSrc[k]; str[m++] = strSrc[k];
@ -425,4 +425,4 @@ void RunDlg::doDialog(bool isRTL)
// Adjust the position in the center // Adjust the position in the center
goToCenter(); goToCenter();
::SetFocus(::GetDlgItem(_hSelf, IDC_COMBO_RUN_PATH)); ::SetFocus(::GetDlgItem(_hSelf, IDC_COMBO_RUN_PATH));
}; }

View File

@ -130,7 +130,7 @@ bool ToolBar::init( HINSTANCE hInst, HWND hPere, toolBarStatusType type, ToolBar
_toolBarIcons.init(buttonUnitArray, arraySize, _vDynBtnReg); _toolBarIcons.init(buttonUnitArray, arraySize, _vDynBtnReg);
_toolBarIcons.create(_hInst, iconSize); _toolBarIcons.create(_hInst, iconSize);
INITCOMMONCONTROLSEX icex; INITCOMMONCONTROLSEX icex{};
icex.dwSize = sizeof(INITCOMMONCONTROLSEX); icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC = ICC_WIN95_CLASSES|ICC_COOL_CLASSES|ICC_BAR_CLASSES|ICC_USEREX_CLASSES; icex.dwICC = ICC_WIN95_CLASSES|ICC_COOL_CLASSES|ICC_BAR_CLASSES|ICC_USEREX_CLASSES;
InitCommonControlsEx(&icex); InitCommonControlsEx(&icex);
@ -207,11 +207,11 @@ void ToolBar::destroy()
::DestroyWindow(_hSelf); ::DestroyWindow(_hSelf);
_hSelf = NULL; _hSelf = NULL;
_toolBarIcons.destroy(); _toolBarIcons.destroy();
}; }
int ToolBar::getWidth() const int ToolBar::getWidth() const
{ {
RECT btnRect; RECT btnRect{};
int totalWidth = 0; int totalWidth = 0;
for (size_t i = 0; i < _nbCurrentButtons; ++i) for (size_t i = 0; i < _nbCurrentButtons; ++i)
{ {
@ -279,7 +279,7 @@ void ToolBar::reset(bool create)
if (create && _hSelf) if (create && _hSelf)
{ {
//Store current button state information //Store current button state information
TBBUTTON tempBtn; TBBUTTON tempBtn{};
for (size_t i = 0; i < _nbCurrentButtons; ++i) for (size_t i = 0; i < _nbCurrentButtons; ++i)
{ {
::SendMessage(_hSelf, TB_GETBUTTON, i, reinterpret_cast<LPARAM>(&tempBtn)); ::SendMessage(_hSelf, TB_GETBUTTON, i, reinterpret_cast<LPARAM>(&tempBtn));
@ -421,7 +421,7 @@ void ToolBar::registerDynBtn(UINT messageID, toolbarIcons* iconHandles, HICON ab
// Note: Register of buttons only possible before init! // Note: Register of buttons only possible before init!
if ((_hSelf == NULL) && (messageID != 0) && (iconHandles->hToolbarBmp != NULL)) if ((_hSelf == NULL) && (messageID != 0) && (iconHandles->hToolbarBmp != NULL))
{ {
DynamicCmdIcoBmp dynList; DynamicCmdIcoBmp dynList{};
dynList._message = messageID; dynList._message = messageID;
dynList._hBmp = iconHandles->hToolbarBmp; dynList._hBmp = iconHandles->hToolbarBmp;
@ -431,7 +431,7 @@ void ToolBar::registerDynBtn(UINT messageID, toolbarIcons* iconHandles, HICON ab
} }
else else
{ {
BITMAP bmp; BITMAP bmp{};
int nbByteBmp = ::GetObject(dynList._hBmp, sizeof(BITMAP), &bmp); int nbByteBmp = ::GetObject(dynList._hBmp, sizeof(BITMAP), &bmp);
if (!nbByteBmp) if (!nbByteBmp)
{ {
@ -463,7 +463,7 @@ void ToolBar::registerDynBtnDM(UINT messageID, toolbarIconsWithDarkMode* iconHan
if ((_hSelf == NULL) && (messageID != 0) && (iconHandles->hToolbarBmp != NULL) && if ((_hSelf == NULL) && (messageID != 0) && (iconHandles->hToolbarBmp != NULL) &&
(iconHandles->hToolbarIcon != NULL) && (iconHandles->hToolbarIconDarkMode != NULL)) (iconHandles->hToolbarIcon != NULL) && (iconHandles->hToolbarIconDarkMode != NULL))
{ {
DynamicCmdIcoBmp dynList; DynamicCmdIcoBmp dynList{};
dynList._message = messageID; dynList._message = messageID;
dynList._hBmp = iconHandles->hToolbarBmp; dynList._hBmp = iconHandles->hToolbarBmp;
dynList._hIcon = iconHandles->hToolbarIcon; dynList._hIcon = iconHandles->hToolbarIcon;
@ -554,7 +554,7 @@ LRESULT CALLBACK RebarSubclass(
case WM_ERASEBKGND: case WM_ERASEBKGND:
if (NppDarkMode::isEnabled()) if (NppDarkMode::isEnabled())
{ {
RECT rc; RECT rc{};
GetClientRect(hWnd, &rc); GetClientRect(hWnd, &rc);
FillRect((HDC)wParam, &rc, NppDarkMode::getDarkerBackgroundBrush()); FillRect((HDC)wParam, &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE; return TRUE;
@ -582,7 +582,7 @@ void ReBar::init(HINSTANCE hInst, HWND hPere)
SetWindowSubclass(_hSelf, RebarSubclass, g_rebarSubclassID, 0); SetWindowSubclass(_hSelf, RebarSubclass, g_rebarSubclassID, 0);
REBARINFO rbi; REBARINFO rbi{};
ZeroMemory(&rbi, sizeof(REBARINFO)); ZeroMemory(&rbi, sizeof(REBARINFO));
rbi.cbSize = sizeof(REBARINFO); rbi.cbSize = sizeof(REBARINFO);
rbi.fMask = 0; rbi.fMask = 0;
@ -726,4 +726,3 @@ bool ReBar::isIDTaken(int id)
} }
return false; return false;
} }

View File

@ -43,7 +43,7 @@ int CALLBACK ListViewCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSo
return result; return result;
return (0 - result); return (0 - result);
}; }
void VerticalFileSwitcher::startColumnSort() void VerticalFileSwitcher::startColumnSort()
{ {
@ -121,7 +121,7 @@ intptr_t CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam,
if (i == -1 || i >= nbItem) if (i == -1 || i >= nbItem)
return TRUE; return TRUE;
LVITEM item; LVITEM item{};
item.mask = LVIF_PARAM; item.mask = LVIF_PARAM;
item.iItem = i; item.iItem = i;
ListView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item); ListView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item);
@ -150,7 +150,7 @@ intptr_t CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam,
if (i == -1 || i >= nbItem) if (i == -1 || i >= nbItem)
return TRUE; return TRUE;
LVITEM item; LVITEM item{};
item.mask = LVIF_PARAM; item.mask = LVIF_PARAM;
item.iItem = i; item.iItem = i;
ListView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item); ListView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item);
@ -162,7 +162,7 @@ intptr_t CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam,
if (nbSelectedFiles() >= 1) if (nbSelectedFiles() >= 1)
{ {
// Redirect NM_RCLICK message to Notepad_plus handle // Redirect NM_RCLICK message to Notepad_plus handle
NMHDR nmhdr; NMHDR nmhdr{};
nmhdr.code = NM_RCLICK; nmhdr.code = NM_RCLICK;
nmhdr.hwndFrom = _hSelf; nmhdr.hwndFrom = _hSelf;
nmhdr.idFrom = ::GetDlgCtrlID(nmhdr.hwndFrom); nmhdr.idFrom = ::GetDlgCtrlID(nmhdr.hwndFrom);
@ -206,7 +206,7 @@ intptr_t CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam,
LPNMHEADER test = (LPNMHEADER)lParam; LPNMHEADER test = (LPNMHEADER)lParam;
HWND hwndHD = ListView_GetHeader(_fileListView.getHSelf()); HWND hwndHD = ListView_GetHeader(_fileListView.getHSelf());
TCHAR HDtext[MAX_PATH]; TCHAR HDtext[MAX_PATH] = { '\0' };
HDITEM hdi = {}; HDITEM hdi = {};
hdi.mask = HDI_TEXT | HDI_WIDTH; hdi.mask = HDI_TEXT | HDI_WIDTH;
hdi.pszText = HDtext; hdi.pszText = HDtext;
@ -231,7 +231,7 @@ intptr_t CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam,
if (i == -1) if (i == -1)
return TRUE; return TRUE;
LVITEM item; LVITEM item{};
item.mask = LVIF_PARAM; item.mask = LVIF_PARAM;
item.iItem = i; item.iItem = i;
ListView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item); ListView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item);
@ -336,7 +336,7 @@ void VerticalFileSwitcher::display(bool toShow) const
{ {
DockingDlgInterface::display(toShow); DockingDlgInterface::display(toShow);
_fileListView.ensureVisibleCurrentItem(); // without this call the current item may stay above visible area after the program startup _fileListView.ensureVisibleCurrentItem(); // without this call the current item may stay above visible area after the program startup
}; }
void VerticalFileSwitcher::activateDoc(TaskLstFnStatus *tlfs) const void VerticalFileSwitcher::activateDoc(TaskLstFnStatus *tlfs) const
{ {
@ -359,7 +359,7 @@ void VerticalFileSwitcher::activateDoc(TaskLstFnStatus *tlfs) const
int VerticalFileSwitcher::setHeaderOrder(int columnIndex) int VerticalFileSwitcher::setHeaderOrder(int columnIndex)
{ {
HWND hListView = _fileListView.getHSelf(); HWND hListView = _fileListView.getHSelf();
LVCOLUMN lvc; LVCOLUMN lvc{};
lvc.mask = LVCF_FMT; lvc.mask = LVCF_FMT;
//strip HDF_SORTUP and HDF_SORTDOWN from old sort column //strip HDF_SORTUP and HDF_SORTDOWN from old sort column
@ -397,7 +397,7 @@ int VerticalFileSwitcher::setHeaderOrder(int columnIndex)
void VerticalFileSwitcher::updateHeaderArrow() void VerticalFileSwitcher::updateHeaderArrow()
{ {
HWND hListView = _fileListView.getHSelf(); HWND hListView = _fileListView.getHSelf();
LVCOLUMN lvc; LVCOLUMN lvc{};
lvc.mask = LVCF_FMT; lvc.mask = LVCF_FMT;
SendMessage(hListView, LVM_GETCOLUMN, _lastSortingColumn, reinterpret_cast<LPARAM>(&lvc)); SendMessage(hListView, LVM_GETCOLUMN, _lastSortingColumn, reinterpret_cast<LPARAM>(&lvc));

View File

@ -560,7 +560,7 @@ void WindowsDlg::updateButtonState()
int WindowsDlg::doDialog() int WindowsDlg::doDialog()
{ {
return static_cast<int>(DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_WINDOWS), _hParent, dlgProc, reinterpret_cast<LPARAM>(this))); return static_cast<int>(DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_WINDOWS), _hParent, dlgProc, reinterpret_cast<LPARAM>(this)));
}; }
BOOL WindowsDlg::onInitDialog() BOOL WindowsDlg::onInitDialog()
{ {

View File

@ -55,7 +55,7 @@ static size_t keyTranslate(size_t keyIn) {
case VK_OEM_6: return ']'; case VK_OEM_6: return ']';
default: return keyIn; default: return keyIn;
} }
}; }
struct KeyCombo { struct KeyCombo {
bool _isCtrl = false; bool _isCtrl = false;

View File

@ -79,7 +79,7 @@ void LastRecentFileList::switchMode()
_hParentMenu = NULL; _hParentMenu = NULL;
} }
_hasSeparators = false; _hasSeparators = false;
}; }
void LastRecentFileList::updateMenu() void LastRecentFileList::updateMenu()
{ {
@ -181,14 +181,14 @@ void LastRecentFileList::add(const TCHAR *fn)
} }
_lrfl.push_front(itemToAdd); _lrfl.push_front(itemToAdd);
updateMenu(); updateMenu();
}; }
void LastRecentFileList::remove(const TCHAR *fn) void LastRecentFileList::remove(const TCHAR *fn)
{ {
int index = find(fn); int index = find(fn);
if (index != -1) if (index != -1)
remove(index); remove(index);
}; }
void LastRecentFileList::remove(size_t index) void LastRecentFileList::remove(size_t index)
{ {
@ -202,7 +202,7 @@ void LastRecentFileList::remove(size_t index)
--_size; --_size;
updateMenu(); updateMenu();
} }
}; }
void LastRecentFileList::clear() void LastRecentFileList::clear()
@ -232,7 +232,7 @@ generic_string & LastRecentFileList::getItem(int id)
if (i == _size) if (i == _size)
i = 0; i = 0;
return _lrfl.at(i)._name; //if not found, return first return _lrfl.at(i)._name; //if not found, return first
}; }
generic_string & LastRecentFileList::getIndex(int index) generic_string & LastRecentFileList::getIndex(int index)
{ {

View File

@ -182,7 +182,7 @@ bool isInList(const TCHAR *token2Find, ParamVector& params, bool eraseArg = true
} }
} }
return false; return false;
}; }
bool getParamVal(TCHAR c, ParamVector & params, generic_string & value) bool getParamVal(TCHAR c, ParamVector & params, generic_string & value)
{ {
@ -248,7 +248,7 @@ intptr_t getNumberFromParam(char paramName, ParamVector & params, bool & isParam
} }
isParamePresent = true; isParamePresent = true;
return static_cast<intptr_t>(_ttoi64(numStr.c_str())); return static_cast<intptr_t>(_ttoi64(numStr.c_str()));
}; }
generic_string getEasterEggNameFromParam(ParamVector & params, unsigned char & type) generic_string getEasterEggNameFromParam(ParamVector & params, unsigned char & type)
{ {