Code enhancement: Initialize variable member's value of struct/class

Close #10545
This commit is contained in:
Don Ho 2021-09-13 21:19:44 +02:00
parent 049ededf9f
commit a3116818e0
44 changed files with 209 additions and 224 deletions

View File

@ -18,8 +18,8 @@
#pragma once
struct EncodingUnit {
int _codePage;
const char *_aliasList;
int _codePage = 0;
const char *_aliasList = nullptr;
};
class EncodingMapper {

View File

@ -14,9 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#ifndef NPP_SORTERS_H
#define NPP_SORTERS_H
#pragma once
#include <algorithm>
#include <utility>
@ -26,8 +24,9 @@
class ISorter
{
private:
bool _isDescending;
size_t _fromColumn, _toColumn;
bool _isDescending = true;
size_t _fromColumn = 0;
size_t _toColumn = 0;
protected:
bool isDescending() const
@ -453,4 +452,3 @@ public:
}
};
#endif //NPP_SORTERS_H

View File

@ -42,11 +42,11 @@ protected:
static void translate(unsigned code, EXCEPTION_POINTERS * info);
private:
const char * _event;
const char * _event = nullptr;
ExceptionAddress _location;
unsigned int _code;
unsigned int _code = 0;
EXCEPTION_POINTERS * _info;
EXCEPTION_POINTERS * _info = nullptr;
};
@ -58,7 +58,7 @@ public:
private:
explicit Win32AccessViolation(EXCEPTION_POINTERS * info);
bool _isWrite;
bool _isWrite = false;
ExceptionAddress _badAddress;
friend void Win32Exception::translate(unsigned code, EXCEPTION_POINTERS* info);

View File

@ -30,8 +30,8 @@ public:
bool isInRange(int id) { return (id >= _start && id < _nextID); }
private:
int _start;
int _nextID;
int _maximumID;
int _start = 0;
int _nextID = 0;
int _maximumID = 0;
};

View File

@ -26,9 +26,9 @@ typedef const TCHAR * (__cdecl * PFUNCGETNAME)();
struct NppData
{
HWND _nppHandle;
HWND _scintillaMainHandle;
HWND _scintillaSecondHandle;
HWND _nppHandle = nullptr;
HWND _scintillaMainHandle = nullptr;
HWND _scintillaSecondHandle = nullptr;
};
typedef void (__cdecl * PFUNCSETINFO)(NppData);
@ -39,19 +39,19 @@ typedef LRESULT (__cdecl * PMESSAGEPROC)(UINT Message, WPARAM wParam, LPARAM lPa
struct ShortcutKey
{
bool _isCtrl;
bool _isAlt;
bool _isShift;
UCHAR _key;
bool _isCtrl = false;
bool _isAlt = false;
bool _isShift = false;
UCHAR _key = 0;
};
struct FuncItem
{
TCHAR _itemName[nbChar];
PFUNCPLUGINCMD _pFunc;
int _cmdID;
bool _init2Check;
ShortcutKey *_pShKey;
TCHAR _itemName[nbChar] = { '\0' };
PFUNCPLUGINCMD _pFunc = nullptr;
int _cmdID = 0;
bool _init2Check = false;
ShortcutKey *_pShKey = nullptr;
};
typedef FuncItem * (__cdecl * PFUNCGETFUNCSARRAY)(int *);

View File

@ -27,8 +27,8 @@ typedef BOOL (__cdecl * PFUNCISUNICODE)();
struct PluginCommand
{
generic_string _pluginName;
int _funcID;
PFUNCPLUGINCMD _pFunc;
int _funcID = 0;
PFUNCPLUGINCMD _pFunc = nullptr;
PluginCommand(const TCHAR *pluginName, int funcID, PFUNCPLUGINCMD pFunc): _funcID(funcID), _pFunc(pFunc), _pluginName(pluginName){};
};

View File

@ -94,16 +94,11 @@ struct VisibleGUIConf final
bool _isStatusbarShown = true;
//used by fullscreen
WINDOWPLACEMENT _winPlace;
WINDOWPLACEMENT _winPlace = {0};
//used by distractionFree
bool _was2ViewModeOn = false;
std::vector<DockingCont*> _pVisibleDockingContainers;
VisibleGUIConf()
{
memset(&_winPlace, 0x0, sizeof(_winPlace));
}
};
struct QuoteParams
@ -267,8 +262,8 @@ public:
void refreshDarkMode(bool resetStyle = false);
private:
Notepad_plus_Window *_pPublicInterface = nullptr;
Window *_pMainWindow = nullptr;
Notepad_plus_Window* _pPublicInterface = nullptr;
Window* _pMainWindow = nullptr;
DockingManager _dockingManager;
std::vector<int> _internalFuncIDs;
@ -331,8 +326,6 @@ private:
LastRecentFileList _lastRecentFileList;
//vector<iconLocator> _customIconVect;
WindowsMenu _windowsMenu;
HMENU _mainMenuHandle = NULL;
@ -355,7 +348,7 @@ private:
RunMacroDlg _runMacroDlg;
// For conflict detection when saving Macros or RunCommands
ShortcutMapper * _pShortcutMapper = nullptr;
ShortcutMapper* _pShortcutMapper = nullptr;
// For hotspot
bool _linkTriggered = true;

View File

@ -389,11 +389,11 @@ private:
//document properties
Document _doc; //invariable
LangType _lang;
LangType _lang = L_TEXT;
generic_string _userLangExt; // it's useful if only (_lang == L_USER)
bool _isDirty = false;
EolType _eolFormat = EolType::osdefault;
UniMode _unicodeMode;
UniMode _unicodeMode = uniUTF8;
int _encoding = -1;
bool _isUserReadOnly = false;
bool _needLexer = false; // new buffers do not need lexing, Scintilla takes care of that
@ -404,7 +404,7 @@ private:
std::vector<std::vector<size_t>> _foldStates;
//Environment properties
DocFileStatus _currentStatus;
DocFileStatus _currentStatus = DOC_REGULAR;
FILETIME _timeStamp = {}; // 0 if it's a new doc
bool _isFileReadOnly = false;

View File

@ -91,7 +91,7 @@ public :
};
private :
ScintillaEditView *_pView;
ScintillaEditView *_pView = nullptr;
static bool _hideTabBarStatus;
std::vector<IconList *> _pIconListVector;

View File

@ -362,11 +362,11 @@ protected :
void combo2ExtendedMode(int comboID);
private :
RECT _initialWindowRect;
RECT _initialWindowRect = {0};
LONG _deltaWidth = 0;
LONG _initialClientWidth = 0;
DIALOG_TYPE _currentStatus;
DIALOG_TYPE _currentStatus = FIND_DLG;
RECT _findClosePos, _replaceClosePos, _findInFilesClosePos, _markClosePos;
RECT _countInSelFramePos, _replaceInSelFramePos;
RECT _countInSelCheckPos, _replaceInSelCheckPos;
@ -384,10 +384,10 @@ private :
bool _isRTL = false;
int _findAllResult;
TCHAR _findAllResultStr[1024];
TCHAR _findAllResultStr[1024] = {'\0'};
int _fileNameLenMax = 1024;
char *_uniFileName;
char *_uniFileName = nullptr;
TabBar _tab;
winVer _winVer = winVer::WV_UNKNOWN;
@ -453,7 +453,7 @@ public :
virtual void destroy();
virtual void display(bool toShow = true) const;
void setSearchText(const TCHAR * txt2find, bool) {
void setSearchText(const TCHAR* txt2find, bool) {
::SendDlgItemMessage(_hSelf, IDC_INCFINDTEXT, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(txt2find));
};
@ -463,13 +463,13 @@ public :
return _findStatus;
}
void addToRebar(ReBar * rebar);
void addToRebar(ReBar* rebar);
private :
bool _isRTL = false;
FindReplaceDlg *_pFRDlg = nullptr;
FindStatus _findStatus = FSFound;
ReBar * _pRebar = nullptr;
ReBar* _pRebar = nullptr;
REBARBANDINFO _rbBand;
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -21,11 +21,11 @@
struct NPP_RangeToFormat {
HDC hdc;
HDC hdcTarget;
RECT rc;
RECT rcPage;
Sci_CharacterRange chrg;
HDC hdc = nullptr;
HDC hdcTarget = nullptr;
RECT rc = { 0 };
RECT rcPage = { 0 };
Sci_CharacterRange chrg = { 0 };
};
class Printer

View File

@ -38,6 +38,7 @@ private:
std::vector<ScintillaEditView *> _scintVector;
HINSTANCE _hInst = nullptr;
HWND _hParent = nullptr;
int getIndexFrom(HWND handle2Find);
};

View File

@ -134,14 +134,13 @@ const bool L2R = true;
const bool R2L = false;
struct ColumnModeInfo {
int _selLpos;
int _selRpos;
int _order; // 0 based index
bool _direction; // L2R or R2L
int _nbVirtualCaretSpc;
int _nbVirtualAnchorSpc;
int _selLpos = 0;
int _selRpos = 0;
int _order = -1; // 0 based index
bool _direction = L2R; // L2R or R2L
int _nbVirtualCaretSpc = 0;
int _nbVirtualAnchorSpc = 0;
ColumnModeInfo() : _selLpos(0), _selRpos(0), _order(-1), _direction(L2R), _nbVirtualAnchorSpc(0), _nbVirtualCaretSpc(0){};
ColumnModeInfo(int lPos, int rPos, int order, bool dir = L2R, int vAnchorNbSpc = 0, int vCaretNbSpc = 0)
: _selLpos(lPos), _selRpos(rPos), _order(order), _direction(dir), _nbVirtualAnchorSpc(vAnchorNbSpc), _nbVirtualCaretSpc(vCaretNbSpc){};
@ -171,11 +170,11 @@ struct SortInPositionOrder {
typedef std::vector<ColumnModeInfo> ColumnModeInfos;
struct LanguageName {
const TCHAR * lexerName;
const TCHAR * shortName;
const TCHAR * longName;
LangType LangID;
int lexerID;
const TCHAR * lexerName = nullptr;
const TCHAR * shortName = nullptr;
const TCHAR * longName = nullptr;
LangType LangID = L_TEXT;
int lexerID = 0;
};
#define URL_INDIC 8

View File

@ -28,5 +28,5 @@ public:
void highlightViewWithWord(ScintillaEditView * pHighlightView, const generic_string & word2Hilite);
private:
FindReplaceDlg * _pFRDlg;
FindReplaceDlg * _pFRDlg = nullptr;
};

View File

@ -362,13 +362,13 @@ protected :
private :
ControlsTab _ctrlTab;
WindowVector _wVector;
UserLangContainer *_pCurrentUserLang;
UserLangContainer *_pCurrentUserLang = nullptr;
FolderStyleDialog _folderStyleDlg;
KeyWordsStyleDialog _keyWordsStyleDlg;
CommentStyleDialog _commentStyleDlg;
SymbolsStyleDialog _symbolsStyleDlg;
bool _status = UNDOCK;
RECT _dlgPos;
RECT _dlgPos = { 0 };
int _currentHight = 0;
int _yScrollPos = 0;
int _prevHightVal = 0;
@ -450,12 +450,12 @@ public:
static INT_PTR CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
private:
HINSTANCE _hInst;
HWND _parent;
int _stylerIndex;
int _enabledNesters;
ColourPicker * _pFgColour;
ColourPicker * _pBgColour;
HINSTANCE _hInst = nullptr;
HWND _parent = nullptr;
int _stylerIndex = 0;
int _enabledNesters = 0;
ColourPicker * _pFgColour = nullptr;
ColourPicker * _pBgColour = nullptr;
Style _initialStyle;
void move2CtrlRight(HWND hwndDlg, int ctrlID, HWND handle2Move, int handle2MoveWidth, int handle2MoveHeight);

View File

@ -22,9 +22,6 @@
class URLCtrl : public Window {
public:
URLCtrl():_hfUnderlined(0),_hCursor(0), _msgDest(NULL), _cmdID(0), _oldproc(NULL), \
_linkColor(), _visitedColor(), _clicking(false), _URL(TEXT("")){};
void create(HWND itemHandle, const TCHAR * link, COLORREF linkColor = RGB(0,0,255));
void create(HWND itemHandle, int cmd, HWND msgDest = NULL);
void destroy();
@ -32,16 +29,16 @@ private:
void action();
protected :
generic_string _URL;
HFONT _hfUnderlined;
HCURSOR _hCursor;
HFONT _hfUnderlined = nullptr;
HCURSOR _hCursor = nullptr;
HWND _msgDest;
unsigned long _cmdID;
HWND _msgDest = nullptr;
unsigned long _cmdID = 0;
WNDPROC _oldproc;
COLORREF _linkColor;
COLORREF _visitedColor;
bool _clicking;
WNDPROC _oldproc = nullptr;
COLORREF _linkColor = RGB(0xFF, 0xFF, 0xFF);
COLORREF _visitedColor = RGB(0xFF, 0xFF, 0xFF);
bool _clicking = false;
static LRESULT CALLBACK URLCtrlProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam){
return ((URLCtrl *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(hwnd, Message, wParam, lParam);

View File

@ -29,19 +29,18 @@ class ScintillaEditView;
class ByteArray {
public:
ByteArray():_pBytes(NULL), _length(0) {};
ByteArray() = default;
explicit ByteArray(ClipboardData cd);
~ByteArray() {
delete [] _pBytes;
_pBytes = NULL;
_length = 0;
if (_pBytes)
delete [] _pBytes;
};
const unsigned char * getPointer() const {return _pBytes;};
size_t getLength() const {return _length;};
protected:
unsigned char *_pBytes;
size_t _length;
unsigned char *_pBytes = nullptr;
size_t _length = 0;
};
class StringArray : public ByteArray {
@ -79,11 +78,11 @@ protected:
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
private:
ScintillaEditView **_ppEditView;
ScintillaEditView **_ppEditView = nullptr;
std::vector<ClipboardData> _clipboardDataVector;
HWND _hwndNextCbViewer;
int _lbBgColor;
int _lbFgColor;
HWND _hwndNextCbViewer = nullptr;
int _lbBgColor = -1;
int _lbFgColor= -1;
};

View File

@ -58,9 +58,8 @@ public :
COLORREF getSelColour(){return _colour;};
private :
RECT _rc;
COLORREF _colour;
//bool isColourChooserLaunched = false;
RECT _rc = {0};
COLORREF _colour = RGB(0xFF, 0xFF, 0xFF);
static INT_PTR CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -45,8 +45,8 @@ public :
_oldProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(staticHandle, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(staticProc)));
};
private :
COLORREF _colour;
WNDPROC _oldProc;
COLORREF _colour = RGB(0xFF, 0xFF, 0xFF);
WNDPROC _oldProc = nullptr;
static LRESULT CALLBACK staticProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
ColourStaticTextHooker *pColourStaticTextHooker = reinterpret_cast<ColourStaticTextHooker *>(::GetWindowLongPtr(hwnd, GWLP_USERDATA));

View File

@ -47,25 +47,25 @@
typedef struct {
HWND hClient; // client Window Handle
const TCHAR *pszName; // name of plugin (shown in window)
int dlgID; // a funcItem provides the function pointer to start a dialog. Please parse here these ID
HWND hClient = nullptr; // client Window Handle
const TCHAR* pszName = nullptr; // name of plugin (shown in window)
int dlgID = 0; // a funcItem provides the function pointer to start a dialog. Please parse here these ID
// user modifications
UINT uMask; // mask params: look to above defines
HICON hIconTab; // icon for tabs
const TCHAR *pszAddInfo; // for plugin to display additional informations
UINT uMask = 0; // mask params: look to above defines
HICON hIconTab = nullptr; // icon for tabs
const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations
// internal data, do not use !!!
RECT rcFloat; // floating position
int iPrevCont; // stores the privious container (toggling between float and dock)
const TCHAR* pszModuleName; // it's the plugin file name. It's used to identify the plugin
RECT rcFloat = {0}; // 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
} tTbData;
typedef struct {
HWND hWnd; // the docking manager wnd
RECT rcRegion[DOCKCONT_MAX]; // position of docked dialogs
HWND hWnd = nullptr; // the docking manager wnd
RECT rcRegion[DOCKCONT_MAX] = {{0}}; // position of docked dialogs
} tDockMgr;

View File

@ -172,55 +172,55 @@ protected :
private:
// handles
BOOL _isActive;
bool _isFloating;
HWND _hCaption;
HWND _hContTab;
BOOL _isActive = FALSE;
bool _isFloating = FALSE;
HWND _hCaption = nullptr;
HWND _hContTab = nullptr;
// horizontal font for caption and tab
HFONT _hFont;
HFONT _hFont = nullptr;
// caption params
BOOL _isTopCaption;
generic_string _pszCaption;
BOOL _isTopCaption = FALSE;
generic_string _pszCaption;
BOOL _isMouseDown;
BOOL _isMouseClose;
BOOL _isMouseOver;
RECT _rcCaption;
BOOL _isMouseDown = FALSE;
BOOL _isMouseClose = FALSE;
BOOL _isMouseOver = FALSE;
RECT _rcCaption = {0};
// tab style
BOOL _bDrawOgLine;
BOOL _bDrawOgLine = FALSE;
// Important value for DlgMoving class
BOOL _dragFromTab;
BOOL _dragFromTab = FALSE;
// subclassing handle for caption
WNDPROC _hDefaultCaptionProc;
WNDPROC _hDefaultCaptionProc = nullptr;
// subclassing handle for tab
WNDPROC _hDefaultTabProc;
WNDPROC _hDefaultTabProc = nullptr;
// for moving and reordering
UINT _prevItem;
BOOL _beginDrag;
UINT _prevItem = 0;
BOOL _beginDrag = FALSE;
// Is tooltip
BOOL _bTabTTHover;
INT _iLastHovered;
BOOL _bTabTTHover = FALSE;
INT _iLastHovered = 0;
BOOL _bCaptionTT;
BOOL _bCapTTHover;
eMousePos _hoverMPos;
BOOL _bCaptionTT = FALSE;
BOOL _bCapTTHover = FALSE;
eMousePos _hoverMPos = posOutside;
int _captionHeightDynamic = HIGH_CAPTION;
int _captionGapDynamic = CAPTION_GAP;
int _closeButtonPosLeftDynamic = CLOSEBTN_POS_LEFT;
int _closeButtonPosTopDynamic = CLOSEBTN_POS_TOP;
int _closeButtonWidth;
int _closeButtonHeight;
int _closeButtonWidth = 12;
int _closeButtonHeight = 12;
// data of added windows
std::vector<tTbData *> _vTbData;
std::vector<tTbData *> _vTbData;
};

View File

@ -85,8 +85,8 @@ public :
private :
Window **_ppWindow = nullptr;
RECT _rcWork;
RECT _rect;
RECT _rcWork = { 0 };
RECT _rect = { 0 };
Window **_ppMainWindow = nullptr;
std::vector<HWND> _vImageList;
HIMAGELIST _hImageList = nullptr;
@ -94,8 +94,8 @@ private :
tDockMgr _dockData;
static BOOL _isRegistered;
BOOL _isInitialized = FALSE;
int _iContMap[CONT_MAP_MAX];
std::vector<DockingSplitter *> _vSplitter;
int _iContMap[CONT_MAP_MAX] = { 0 };
std::vector<DockingSplitter*> _vSplitter;
static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);

View File

@ -87,8 +87,8 @@ private :
HWND _viewZoneCanvas = nullptr;
WNDPROC _canvasDefaultProc = nullptr;
long _higherY;
long _lowerY;
long _higherY = 0;
long _lowerY = 0;
};
@ -141,8 +141,8 @@ protected:
bool needToRecomputeWith(const ScintillaEditView *editView = nullptr);
private:
ScintillaEditView **_ppEditView = nullptr;
ScintillaEditView *_pMapView = nullptr;
ScintillaEditView**_ppEditView = nullptr;
ScintillaEditView*_pMapView = nullptr;
ViewZoneDlg _vzDlg;
HWND _hwndScintilla;
bool _isTemporarilyShowing = false;

View File

@ -79,7 +79,7 @@ public:
private:
std::vector<FolderInfo> _subFolders;
std::vector<FileInfo> _files;
FolderInfo *_parent = nullptr;
FolderInfo*_parent = nullptr;
generic_string _name;
generic_string _rootPath; // set only for root folder; empty for normal folder
};
@ -99,7 +99,7 @@ public:
private:
FolderInfo _rootFolder;
FileBrowser *_pFileBrowser = nullptr;
FileBrowser*_pFileBrowser = nullptr;
HANDLE _watchThreadHandle = nullptr;
HANDLE _EventHandle = nullptr;
static DWORD WINAPI watching(void *param);

View File

@ -50,10 +50,7 @@ root
struct SearchParameters {
generic_string _text2Find;
bool _doSort;
SearchParameters(): _text2Find(TEXT("")), _doSort(false){
};
bool _doSort = false;
bool hasParams()const{
return (_text2Find != TEXT("") || _doSort);
@ -113,7 +110,7 @@ private:
SCROLLINFO si;
long _findLine = -1;
long _findEndLine = -1;
HTREEITEM _findItem;
HTREEITEM _findItem = nullptr;
generic_string _sortTipStr = TEXT("Sort");
generic_string _reloadTipStr = TEXT("Reload");
@ -126,7 +123,7 @@ private:
FunctionParsersManager _funcParserMgr;
std::vector< std::pair<int, int> > _skipZones;
std::vector<TreeParams> _treeParams;
HIMAGELIST _hTreeViewImaLst;
HIMAGELIST _hTreeViewImaLst = nullptr;
generic_string parseSubLevel(size_t begin, size_t end, std::vector< generic_string > dataToSearch, int & foundPos);
size_t getBodyClosePos(size_t begin, const TCHAR *bodyOpenSymbol, const TCHAR *bodyCloseSymbol);

View File

@ -97,8 +97,8 @@
#define BGM_SETHILIGHTCOLOR_PROTECT_NOFOCUS BABYGRID_USER + 50
struct _BGCELL {
int row;
int col;
int row = 0;
int col = 0;
};

View File

@ -88,11 +88,11 @@ private:
GFONT_ROWS,
MAX_GRID_FONTS
};
LONG _clientWidth;
LONG _clientHeight;
LONG _initClientWidth;
LONG _initClientHeight;
bool _dialogInitDone;
LONG _clientWidth = 0;
LONG _clientHeight = 0;
LONG _initClientWidth = 0;
LONG _initClientHeight = 0;
bool _dialogInitDone = false;
void initTabs();
void initBabyGrid();

View File

@ -84,12 +84,12 @@ struct PluginUpdateInfo
struct NppCurrentStatus
{
bool _isAdminMode; // can launch gitup en Admin mode directly
bool _isAdminMode = false; // can launch gitup en Admin mode directly
bool _isInProgramFiles; // true: install/update/remove on "Program files" (ADMIN MODE)
// false: install/update/remove on NPP_INST or install on %APPDATA%, update/remove on %APPDATA% & NPP_INST (NORMAL MODE)
bool _isInProgramFiles = true; // true: install/update/remove on "Program files" (ADMIN MODE)
// false: install/update/remove on NPP_INST or install on %APPDATA%, update/remove on %APPDATA% & NPP_INST (NORMAL MODE)
bool _isAppDataPluginsAllowed; // true: install on %APPDATA%, update / remove on %APPDATA% & "Program files" or NPP_INST
bool _isAppDataPluginsAllowed = false; // true: install on %APPDATA%, update / remove on %APPDATA% & "Program files" or NPP_INST
generic_string _nppInstallPath;
generic_string _appdataPath;

View File

@ -88,7 +88,7 @@ private :
struct LangID_Name
{
LangType _id;
LangType _id = L_TEXT;
generic_string _name;
LangID_Name(LangType id, const generic_string& name) : _id(id), _name(name){};
};
@ -224,7 +224,8 @@ public :
private :
POINT _singleLineModePoint, _multiLineModePoint;
RECT _closerRect, _closerLabelRect;
RECT _closerRect = { 0 };
RECT _closerLabelRect = { 0 };
HWND _tip = nullptr;
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -145,11 +145,11 @@ public:
unsigned int GetThreadId() { return m_dwThreadId; }
protected:
ReadDirectoryChangesPrivate::CReadChangesServer* m_pServer;
ReadDirectoryChangesPrivate::CReadChangesServer* m_pServer = nullptr;
HANDLE m_hThread;
HANDLE m_hThread = nullptr;
unsigned int m_dwThreadId;
unsigned int m_dwThreadId = 0;
CThreadSafeQueue<TDirectoryChangeNotification> m_Notifications;
};

View File

@ -75,12 +75,12 @@ protected:
LPOVERLAPPED lpOverlapped); // I/O information buffer
// Parameters from the caller for ReadDirectoryChangesW().
DWORD m_dwFilterFlags;
BOOL m_bIncludeChildren;
DWORD m_dwFilterFlags = 0;
BOOL m_bIncludeChildren = FALSE;
std::wstring m_wstrDirectory;
// Result of calling CreateFile().
HANDLE m_hDirectory;
HANDLE m_hDirectory = nullptr;
// Required parameter for ReadDirectoryChangesW().
OVERLAPPED m_Overlapped;
@ -130,7 +130,7 @@ public:
pRequest->m_pServer->AddDirectory(pRequest);
}
CReadDirectoryChanges* m_pBase;
CReadDirectoryChanges* m_pBase = nullptr;
volatile DWORD m_nOutstandingRequests;
@ -171,7 +171,7 @@ protected:
vector<CReadChangesRequest*> m_pBlocks;
bool m_bTerminate;
bool m_bTerminate = false;
};
}

View File

@ -21,9 +21,9 @@ public:
void Terminate();
private:
LPCTSTR _szFile;
DWORD _dwNotifyFilter;
WIN32_FILE_ATTRIBUTE_DATA _lastFileInfo;
LPCTSTR _szFile = nullptr;
DWORD _dwNotifyFilter = 0;
WIN32_FILE_ATTRIBUTE_DATA _lastFileInfo = { 0 };
};

View File

@ -79,6 +79,6 @@ public:
HANDLE GetWaitHandle() { return m_hEvent; }
protected:
HANDLE m_hEvent;
HANDLE m_hEvent = nullptr;
std::mutex m_mutex;
};

View File

@ -81,7 +81,8 @@ private:
static bool _isHorizontalFixedRegistered;
static bool _isVerticalFixedRegistered;
RECT _clickZone2TL, _clickZone2BR;
RECT _clickZone2TL = { 0 };
RECT _clickZone2BR = { 0 };
static LRESULT CALLBACK staticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);

View File

@ -23,16 +23,16 @@ enum class PosAlign { left, right, top, bottom };
struct DLGTEMPLATEEX
{
WORD dlgVer;
WORD signature;
DWORD helpID;
DWORD exStyle;
DWORD style;
WORD cDlgItems;
short x;
short y;
short cx;
short cy;
WORD dlgVer = 0;
WORD signature = 0;
DWORD helpID = 0;
DWORD exStyle = 0;
DWORD style = 0;
WORD cDlgItems = 0;
short x = 0;
short y = 0;
short cx = 0;
short cy = 0;
// The structure has more fields but are variable length
};
@ -68,7 +68,7 @@ public :
virtual void destroy() override;
protected:
RECT _rc;
RECT _rc = { 0 };
static INT_PTR CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0;

View File

@ -123,8 +123,8 @@ struct CloseButtonZone
bool isHit(int x, int y, const RECT & tabRect, bool isVertical) const;
RECT getButtonRectFrom(const RECT & tabRect, bool isVertical) const;
int _width;
int _height;
int _width = 0;
int _height = 0;
};

View File

@ -51,7 +51,7 @@ public:
protected:
WNDPROC _defaultProc;
WNDPROC _defaultProc = nullptr;
LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK staticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
@ -62,6 +62,6 @@ protected:
HFONT _hFontSelected = nullptr;
int _nbItem = 0;
int _currentIndex = 0;
RECT _rc;
RECT _rc = { 0 };
};

View File

@ -34,8 +34,8 @@ enum toolBarStatusType {TB_SMALL, TB_LARGE, TB_SMALL2, TB_LARGE2, TB_STANDARD};
struct iconLocator {
int listIndex;
int iconIndex;
int listIndex = 0;
int iconIndex = 0;
generic_string iconLocation;
iconLocator(int iList, int iIcon, const generic_string& iconLoc)

View File

@ -34,7 +34,7 @@ public:
bool isInTray() const {return _isIconShowed;};
private:
NOTIFYICONDATA _nid;
bool _isIconShowed;
NOTIFYICONDATA _nid;
bool _isIconShowed = false;
};

View File

@ -24,8 +24,8 @@
struct TreeStateNode {
generic_string _label;
generic_string _extraData;
bool _isExpanded;
bool _isSelected;
bool _isExpanded = false;
bool _isSelected = false;
std::vector<TreeStateNode> _children;
};
@ -118,7 +118,7 @@ public:
void customSorting(HTREEITEM hTreeItem, PFNTVCOMPARE sortingCallbackFunc, LPARAM lParam, bool isRecursive);
protected:
WNDPROC _defaultProc;
WNDPROC _defaultProc = nullptr;
LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK staticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
@ -129,8 +129,8 @@ protected:
bool searchLeafRecusivelyAndBuildTree(HTREEITEM tree2Build, const generic_string & text2Search, int index2Search, HTREEITEM tree2Search);
// Drag and Drop operations
HTREEITEM _draggedItem;
HIMAGELIST _draggedImageList;
HTREEITEM _draggedItem = nullptr;
HIMAGELIST _draggedImageList = nullptr;
bool _isItemDragged = false;
std::vector<int> _canNotDragOutList;
std::vector<int> _canNotDropInList;

View File

@ -24,9 +24,9 @@
#define FS_PROJECTPANELTITLE TEXT("Document List")
struct sortCompareData {
HWND hListView;
int columnIndex;
int sortDirection;
HWND hListView = nullptr;
int columnIndex = 0;
int sortDirection = 0;
};
class VerticalFileSwitcher : public DockingDlgInterface {

View File

@ -33,8 +33,8 @@ typedef Buffer * BufferID; //each buffer has unique ID by which it can be retrie
#define FS_CLMNPATH "ColumnPath"
struct SwitcherFileInfo {
BufferID _bufID;
int _iView;
BufferID _bufID = 0;
int _iView = 0;
SwitcherFileInfo() = delete;
SwitcherFileInfo(BufferID buf, int view) : _bufID(buf), _iView(view){};

View File

@ -34,11 +34,11 @@ typedef enum {
struct NMWINDLG : public NMHDR {
BOOL processed;
WinDlgNotifyType type;
UINT curSel;
UINT nItems;
UINT *Items;
BOOL processed = FALSE;
WinDlgNotifyType type = WDT_ACTIVATE;
UINT curSel = 0;
UINT nItems = 0;
UINT *Items = 0;
// ctor: initialize to zeroes
NMWINDLG() { memset(this,0,sizeof(NMWINDLG)); }
@ -83,8 +83,8 @@ protected :
HWND _hList = nullptr;
static RECT _lastKnownLocation;
SIZE _szMinButton;
SIZE _szMinListCtrl;
SIZE _szMinButton = { 0 };
SIZE _szMinListCtrl = { 0 };
DocTabView *_pTab = nullptr;
std::vector<int> _idxMap;
int _currentColumn = -1;

View File

@ -58,10 +58,10 @@ static size_t keyTranslate(size_t keyIn) {
};
struct KeyCombo {
bool _isCtrl;
bool _isAlt;
bool _isShift;
UCHAR _key;
bool _isCtrl = false;
bool _isAlt = false;
bool _isShift = false;
UCHAR _key = 0;
};
class Shortcut : public StaticDialog {
@ -175,9 +175,9 @@ public:
protected :
KeyCombo _keyCombo;
virtual INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
bool _canModifyName;
TCHAR _name[nameLenMax]; //normal name is plain text (for display purposes)
TCHAR _menuName[nameLenMax]; //menu name has ampersands for quick keys
bool _canModifyName = false;
TCHAR _name[nameLenMax] = {'\0'}; //normal name is plain text (for display purposes)
TCHAR _menuName[nameLenMax] = { '\0' }; //menu name has ampersands for quick keys
void updateConflictState(const bool endSession = false) const;
};