View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002256 | Far Manager | _Common | public | 2013-01-14 17:01 | 2013-01-15 20:04 |
Reporter | michael.lukashov | Assigned To | DrKnS | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | 3.0 | ||||
Fixed in Version | 3.0 | ||||
Summary | 0002256: Fix warnings: member variable is not initialized in constructor | ||||
Description | Исправление сообщений cppcheck: member variable is not initialized in constructor. Неинициализированные переменные могут приводить к рандомным падениям программы и другим труднообнаруживаемым багам. cppcheck рулит. | ||||
Tags | No tags attached. | ||||
Build | 3084 | ||||
|
fix-init-member-variables.diff (3,669 bytes)
Index: scrbuf.cpp =================================================================== --- scrbuf.cpp (revision 9327) +++ scrbuf.cpp (working copy) @@ -72,6 +72,8 @@ ElevationCharUsed(false), CurVisible(false) { + ClearStruct(MacroChar); + ClearStruct(ElevationChar); SBFlags.Set(SBFLAGS_FLUSHED|SBFLAGS_FLUSHEDCURPOS|SBFLAGS_FLUSHEDCURTYPE); } Index: copy.cpp =================================================================== --- copy.cpp (revision 9327) +++ copy.cpp (working copy) @@ -294,6 +294,8 @@ Percents(0), LastWriteTime(0) { + ClearStruct(Rect); + ClearArray(Bar); } void CopyProgress::SetScanName(const wchar_t *Name) Index: qview.cpp =================================================================== --- qview.cpp (revision 9327) +++ qview.cpp (working copy) @@ -65,6 +65,7 @@ OldWrapType(0), uncomplete_dirscan(false) { + ClearStruct(Data); Type=QVIEW_PANEL; if (!LastMode) { Index: config.cpp =================================================================== --- config.cpp (revision 9327) +++ config.cpp (working copy) @@ -146,6 +146,9 @@ ElevationMode(0), WindowMode(-1) { + ClearStruct(FindOpt); + ClearStruct(XLat); + ClearStruct(Tree); #ifndef _DEBUGEXC if(IsDebuggerPresent()) { Index: usermenu.cpp =================================================================== --- usermenu.cpp (revision 9327) +++ usermenu.cpp (working copy) @@ -212,7 +212,11 @@ } } -UserMenu::UserMenu(bool ChoiceMenuType) +UserMenu::UserMenu(bool ChoiceMenuType): + MenuMode(MM_LOCAL), + MenuModified(false), + MenuNeedRefresh(false), + ItemChanged(false) { ProcessUserMenu(ChoiceMenuType); } Index: DlgBuilder.hpp =================================================================== --- DlgBuilder.hpp (revision 9327) +++ DlgBuilder.hpp (working copy) @@ -389,8 +389,9 @@ } DialogBuilderBase() - : DialogItems(nullptr), DialogItemsCount(0), DialogItemsAllocated(0), NextY(2), Indent(0), SingleBoxIndex(-1), - ColumnStartIndex(-1), ColumnBreakIndex(-1), ColumnMinWidth(0) + : DialogItems(nullptr), Bindings(nullptr), DialogItemsCount(0), DialogItemsAllocated(0), NextY(2), Indent(0), SingleBoxIndex(-1), + OKButtonID(-1), + ColumnStartIndex(-1), ColumnBreakIndex(-1), ColumnStartY(-1), ColumnEndY(-1), ColumnMinWidth(0) { } @@ -742,6 +743,7 @@ : DialogAPIBinding(aInfo, aHandle, aID), Value(aValue) { + memset(Buffer, 0, sizeof(Buffer)); aInfo.FSF->sprintf(Buffer, L"%u", *aValue); int MaskWidth = Width < 31 ? Width : 31; for(int i=1; i<MaskWidth; i++) @@ -817,13 +819,15 @@ public: PluginDialogBuilder(const PluginStartupInfo &aInfo, const GUID &aPluginId, const GUID &aId, int TitleMessageID, const wchar_t *aHelpTopic, FARWINDOWPROC aDlgProc=nullptr, void* aUserParam=nullptr) - : Info(aInfo), HelpTopic(aHelpTopic), PluginId(aPluginId), Id(aId), DlgProc(aDlgProc), UserParam(aUserParam) + : Info(aInfo), HelpTopic(aHelpTopic), PluginId(aPluginId), Id(aId), DlgProc(aDlgProc), UserParam(aUserParam), + DialogHandle(0) { AddBorder(GetLangString(TitleMessageID)); } PluginDialogBuilder(const PluginStartupInfo &aInfo, const GUID &aPluginId, const GUID &aId, const wchar_t *TitleMessage, const wchar_t *aHelpTopic, FARWINDOWPROC aDlgProc=nullptr, void* aUserParam=nullptr) - : Info(aInfo), HelpTopic(aHelpTopic), PluginId(aPluginId), Id(aId), DlgProc(aDlgProc), UserParam(aUserParam) + : Info(aInfo), HelpTopic(aHelpTopic), PluginId(aPluginId), Id(aId), DlgProc(aDlgProc), UserParam(aUserParam), + DialogHandle(0) { AddBorder(TitleMessage); } |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-01-14 17:01 | michael.lukashov | New Issue | |
2013-01-14 17:01 | michael.lukashov | File Added: fix-init-member-variables.diff | |
2013-01-15 20:04 | DrKnS | Build | => 3084 |
2013-01-15 20:04 | DrKnS | Status | new => closed |
2013-01-15 20:04 | DrKnS | Assigned To | => DrKnS |
2013-01-15 20:04 | DrKnS | Resolution | open => fixed |
2013-01-15 20:04 | DrKnS | Fixed in Version | => 3.0 |