Index: src/ch/AppHelper.cpp =================================================================== diff -u -rf2eab440135dd8052881aa3e9af83ec85e9bf1bf -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision f2eab440135dd8052881aa3e9af83ec85e9bf1bf) +++ src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -264,13 +264,12 @@ { // check the current key value (to avoid irritating messages from some firewall software) HKEY hkeyRun = NULL; - LSTATUS lStatus = ERROR_SUCCESS; CString strValue; CString strKey; DWORD dwType = REG_SZ; DWORD dwCount = _MAX_PATH * sizeof(TCHAR); - lStatus = RegOpenKeyEx(HKEY_CURRENT_USER, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, KEY_QUERY_VALUE, &hkeyRun); + LSTATUS lStatus = RegOpenKeyEx(HKEY_CURRENT_USER, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, KEY_QUERY_VALUE, &hkeyRun); if(lStatus != ERROR_SUCCESS) return false; Index: src/ch/ClipboardMonitor.cpp =================================================================== diff -u -rba618764ec3c9221fa704e905a9f807bd85ed4c5 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision ba618764ec3c9221fa704e905a9f807bd85ed4c5) +++ src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -172,9 +172,7 @@ if (GetPropValue(GetConfig()) != 0) { CShutdownDlg dlg; - dlg.m_iOverallTime = GetPropValue(GetConfig()); - if (dlg.m_iOverallTime < 0) - dlg.m_iOverallTime=-dlg.m_iOverallTime; + dlg.SetOverallTime(GetPropValue(GetConfig())); bShutdown=(dlg.DoModal() != IDCANCEL); } Index: src/ch/ClipboardMonitor.h =================================================================== diff -u -r1d8d51e0dd4d8ebcf0bd457d01fab984585220c0 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/ClipboardMonitor.h (.../ClipboardMonitor.h) (revision 1d8d51e0dd4d8ebcf0bd457d01fab984585220c0) +++ src/ch/ClipboardMonitor.h (.../ClipboardMonitor.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -45,7 +45,7 @@ protected: static CClipboardMonitor S_ClipboardMonitor; - chcore::TTaskManager* m_pTasks; + chcore::TTaskManager* m_pTasks = nullptr; // thread control chcore::TWorkerThreadController m_threadWorker; Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -rcdc76e1a95383dff63a5254aeb8d37035028512c -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision cdc76e1a95383dff63a5254aeb8d37035028512c) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -43,15 +43,7 @@ CCustomCopyDlg::CCustomCopyDlg() : ictranslate::CLanguageDialog(CCustomCopyDlg::IDD) { - m_bOnlyCreate = FALSE; - m_bIgnoreFolders = FALSE; - m_bFilters = FALSE; - m_bAdvanced = FALSE; - m_bForceDirectories = FALSE; - GetConfig().ExtractSubConfig(BRANCH_TASK_SETTINGS, m_tTaskDefinition.GetConfiguration()); - - m_bActualisation = false; } CCustomCopyDlg::CCustomCopyDlg(const chcore::TTaskDefinition& rTaskDefinition) : @@ -906,11 +898,10 @@ { boost::shared_array spBuffer; - ulong_t ulSize = 0; - CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager().LoadString(IDS_FLTALLFILTER_STRING)); if(dlg.DoModal() == IDOK) { + unsigned long ulSize = 0; UINT uiCount=0; try { @@ -925,7 +916,7 @@ return; } - ulSize = boost::numeric_cast(llSize); + ulSize = boost::numeric_cast(llSize); spBuffer.reset(new BYTE[ulSize + 3]); // guarantee that we have null at the end of the string (3 bytes to compensate for possible odd number of bytes and for unicode) memset(spBuffer.get(), 0, ulSize + 3); Index: src/ch/CustomCopyDlg.h =================================================================== diff -u -rcdc76e1a95383dff63a5254aeb8d37035028512c -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/CustomCopyDlg.h (.../CustomCopyDlg.h) (revision cdc76e1a95383dff63a5254aeb8d37035028512c) +++ src/ch/CustomCopyDlg.h (.../CustomCopyDlg.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -30,7 +30,7 @@ // Construction public: CCustomCopyDlg(); // standard constructor - CCustomCopyDlg(const chcore::TTaskDefinition& rTaskDefinition); + explicit CCustomCopyDlg(const chcore::TTaskDefinition& rTaskDefinition); // Dialog Data enum { IDD = IDD_CUSTOM_COPY_DIALOG }; @@ -81,20 +81,21 @@ public: chcore::TTaskDefinition m_tTaskDefinition; std::vector m_vRecent; // recently selected paths - bool m_bActualisation; // is this dialog processing the combo text changing ? CComboBoxEx m_ctlDstPath; CListCtrl m_ctlFilters; CListBox m_ctlBufferSizes; CComboBox m_ctlOperation; CComboBox m_ctlPriority; CListCtrl m_ctlFiles; - BOOL m_bOnlyCreate; - BOOL m_bIgnoreFolders; - BOOL m_bForceDirectories; - BOOL m_bFilters; - BOOL m_bAdvanced; CImageList m_ilImages; + + bool m_bActualisation = false; // is this dialog processing the combo text changing ? + BOOL m_bOnlyCreate = FALSE; + BOOL m_bIgnoreFolders = FALSE; + BOOL m_bForceDirectories = FALSE; + BOOL m_bFilters = FALSE; + BOOL m_bAdvanced = FALSE; }; #endif Index: src/ch/DirTreeCtrl.cpp =================================================================== diff -u -rc435ab507c8b8280264188b49e9ada56d46c0261 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/DirTreeCtrl.cpp (.../DirTreeCtrl.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) +++ src/ch/DirTreeCtrl.cpp (.../DirTreeCtrl.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -780,10 +780,10 @@ strSrc.MakeUpper(); // find out the position of a nearest / lub '\\' - int iLen=strFnd.GetLength(), iPos; + int iLen=strFnd.GetLength(); if (strSrc.GetLength() >= iLen) { - iPos=strSrc.Mid(iLen).FindOneOf(_T("\\/")); + int iPos=strSrc.Mid(iLen).FindOneOf(_T("\\/")); if (iPos != -1) strSrc=strSrc.Left(iPos+iLen); Index: src/ch/DirTreeCtrl.h =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/DirTreeCtrl.h (.../DirTreeCtrl.h) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/DirTreeCtrl.h (.../DirTreeCtrl.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -130,7 +130,6 @@ // Generated message map functions protected: - bool RegisterWindowClass(); friend int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM/* lParamSort*/); //{{AFX_MSG(CDirTreeCtrl) @@ -151,17 +150,16 @@ protected: void InitControl(); HTREEITEM RegularSelect(HTREEITEM hStart, LPCTSTR lpszPath); -// HTREEITEM TraverseNetNode(HTREEITEM hItem, LPCTSTR lpszPath, LPTSTR lpszBuffer); bool ComparePaths(LPCTSTR lpszFull, LPCTSTR lpszPartial); -// bool SetRemotePath(LPCTSTR lpszPath); bool SetLocalPath(LPCTSTR lpszPath); HRESULT FillNode(HTREEITEM hParent, LPSHELLFOLDER lpsf, LPITEMIDLIST lpidl, bool bSilent=false); - bool m_bIgnoreShellDialogs; // ignore dialogs of type 'insert floppy disk' - HIMAGELIST m_hImageList; // system img list - HTREEITEM m_hDrives, m_hNetwork; // my computer's and net neighbourhood's handles - bool m_bIgnore; // ignore the nearest adding of items in OnItemexpanding - int m_iEditType; // type of item editing (0-doesn't exist (nothing for edit), 1-new folder) + bool m_bIgnoreShellDialogs = true; // ignore dialogs of type 'insert floppy disk' + HIMAGELIST m_hImageList = nullptr; // system img list + HTREEITEM m_hDrives = nullptr; + HTREEITEM m_hNetwork = nullptr; // my computer's and net neighbourhood's handles + bool m_bIgnore = false; // ignore the nearest adding of items in OnItemexpanding + int m_iEditType = 0; // type of item editing (0-doesn't exist (nothing for edit), 1-new folder) }; ///////////////////////////////////////////////////////////////////////////// Index: src/ch/FolderDialog.cpp =================================================================== diff -u -r8422e5787e56453d78c7270066c3e8d1743ca757 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision 8422e5787e56453d78c7270066c3e8d1743ca757) +++ src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -456,7 +456,7 @@ CShortcut sc; for(size_t stIndex = 0; stIndex < m_bdData.cvShortcuts.size(); ++stIndex) { - sc = CString(m_bdData.cvShortcuts.at(stIndex)); + sc = CShortcut(m_bdData.cvShortcuts.at(stIndex)); sfi.iIcon = -1; SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); m_ctlShortcuts.InsertItem(boost::numeric_cast(stIndex), sc.m_strName, sfi.iIcon); @@ -692,7 +692,7 @@ if (pit->iItem < 0 || pit->iItem >= boost::numeric_cast(m_bdData.cvShortcuts.size())) return; // out of range - CShortcut sc=CString(m_bdData.cvShortcuts.at(pit->iItem)); + CShortcut sc=CShortcut(m_bdData.cvShortcuts.at(pit->iItem)); m_strTip=sc.m_strName+_T("\r\n")+CString(GetResManager().LoadString(IDS_BDPATH2_STRING))+sc.m_strPath; // get disk free space @@ -827,7 +827,7 @@ // current selection if (plv->iItem >= 0 && plv->iItem < boost::numeric_cast(m_bdData.cvShortcuts.size())) { - CShortcut sc=CString(m_bdData.cvShortcuts.at(plv->iItem)); + CShortcut sc=CShortcut(m_bdData.cvShortcuts.at(plv->iItem)); m_ctlTree.SetPath(sc.m_strPath); SetComboPath(sc.m_strPath); } @@ -915,7 +915,7 @@ } // std editing - success - CShortcut sc=CString(m_bdData.cvShortcuts.at(pdi->item.iItem)); + CShortcut sc=CShortcut(m_bdData.cvShortcuts.at(pdi->item.iItem)); sc.m_strName=pdi->item.pszText; m_bdData.cvShortcuts[pdi->item.iItem] = (CString)sc; Index: src/ch/FolderDialog.h =================================================================== diff -u -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/FolderDialog.h (.../FolderDialog.h) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) +++ src/ch/FolderDialog.h (.../FolderDialog.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -44,7 +44,7 @@ { // Construction public: - CFolderDialog(CWnd* pParent = NULL); // standard constructor + explicit CFolderDialog(CWnd* pParent = NULL); // standard constructor virtual ~CFolderDialog(); // Dialog Data @@ -66,20 +66,16 @@ // structure used for passing parameters struct BROWSEDATA { - BROWSEDATA() { cx=0; cy=0; iView=2; bExtended=false; }; -// BROWSEDATA& operator=(const BROWSEDATA& data) { strCaption=data.strCaption; strText=data.strText; strInitialDir=data.strInitialDir; astrRecent.Copy(data.astrRecent); -// ascShortcuts.Copy(data.ascShortcuts); cx=data.cx; cy=data.cy; iView=data.iView; bExtended=data.bExtended; return *this;}; - CString strCaption; CString strText; CString strInitialDir; std::vector cvRecent; std::vector cvShortcuts; - int cx, cy; // pixels - int iView; // type of view (large icons, small icons, ...) - bool bExtended; // with the shortcuts or not - bool bIgnoreDialogs; // if tree ctrl should show shell dialogs in style 'insert floppy' + int cx = 0, cy = 0; // pixels + int iView = 2; // type of view (large icons, small icons, ...) + bool bExtended = false; // with the shortcuts or not + bool bIgnoreDialogs = true; // if tree ctrl should show shell dialogs in style 'insert floppy' } m_bdData; // getting path - after dialog exits Index: src/ch/OptionsDlg.cpp =================================================================== diff -u -r50ad2dc9f0b42ba432bb54e4a042582277410773 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision 50ad2dc9f0b42ba432bb54e4a042582277410773) +++ src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -40,23 +40,16 @@ COptionsDlg::COptionsDlg(CWnd* pParent /*=NULL*/) :ictranslate::CLanguageDialog(COptionsDlg::IDD, pParent, &m_bLock) { - //{{AFX_DATA_INIT(COptionsDlg) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT } void COptionsDlg::DoDataExchange(CDataExchange* pDX) { CLanguageDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(COptionsDlg) DDX_Control(pDX, IDC_PROPERTIES_LIST, m_ctlProperties); - //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(COptionsDlg,ictranslate::CLanguageDialog) - //{{AFX_MSG_MAP(COptionsDlg) ON_BN_CLICKED(IDC_APPLY_BUTTON, OnApplyButton) - //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// @@ -237,7 +230,7 @@ // lang CString strLangs; size_t stIndex=0; - for (vector::iterator it=m_vld.begin();it != m_vld.end();it++) + for (vector::iterator it=m_vld.begin();it != m_vld.end();++it) { strLangs+=(*it).GetLangName(); strLangs+=_T("!"); Index: src/ch/OptionsDlg.h =================================================================== diff -u -r9ea1e103b5fa4ddfebf8028f121ce16e917eec04 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/OptionsDlg.h (.../OptionsDlg.h) (revision 9ea1e103b5fa4ddfebf8028f121ce16e917eec04) +++ src/ch/OptionsDlg.h (.../OptionsDlg.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -28,43 +28,36 @@ class COptionsDlg : public ictranslate::CLanguageDialog { -// Construction public: - void SendClosingNotify(); - COptionsDlg(CWnd* pParent = NULL); // standard constructor + enum { IDD = IDD_OPTIONS_DIALOG }; +public: + explicit COptionsDlg(CWnd* pParent = NULL); // standard constructor + virtual void OnLanguageChanged(); + void SendClosingNotify(); + + friend void CustomPropertyCallbackProc(LPVOID lpParam, int iParam, CPtrList* pList, int iIndex); + friend void ShortcutsPropertyCallbackProc(LPVOID lpParam, int iParam, CPtrList* pList, int iIndex); + friend void RecentPropertyCallbackProc(LPVOID lpParam, int iParam, CPtrList* pList, int iIndex); + +public: static bool m_bLock; // locker std::vector m_cvRecent; std::vector m_cvShortcuts; // for languages vector m_vld; - TCHAR m_szLangPath[_MAX_PATH]; // the full path to a folder with langs (@read) + TCHAR m_szLangPath[ _MAX_PATH ]; // the full path to a folder with langs (@read) - friend void CustomPropertyCallbackProc(LPVOID lpParam, int iParam, CPtrList* pList, int iIndex); - friend void ShortcutsPropertyCallbackProc(LPVOID lpParam, int iParam, CPtrList* pList, int iIndex); - friend void RecentPropertyCallbackProc(LPVOID lpParam, int iParam, CPtrList* pList, int iIndex); - -// Dialog Data - //{{AFX_DATA(COptionsDlg) - enum { IDD = IDD_OPTIONS_DIALOG }; CPropertyListCtrl m_ctlProperties; - //}}AFX_DATA - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(COptionsDlg) - public: - protected: +protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL -// Implementation -protected: +private: void FillPropertyList(); void ApplyProperties(); @@ -74,18 +67,18 @@ bool GetBoolProp(int iPosition); CString MakeCompoundString(UINT uiBase, int iCount, LPCTSTR lpszSeparator); - TCHAR m_szBuffer[_MAX_PATH]; // for macro use - CString m_strTemp; - int m_iSel; - // Generated message map functions - //{{AFX_MSG(COptionsDlg) virtual BOOL OnInitDialog(); virtual void OnOK(); virtual void OnCancel(); afx_msg void OnApplyButton(); - //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +private: + TCHAR m_szBuffer[ _MAX_PATH ]; // for macro use + CString m_strTemp; + int m_iSel = 0; }; //{{AFX_INSERT_LOCATION}} Index: src/ch/PropertyListCtrl.cpp =================================================================== diff -u -rcca9305ba5a3910164a8cdd24fe3f63cd8089883 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision cca9305ba5a3910164a8cdd24fe3f63cd8089883) +++ src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -39,13 +39,10 @@ // Delete the objects created delete m_pBkBrush; delete m_pBlackBrush; -// delete m_pGrayPen; delete m_pBkPen; } BEGIN_MESSAGE_MAP(CComboButton, CButton) - //{{AFX_MSG_MAP(CComboButton) - //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// @@ -55,7 +52,6 @@ // Create the Brushes and Pens m_pBkBrush = new CBrush( GetSysColor(COLOR_BTNFACE)); m_pBkPen = new CPen( PS_SOLID, 1, GetSysColor(COLOR_BTNFACE)); - // m_pGrayPen = new CPen( PS_SOLID, 1, RGB(128,128,128)); m_pBlackBrush = new CBrush(GetSysColor(COLOR_BTNTEXT)); // Create the CButton @@ -127,29 +123,6 @@ // CPropertyListCtrl CPropertyListCtrl::CPropertyListCtrl() { - m_nWidestItem = 0; - m_bDeleteFont = TRUE; - m_bBoldSelection = TRUE; - - m_pBkBrush = NULL; - m_pBkPropertyBrush = NULL; - m_pEditWnd = NULL; - m_pFontButton = NULL; - m_pPathButton = NULL; - m_pDirButton=NULL; - m_pCustomButton=NULL; - m_pComboButton = NULL; - m_pListBox = NULL; - m_pBkHighlightBrush = NULL; - m_pSelectedFont = NULL; - m_pBorderPen = NULL; - m_pCurItem = NULL; - m_pCurFont = NULL; - m_pCurDrawItem = NULL; - m_pTextFont = NULL; - m_pSelectedFont = NULL; - m_pBorderPen = NULL; - m_crBorderColor = RGB(192,192,192); m_crBkColor = GetSysColor(COLOR_WINDOW); m_crPropertyBkColor = m_crBkColor; Index: src/ch/PropertyListCtrl.h =================================================================== diff -u -r449a5b399ab21ca0d06050b47b264f2f704af966 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/PropertyListCtrl.h (.../PropertyListCtrl.h) (revision 449a5b399ab21ca0d06050b47b264f2f704af966) +++ src/ch/PropertyListCtrl.h (.../PropertyListCtrl.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -57,84 +57,70 @@ // CComboButton window class CComboButton : public CButton { - void DrawTriangle(CDC* pDC, CRect Rect); - // Construction public: - BOOL Create( CRect Rect, CWnd* pParent, UINT uID); CComboButton(); + virtual ~CComboButton(); -// Attributes -public: - CPen* m_pBkPen; -// CPen* m_pGrayPen; - CBrush* m_pBkBrush; - CBrush* m_pBlackBrush; + BOOL Create(CRect Rect, CWnd* pParent, UINT uID); -// Operations -public: +private: + void DrawTriangle(CDC* pDC, CRect Rect); +public: virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct ); virtual void MeasureItem(LPMEASUREITEMSTRUCT /*lpMeasureItemStruct*/); -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CComboButton) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CComboButton(); - - // Generated message map functions protected: - //{{AFX_MSG(CComboButton) - //}}AFX_MSG - DECLARE_MESSAGE_MAP() + +private: + CPen* m_pBkPen = nullptr; + CBrush* m_pBkBrush = nullptr; + CBrush* m_pBlackBrush = nullptr; }; ///////////////////////////////////////////////////////////////////////////// // CPropertyListCtrl window class CPropertyListCtrl : public CListBox { - int m_nWidestItem; - BOOL m_bDeleteFont; - BOOL m_bBoldSelection; - BOOL m_bChanged; - CPen* m_pBorderPen; + int m_nWidestItem = 0; + BOOL m_bDeleteFont = TRUE; + BOOL m_bBoldSelection = TRUE; + BOOL m_bChanged = FALSE; + CPen* m_pBorderPen = nullptr; CRect m_CurRect; - CFont* m_pTextFont; - CFont* m_pSelectedFont; - CFont* m_pCurFont; + CFont* m_pTextFont = nullptr; + CFont* m_pSelectedFont = nullptr; + CFont* m_pCurFont = nullptr; CString m_csText; - CBrush* m_pCurBrush; - CBrush* m_pBkBrush; - CBrush* m_pBkHighlightBrush; - CBrush* m_pBkPropertyBrush; - CButton* m_pFontButton; - CButton* m_pPathButton; - CButton* m_pDirButton; - CButton* m_pCustomButton; - CComboButton* m_pComboButton; - CListBox* m_pListBox; + CBrush* m_pCurBrush = nullptr; + CBrush* m_pBkBrush = nullptr; + CBrush* m_pBkHighlightBrush = nullptr; + CBrush* m_pBkPropertyBrush = nullptr; + CButton* m_pFontButton = nullptr; + CButton* m_pPathButton = nullptr; + CButton* m_pDirButton = nullptr; + CButton* m_pCustomButton = nullptr; + CComboButton* m_pComboButton = nullptr; + CListBox* m_pListBox = nullptr; - COLORREF m_crBorderColor; - COLORREF m_crBkColor; - COLORREF m_crTextColor; - COLORREF m_crTextHighlightColor; - COLORREF m_crHighlightColor; - COLORREF m_crPropertyBkColor; - COLORREF m_crPropertyTextColor; + COLORREF m_crBorderColor = 0; + COLORREF m_crBkColor = 0; + COLORREF m_crTextColor = 0; + COLORREF m_crTextHighlightColor = 0; + COLORREF m_crHighlightColor = 0; + COLORREF m_crPropertyBkColor = 0; + COLORREF m_crPropertyTextColor = 0; // Controls - CEdit* m_pEditWnd; + CEdit* m_pEditWnd = nullptr; // The item list CPtrList m_Items; - PROPERTYITEM* m_pCurItem; - PROPERTYITEM* m_pCurDrawItem; + PROPERTYITEM* m_pCurItem = nullptr; + PROPERTYITEM* m_pCurDrawItem = nullptr; // Construction public: Index: src/ch/RecentDlg.h =================================================================== diff -u -r9ea1e103b5fa4ddfebf8028f121ce16e917eec04 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/RecentDlg.h (.../RecentDlg.h) (revision 9ea1e103b5fa4ddfebf8028f121ce16e917eec04) +++ src/ch/RecentDlg.h (.../RecentDlg.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -26,7 +26,7 @@ { // Construction public: - CRecentDlg(CWnd* pParent = NULL); // standard constructor + explicit CRecentDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CRecentDlg) Index: src/ch/ShortcutsDlg.cpp =================================================================== diff -u -r9ea1e103b5fa4ddfebf8028f121ce16e917eec04 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/ShortcutsDlg.cpp (.../ShortcutsDlg.cpp) (revision 9ea1e103b5fa4ddfebf8028f121ce16e917eec04) +++ src/ch/ShortcutsDlg.cpp (.../ShortcutsDlg.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -31,17 +31,11 @@ ///////////////////////////////////////////////////////////////////////////// // CShortcutsDlg dialog - CShortcutsDlg::CShortcutsDlg(CWnd* pParent /*=NULL*/) :ictranslate::CLanguageDialog(CShortcutsDlg::IDD, pParent) { - //{{AFX_DATA_INIT(CShortcutsDlg) - m_strName = _T(""); - //}}AFX_DATA_INIT - m_bActualisation=false; } - void CShortcutsDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); @@ -52,7 +46,6 @@ //}}AFX_DATA_MAP } - BEGIN_MESSAGE_MAP(CShortcutsDlg,ictranslate::CLanguageDialog) //{{AFX_MSG_MAP(CShortcutsDlg) ON_NOTIFY(LVN_ITEMCHANGED, IDC_SHORTCUT_LIST, OnItemchangedShortcutList) @@ -139,7 +132,7 @@ CShortcut sc; for(size_t stIndex = 0; stIndex < m_cvShortcuts.size(); ++stIndex) { - sc = CString(m_cvShortcuts.at(stIndex)); + sc = CShortcut(m_cvShortcuts.at(stIndex)); sfi.iIcon = -1; SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); m_ctlShortcuts.InsertItem(boost::numeric_cast(stIndex), sc.m_strName, sfi.iIcon); @@ -307,12 +300,11 @@ void CShortcutsDlg::OnUpButton() { POSITION pos=m_ctlShortcuts.GetFirstSelectedItemPosition(); - int iPos=-1; CShortcut sc; while (pos) { // get current selected item - iPos=m_ctlShortcuts.GetNextSelectedItem(pos); + int iPos=m_ctlShortcuts.GetNextSelectedItem(pos); // if the first element is trying to go up to nowhere if (iPos == 0) @@ -328,13 +320,13 @@ SHFILEINFO sfi; sfi.iIcon=-1; - sc=CString(m_cvShortcuts.at(iPos-1)); + sc=CShortcut(m_cvShortcuts.at(iPos-1)); SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); m_ctlShortcuts.SetItem(iPos-1, -1, LVIF_TEXT | LVIF_IMAGE , sc.m_strName, sfi.iIcon, 0, 0, 0); m_ctlShortcuts.SetItem(iPos-1, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); sfi.iIcon=-1; - sc=CString(m_cvShortcuts.at(iPos)); + sc=CShortcut(m_cvShortcuts.at(iPos)); SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); m_ctlShortcuts.SetItem(iPos, -1, LVIF_TEXT | LVIF_IMAGE, sc.m_strName, sfi.iIcon, 0, 0, 0); m_ctlShortcuts.SetItem(iPos, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); @@ -347,12 +339,10 @@ void CShortcutsDlg::OnDownButton() { POSITION pos=m_ctlShortcuts.GetFirstSelectedItemPosition(); - int iPos=-1; - CShortcut sc; while (pos) { // get current selected item - iPos=m_ctlShortcuts.GetNextSelectedItem(pos); + int iPos=m_ctlShortcuts.GetNextSelectedItem(pos); // if the last element is trying to go down to nowhere if (iPos == m_ctlShortcuts.GetItemCount()-1) @@ -368,13 +358,13 @@ SHFILEINFO sfi; sfi.iIcon=-1; - sc=CString(m_cvShortcuts.at(iPos)); + CShortcut sc=CShortcut(m_cvShortcuts.at(iPos)); SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); m_ctlShortcuts.SetItem(iPos, -1, LVIF_TEXT | LVIF_IMAGE , sc.m_strName, sfi.iIcon, 0, 0, 0); m_ctlShortcuts.SetItem(iPos, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); sfi.iIcon=-1; - sc=CString(m_cvShortcuts.at(iPos+1)); + sc=CShortcut(m_cvShortcuts.at(iPos+1)); SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); m_ctlShortcuts.SetItem(iPos+1, -1, LVIF_TEXT | LVIF_IMAGE, sc.m_strName, sfi.iIcon, 0, 0, 0); m_ctlShortcuts.SetItem(iPos+1, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); Index: src/ch/ShutdownDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/ShutdownDlg.cpp (.../ShutdownDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/ShutdownDlg.cpp (.../ShutdownDlg.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -31,24 +31,18 @@ CShutdownDlg::CShutdownDlg() - :ictranslate::CLanguageDialog(CShutdownDlg::IDD) + :ictranslate::CLanguageDialog(IDD_SHUTDOWN_DIALOG) { - //{{AFX_DATA_INIT(CShutdownDlg) - m_strTime = _T(""); - //}}AFX_DATA_INIT } - void CShutdownDlg::DoDataExchange(CDataExchange* pDX) { CLanguageDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CShutdownDlg) + DDX_Control(pDX, IDC_TIME_PROGRESS, m_ctlProgress); DDX_Text(pDX, IDC_TIME_STATIC, m_strTime); - //}}AFX_DATA_MAP } - BEGIN_MESSAGE_MAP(CShutdownDlg,ictranslate::CLanguageDialog) //{{AFX_MSG_MAP(CShutdownDlg) ON_WM_TIMER() @@ -98,3 +92,8 @@ { pstrData->Format(_T("%lu s."), iTime/1000); } + +void CShutdownDlg::SetOverallTime(int iTotalSeconds) +{ + m_iOverallTime = abs(iTotalSeconds); +} Index: src/ch/ShutdownDlg.h =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/ShutdownDlg.h (.../ShutdownDlg.h) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/ShutdownDlg.h (.../ShutdownDlg.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -24,41 +24,26 @@ class CShutdownDlg : public ictranslate::CLanguageDialog { -// Construction public: CShutdownDlg(); // standard constructor - int m_iOverallTime; + void SetOverallTime(int iTotalSeconds); -// Dialog Data - //{{AFX_DATA(CShutdownDlg) - enum { IDD = IDD_SHUTDOWN_DIALOG }; - CProgressCtrl m_ctlProgress; - CString m_strTime; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CShutdownDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: +private: void FormatTimeString(int iTime, CString* pstrData); - int m_iTime; // czas w sekundach - // Generated message map functions - //{{AFX_MSG(CShutdownDlg) virtual BOOL OnInitDialog(); + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + afx_msg void OnTimer(UINT_PTR nIDEvent); - //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +private: + int m_iOverallTime = 0; + int m_iTime = 0; // time in seconds + CProgressCtrl m_ctlProgress; + CString m_strTime; }; -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - #endif Index: src/ch/StaticEx.cpp =================================================================== diff -u -r7972b0944e0a947144fbdb93262f7d73ac528dc7 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/StaticEx.cpp (.../StaticEx.cpp) (revision 7972b0944e0a947144fbdb93262f7d73ac528dc7) +++ src/ch/StaticEx.cpp (.../StaticEx.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -159,7 +159,6 @@ case WM_ERASEBKGND: { return (LRESULT)FALSE; - break; } case WM_PAINT: { @@ -181,9 +180,9 @@ ::GetClientRect(hwnd, &rcCtl); // draw text - DWORD dwFlags=DT_LEFT | DT_VCENTER | (::GetWindowLong(hwnd, GWL_STYLE) & SES_PATHELLIPSIS ? DT_PATH_ELLIPSIS : 0) - | (::GetWindowLong(hwnd, GWL_STYLE) & SES_ELLIPSIS ? DT_END_ELLIPSIS : 0) - | (::GetWindowLong(hwnd, GWL_STYLE) & SES_WORDBREAK ? DT_WORDBREAK : 0); + DWORD dwFlags=DT_LEFT | DT_VCENTER | ((::GetWindowLong(hwnd, GWL_STYLE) & SES_PATHELLIPSIS) ? DT_PATH_ELLIPSIS : 0) + | ((::GetWindowLong(hwnd, GWL_STYLE) & SES_ELLIPSIS) ? DT_END_ELLIPSIS : 0) + | ((::GetWindowLong(hwnd, GWL_STYLE) & SES_WORDBREAK) ? DT_WORDBREAK : 0); pSettings->rcText=rcCtl; if (::GetWindowLong(hwnd, GWL_STYLE) & SES_LINK) @@ -319,7 +318,6 @@ _tcscpy((PTSTR)lParam, _T("")); return (LRESULT)TRUE; - break; } } Index: src/ch/UpdateResponse.cpp =================================================================== diff -u -r1f27a2022090cf7aaf827a3f1ad90d6fe0038518 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/UpdateResponse.cpp (.../UpdateResponse.cpp) (revision 1f27a2022090cf7aaf827a3f1ad90d6fe0038518) +++ src/ch/UpdateResponse.cpp (.../UpdateResponse.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -36,11 +36,6 @@ wiptree pt; read_xml(wssData, pt); - // traverse pt - std::wstring wstrVersion; - std::wstring wstrReleaseDate; - std::wstring wstrReleaseNotes; - // add version information; note that assumption here that we receive version informations // sorted by stability (decreasing) - that way we only present the user suggestions to download // newest versions with highest stability Index: src/ch/UpdateResponse.h =================================================================== diff -u -r50ad2dc9f0b42ba432bb54e4a042582277410773 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/UpdateResponse.h (.../UpdateResponse.h) (revision 50ad2dc9f0b42ba432bb54e4a042582277410773) +++ src/ch/UpdateResponse.h (.../UpdateResponse.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -25,7 +25,7 @@ class UpdateResponse { public: - UpdateResponse(std::stringstream& tDataStream); + explicit UpdateResponse(std::stringstream& tDataStream); UpdateMultipleVersionInfo& GetVersions(); Index: src/ch/UpdaterDlg.cpp =================================================================== diff -u -r1f27a2022090cf7aaf827a3f1ad90d6fe0038518 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision 1f27a2022090cf7aaf827a3f1ad90d6fe0038518) +++ src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -102,10 +102,10 @@ CUpdateChecker::ECheckResult eResult = m_ucChecker.GetResult(); CString strFmt; EBkModeResult eBkMode = eRes_None; - bool bEnableButton = false; if(eResult != m_eLastState) { + bool bEnableButton = false; m_eLastState = eResult; switch(eResult) Index: src/ch/ch.cpp =================================================================== diff -u -r7972b0944e0a947144fbdb93262f7d73ac528dc7 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/ch.cpp (.../ch.cpp) (revision 7972b0944e0a947144fbdb93262f7d73ac528dc7) +++ src/ch/ch.cpp (.../ch.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -182,7 +182,7 @@ _T("32") #endif ); - szPath[_MAX_PATH - 1] = _T('\0'); + szName[_MAX_PATH - 1] = _T('\0'); // Step 2 - create the crash dump in case anything happens later bool bResult = false; Index: src/ch/shortcuts.h =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/shortcuts.h (.../shortcuts.h) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/shortcuts.h (.../shortcuts.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -23,7 +23,7 @@ { public: CShortcut() { }; - CShortcut(const CString& strText); + explicit CShortcut(const CString& strText); operator CString(); bool FromString(const CString& strText); Index: src/ch/shortcutsdlg.h =================================================================== diff -u -r9ea1e103b5fa4ddfebf8028f121ce16e917eec04 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/shortcutsdlg.h (.../shortcutsdlg.h) (revision 9ea1e103b5fa4ddfebf8028f121ce16e917eec04) +++ src/ch/shortcutsdlg.h (.../shortcutsdlg.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -24,38 +24,21 @@ class CShortcutsDlg : public ictranslate::CLanguageDialog { -// Construction public: - CShortcutsDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CShortcutsDlg) enum { IDD = IDD_SHORTCUTEDIT_DIALOG }; - CComboBoxEx m_ctlPath; - CListCtrl m_ctlShortcuts; - CString m_strName; - //}}AFX_DATA +// Construction +public: + explicit CShortcutsDlg(CWnd* pParent = NULL); // standard constructor -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CShortcutsDlg) - protected: +protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL -// Implementation -public: - const std::vector *m_pcvRecent; // one way only - std::vector m_cvShortcuts; // two-way - shortcuts are being returned through this member protected: void UpdateComboIcon(); void SetComboPath(LPCTSTR lpszPath); - HIMAGELIST m_himl, m_hliml; - bool m_bActualisation; // Generated message map functions - //{{AFX_MSG(CShortcutsDlg) virtual BOOL OnInitDialog(); afx_msg void OnItemchangedShortcutList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnEditchangePathComboboxex(); @@ -65,11 +48,20 @@ afx_msg void OnBrowseButton(); afx_msg void OnUpButton(); afx_msg void OnDownButton(); - //}}AFX_MSG + DECLARE_MESSAGE_MAP() -}; -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. +public: + const std::vector *m_pcvRecent = nullptr; // one way only + std::vector m_cvShortcuts; // two-way - shortcuts are being returned through this member +private: + HIMAGELIST m_himl = nullptr; + HIMAGELIST m_hliml = nullptr; + bool m_bActualisation = false; + CComboBoxEx m_ctlPath; + CListCtrl m_ctlShortcuts; + CString m_strName; +}; + #endif Index: src/common/TShellExtMenuConfig.h =================================================================== diff -u -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/common/TShellExtMenuConfig.h (.../TShellExtMenuConfig.h) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) +++ src/common/TShellExtMenuConfig.h (.../TShellExtMenuConfig.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -75,7 +75,7 @@ public: TSourcePathsInfo(); - TSourcePathsInfo(ESrcPathsSource eSrcPathSource); + explicit TSourcePathsInfo(ESrcPathsSource eSrcPathSource); void SetSourcePathsInfo(ESrcPathsSource eSrcPathSource); ESrcPathsSource GetSrcPathsSource() const; Index: src/ictranslate/ICTranslateDlg.h =================================================================== diff -u -r74c148250c5cc577b740e702ae8ebdceaa59f11c -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ictranslate/ICTranslateDlg.h (.../ICTranslateDlg.h) (revision 74c148250c5cc577b740e702ae8ebdceaa59f11c) +++ src/ictranslate/ICTranslateDlg.h (.../ICTranslateDlg.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -27,7 +27,7 @@ { // Construction public: - CICTranslateDlg(CWnd* pParent = NULL); // standard constructor + explicit CICTranslateDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data enum { IDD = IDD_ICTRANSLATE_DIALOG }; Index: src/libchcore/ConfigNode.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/ConfigNode.cpp (.../ConfigNode.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/ConfigNode.cpp (.../ConfigNode.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -36,9 +36,9 @@ m_oidObjectID(rSrc.m_oidObjectID), m_iOrder(m_setModifications, rSrc.m_iOrder), m_strNodeName(m_setModifications, rSrc.m_strNodeName), - m_strValue(m_setModifications, rSrc.m_strValue) + m_strValue(m_setModifications, rSrc.m_strValue), + m_setModifications(rSrc.m_setModifications) { - m_setModifications = rSrc.m_setModifications; } ConfigNode& ConfigNode::operator=(const ConfigNode& rSrc) Index: src/libchcore/ConfigNodeContainer.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -151,8 +151,6 @@ bool ConfigNodeContainer::SetArrayValue(PCTSTR pszPropName, const TStringArray& rValue) { - bool bResult = false; - boost::unique_lock lock(m_lock); std::pair pairFnd @@ -179,7 +177,6 @@ // update existing item ChangeOrderAndValue tChange(rValue.GetAt(stIndex), boost::numeric_cast(stIndex)); m_mic.modify(pairFnd.first, tChange); - bResult |= tChange.WasModified(); ++pairFnd.first; } Index: src/libchcore/ConfigNodeContainer.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/ConfigNodeContainer.h (.../ConfigNodeContainer.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/ConfigNodeContainer.h (.../ConfigNodeContainer.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -44,15 +44,15 @@ { struct ChangeValue { - ChangeValue(const TString& strNewValue); + explicit ChangeValue(const TString& strNewValue); void operator()(ConfigNode& rNode); bool WasModified() const; private: TString m_strNewValue; - bool m_bWasModified; + bool m_bWasModified = false; }; struct ChangeOrderAndValue @@ -65,8 +65,8 @@ private: TString m_strNewValue; - int m_iOrder; - bool m_bWasModified; + int m_iOrder = 0; + bool m_bWasModified = false; }; struct ConfigNodeContainer Index: src/libchcore/TAutoHandles.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TAutoHandles.h (.../TAutoHandles.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TAutoHandles.h (.../TAutoHandles.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -49,7 +49,7 @@ /// @brief Constructs the TAutoFileHandle object with specified handle. /// @param[in] hHandle - System handle to be managed by this class. // ============================================================================ - TAutoFileHandle(HANDLE hHandle) : + explicit TAutoFileHandle(HANDLE hHandle) : m_hHandle(hHandle) { } Index: src/libchcore/TBasePathData.cpp =================================================================== diff -u -rbd349309a6dcd25f8d6dc3348a9dc1c95ac4cc6c -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TBasePathData.cpp (.../TBasePathData.cpp) (revision bd349309a6dcd25f8d6dc3348a9dc1c95ac4cc6c) +++ src/libchcore/TBasePathData.cpp (.../TBasePathData.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -48,9 +48,9 @@ m_oidObjectID(rEntry.m_oidObjectID), m_pathSrc(m_setModifications, rEntry.m_pathSrc), m_pathDst(m_setModifications, rEntry.m_pathDst), - m_bSkipFurtherProcessing(m_setModifications, rEntry.m_bSkipFurtherProcessing) + m_bSkipFurtherProcessing(m_setModifications, rEntry.m_bSkipFurtherProcessing), + m_setModifications(rEntry.m_setModifications) { - m_setModifications = rEntry.m_setModifications; } TBasePathData::TBasePathData(object_id_t oidObjectID, const TSmartPath& spSrcPath) : Index: src/libchcore/TFakeFileSerializer.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TFakeFileSerializer.h (.../TFakeFileSerializer.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TFakeFileSerializer.h (.../TFakeFileSerializer.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -27,7 +27,7 @@ class LIBCHCORE_API TFakeFileSerializer : public ISerializer { public: - TFakeFileSerializer(const TSmartPath& rPath); + explicit TFakeFileSerializer(const TSmartPath& rPath); virtual ~TFakeFileSerializer(); TFakeFileSerializer(const TFakeFileSerializer& rSrc) = delete; Index: src/libchcore/TFileFiltersArray.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TFileFiltersArray.cpp (.../TFileFiltersArray.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TFileFiltersArray.cpp (.../TFileFiltersArray.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -48,7 +48,7 @@ return true; // if only one of the filters matches - return true - for (std::vector::const_iterator iterFilter = m_vFilters.begin(); iterFilter != m_vFilters.end(); iterFilter++) + for (std::vector::const_iterator iterFilter = m_vFilters.begin(); iterFilter != m_vFilters.end(); ++iterFilter) { if ((*iterFilter).Match(spInfo)) return true; Index: src/libchcore/TFileInfo.cpp =================================================================== diff -u -r27c262eb9cae55720e10f4886af6b5a82cb94fe9 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TFileInfo.cpp (.../TFileInfo.cpp) (revision 27c262eb9cae55720e10f4886af6b5a82cb94fe9) +++ src/libchcore/TFileInfo.cpp (.../TFileInfo.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -54,9 +54,9 @@ m_ftLastAccess(m_setModifications, rSrc.m_ftLastAccess), m_ftLastWrite(m_setModifications, rSrc.m_ftLastWrite), m_uiFlags(m_setModifications, rSrc.m_uiFlags), - m_oidObjectID(rSrc.m_oidObjectID) + m_oidObjectID(rSrc.m_oidObjectID), + m_setModifications(rSrc.m_setModifications) { - m_setModifications = rSrc.m_setModifications; } TFileInfo::TFileInfo(const TBasePathDataPtr& spBasePathData, const TSmartPath& rpathFile, DWORD dwAttributes, ULONGLONG uhFileSize, FILETIME ftCreation, FILETIME ftLastAccess, FILETIME ftLastWrite, uint_t uiFlags) : Index: src/libchcore/TFilesystemFeedbackWrapper.cpp =================================================================== diff -u -rd3b1a109f2ace158e828715205592615d6e33fd0 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TFilesystemFeedbackWrapper.cpp (.../TFilesystemFeedbackWrapper.cpp) (revision d3b1a109f2ace158e828715205592615d6e33fd0) +++ src/libchcore/TFilesystemFeedbackWrapper.cpp (.../TFilesystemFeedbackWrapper.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -237,7 +237,7 @@ return TSubTaskBase::eSubResult_PauseRequest; case EFeedbackResult::eResult_Skip: - TSubTaskBase::eSubResult_Continue; // just do nothing + return TSubTaskBase::eSubResult_Continue; // just do nothing default: BOOST_ASSERT(FALSE); // unknown result Index: src/libchcore/TLocalFilesystem.cpp =================================================================== diff -u -raf42be61996360060ae56ac01f9e22387daf09f9 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TLocalFilesystem.cpp (.../TLocalFilesystem.cpp) (revision af42be61996360060ae56ac01f9e22387daf09f9) +++ src/libchcore/TLocalFilesystem.cpp (.../TLocalFilesystem.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -106,7 +106,7 @@ void TLocalFilesystem::SetFileDirectoryTime(const TSmartPath& pathFileDir, const TFileTime& ftCreationTime, const TFileTime& ftLastAccessTime, const TFileTime& ftLastWriteTime) { - TAutoFileHandle hFile = CreateFile(PrependPathExtensionIfNeeded(pathFileDir).ToString(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL); + TAutoFileHandle hFile = TAutoFileHandle(CreateFile(PrependPathExtensionIfNeeded(pathFileDir).ToString(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL)); if (hFile == INVALID_HANDLE_VALUE) { DWORD dwLastError = GetLastError(); Index: src/libchcore/TLocalFilesystemFile.cpp =================================================================== diff -u -rbfc7a8378a96c5b58def559b343918fca32f05a6 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TLocalFilesystemFile.cpp (.../TLocalFilesystemFile.cpp) (revision bfc7a8378a96c5b58def559b343918fca32f05a6) +++ src/libchcore/TLocalFilesystemFile.cpp (.../TLocalFilesystemFile.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -263,7 +263,7 @@ tFileInfo.SetFilePath(m_pathFile); tFileInfo.SetAttributes(bhfi.dwFileAttributes); - tFileInfo.SetFileTimes(bhfi.ftCreationTime, bhfi.ftLastAccessTime, bhfi.ftLastWriteTime); + tFileInfo.SetFileTimes(TFileTime(bhfi.ftCreationTime), TFileTime(bhfi.ftLastAccessTime), TFileTime(bhfi.ftLastWriteTime)); tFileInfo.SetLength64(uli.QuadPart); } Index: src/libchcore/TSQLiteSerializerFactory.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSQLiteSerializerFactory.h (.../TSQLiteSerializerFactory.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSQLiteSerializerFactory.h (.../TSQLiteSerializerFactory.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -28,7 +28,7 @@ class LIBCHCORE_API TSQLiteSerializerFactory : public ISerializerFactory { public: - TSQLiteSerializerFactory(const TSmartPath& pathSerializeDir); + explicit TSQLiteSerializerFactory(const TSmartPath& pathSerializeDir); virtual ~TSQLiteSerializerFactory(); virtual ISerializerPtr CreateTaskManagerSerializer(bool bForceRecreate = false) override; Index: src/libchcore/TSQLiteStatement.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSQLiteStatement.h (.../TSQLiteStatement.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSQLiteStatement.h (.../TSQLiteStatement.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -41,7 +41,7 @@ }; public: - TSQLiteStatement(const TSQLiteDatabasePtr& spDatabase); + explicit TSQLiteStatement(const TSQLiteDatabasePtr& spDatabase); ~TSQLiteStatement(); void Close(); Index: src/libchcore/TSQLiteTransaction.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSQLiteTransaction.h (.../TSQLiteTransaction.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSQLiteTransaction.h (.../TSQLiteTransaction.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -29,7 +29,7 @@ class TSQLiteTransaction { public: - TSQLiteTransaction(const TSQLiteDatabasePtr& spDatabase); + explicit TSQLiteTransaction(const TSQLiteDatabasePtr& spDatabase); ~TSQLiteTransaction(); void Begin(); Index: src/libchcore/TScopedRunningTimeTracker.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TScopedRunningTimeTracker.h (.../TScopedRunningTimeTracker.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TScopedRunningTimeTracker.h (.../TScopedRunningTimeTracker.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -27,7 +27,7 @@ class TScopedRunningTimeTracker { public: - TScopedRunningTimeTracker(IRunningTimeControl& rStats); + explicit TScopedRunningTimeTracker(IRunningTimeControl& rStats); ~TScopedRunningTimeTracker(); void PauseTimeTracking(); Index: src/libchcore/TScopedRunningTimeTrackerPause.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TScopedRunningTimeTrackerPause.h (.../TScopedRunningTimeTrackerPause.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TScopedRunningTimeTrackerPause.h (.../TScopedRunningTimeTrackerPause.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -26,7 +26,7 @@ class TScopedRunningTimeTrackerPause { public: - TScopedRunningTimeTrackerPause(TScopedRunningTimeTracker& rRunningTimeTracker); + explicit TScopedRunningTimeTrackerPause(TScopedRunningTimeTracker& rRunningTimeTracker); ~TScopedRunningTimeTrackerPause(); TScopedRunningTimeTrackerPause(const TScopedRunningTimeTrackerPause&) = delete; Index: src/libchcore/TSerializerVersion.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSerializerVersion.h (.../TSerializerVersion.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSerializerVersion.h (.../TSerializerVersion.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -27,7 +27,7 @@ class LIBCHCORE_API TSerializerVersion { public: - TSerializerVersion(const sqlite::TSQLiteDatabasePtr& spDatabase); + explicit TSerializerVersion(const sqlite::TSQLiteDatabasePtr& spDatabase); ~TSerializerVersion(); int GetVersion(); Index: src/libchcore/TSharedMemory.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSharedMemory.cpp (.../TSharedMemory.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSharedMemory.cpp (.../TSharedMemory.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -33,7 +33,7 @@ class TMutexLock { public: - TMutexLock(HANDLE hMutex) : + explicit TMutexLock(HANDLE hMutex) : m_hMutex(hMutex) { if (m_hMutex) Index: src/libchcore/TSharedModificationTracker.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSharedModificationTracker.h (.../TSharedModificationTracker.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSharedModificationTracker.h (.../TSharedModificationTracker.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -30,7 +30,7 @@ typedef T value_type; public: - TSharedModificationTracker(Bitset& rBitset) : + explicit TSharedModificationTracker(Bitset& rBitset) : m_tValue(), m_rBitset(rBitset) { Index: src/libchcore/TStringArray.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TStringArray.h (.../TStringArray.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TStringArray.h (.../TStringArray.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -31,7 +31,7 @@ class LIBCHCORE_API TStringArrayIterator { protected: - TStringArrayIterator(std::vector::iterator iterArray); + explicit TStringArrayIterator(std::vector::iterator iterArray); public: TStringArrayIterator(); @@ -58,7 +58,7 @@ class LIBCHCORE_API TStringArrayConstIterator { protected: - TStringArrayConstIterator(std::vector::const_iterator iterArray); + explicit TStringArrayConstIterator(std::vector::const_iterator iterArray); public: TStringArrayConstIterator(); Index: src/libchcore/TStringSet.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TStringSet.h (.../TStringSet.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TStringSet.h (.../TStringSet.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -31,7 +31,7 @@ class LIBCHCORE_API TStringSetIterator { protected: - TStringSetIterator(std::set::iterator iterSet); + explicit TStringSetIterator(std::set::iterator iterSet); public: TStringSetIterator(); @@ -57,7 +57,7 @@ class LIBCHCORE_API TStringSetConstIterator { protected: - TStringSetConstIterator(std::set::const_iterator iterSet); + explicit TStringSetConstIterator(std::set::const_iterator iterSet); public: TStringSetConstIterator(); Index: src/libchcore/TSubTaskArray.h =================================================================== diff -u -r3b320bc86d4e808c2f6a70c10bd5c9936102b301 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSubTaskArray.h (.../TSubTaskArray.h) (revision 3b320bc86d4e808c2f6a70c10bd5c9936102b301) +++ src/libchcore/TSubTaskArray.h (.../TSubTaskArray.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -42,7 +42,7 @@ class LIBCHCORE_API TSubTasksArray { public: - TSubTasksArray(TSubTaskContext& rSubTaskContext); + explicit TSubTasksArray(TSubTaskContext& rSubTaskContext); TSubTasksArray(const TOperationPlan& rOperationPlan, TSubTaskContext& rSubTaskContext); ~TSubTasksArray(); Index: src/libchcore/TSubTaskBase.h =================================================================== diff -u -r3b320bc86d4e808c2f6a70c10bd5c9936102b301 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSubTaskBase.h (.../TSubTaskBase.h) (revision 3b320bc86d4e808c2f6a70c10bd5c9936102b301) +++ src/libchcore/TSubTaskBase.h (.../TSubTaskBase.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -53,7 +53,7 @@ }; public: - TSubTaskBase(TSubTaskContext& rContext); + explicit TSubTaskBase(TSubTaskContext& rContext); virtual ~TSubTaskBase(); virtual void Reset() = 0; Index: src/libchcore/TSubTaskCopyMove.h =================================================================== diff -u -r3b320bc86d4e808c2f6a70c10bd5c9936102b301 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSubTaskCopyMove.h (.../TSubTaskCopyMove.h) (revision 3b320bc86d4e808c2f6a70c10bd5c9936102b301) +++ src/libchcore/TSubTaskCopyMove.h (.../TSubTaskCopyMove.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -45,7 +45,7 @@ class LIBCHCORE_API TSubTaskCopyMove : public TSubTaskBase { public: - TSubTaskCopyMove(TSubTaskContext& tSubTaskContext); + explicit TSubTaskCopyMove(TSubTaskContext& tSubTaskContext); virtual void Reset(); Index: src/libchcore/TSubTaskDelete.h =================================================================== diff -u -r3b320bc86d4e808c2f6a70c10bd5c9936102b301 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSubTaskDelete.h (.../TSubTaskDelete.h) (revision 3b320bc86d4e808c2f6a70c10bd5c9936102b301) +++ src/libchcore/TSubTaskDelete.h (.../TSubTaskDelete.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -34,7 +34,7 @@ class LIBCHCORE_API TSubTaskDelete : public TSubTaskBase { public: - TSubTaskDelete(TSubTaskContext& rContext); + explicit TSubTaskDelete(TSubTaskContext& rContext); virtual void Reset(); Index: src/libchcore/TSubTaskFastMove.h =================================================================== diff -u -r3b320bc86d4e808c2f6a70c10bd5c9936102b301 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSubTaskFastMove.h (.../TSubTaskFastMove.h) (revision 3b320bc86d4e808c2f6a70c10bd5c9936102b301) +++ src/libchcore/TSubTaskFastMove.h (.../TSubTaskFastMove.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -38,7 +38,7 @@ class LIBCHCORE_API TSubTaskFastMove : public TSubTaskBase { public: - TSubTaskFastMove(TSubTaskContext& rContext); + explicit TSubTaskFastMove(TSubTaskContext& rContext); virtual ~TSubTaskFastMove(); virtual void Reset(); Index: src/libchcore/TSubTaskScanDirectory.h =================================================================== diff -u -r3b320bc86d4e808c2f6a70c10bd5c9936102b301 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSubTaskScanDirectory.h (.../TSubTaskScanDirectory.h) (revision 3b320bc86d4e808c2f6a70c10bd5c9936102b301) +++ src/libchcore/TSubTaskScanDirectory.h (.../TSubTaskScanDirectory.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -39,7 +39,7 @@ class LIBCHCORE_API TSubTaskScanDirectories : public TSubTaskBase { public: - TSubTaskScanDirectories(TSubTaskContext& rContext); + explicit TSubTaskScanDirectories(TSubTaskContext& rContext); virtual ~TSubTaskScanDirectories(); virtual void Reset(); Index: src/libchcore/TSubTaskStatsInfo.h =================================================================== diff -u -rdb818324a61602e118506ca8b3973e44d997c8de -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TSubTaskStatsInfo.h (.../TSubTaskStatsInfo.h) (revision db818324a61602e118506ca8b3973e44d997c8de) +++ src/libchcore/TSubTaskStatsInfo.h (.../TSubTaskStatsInfo.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -48,7 +48,7 @@ static const unsigned long long DefaultSpeedSampleTime = 100; // in miliseconds public: - TSubTaskStatsInfo(ESubOperationType eSubTaskType); + explicit TSubTaskStatsInfo(ESubOperationType eSubTaskType); void Init(int iCurrentBufferIndex, file_count_t fcTotalCount, file_count_t fcProcessedCount, unsigned long long ullTotalSize, unsigned long long ullProcessedSize, const TString& strCurrentPath); void Clear(); Index: src/libchcore/TTaskInfo.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TTaskInfo.cpp (.../TTaskInfo.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TTaskInfo.cpp (.../TTaskInfo.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -45,9 +45,9 @@ m_oidObjectID(rSrc.m_oidObjectID), m_pathSerializeLocation(m_setModifications, rSrc.m_pathSerializeLocation), m_iOrder(m_setModifications, rSrc.m_iOrder), - m_spTask(rSrc.m_spTask) + m_spTask(rSrc.m_spTask), + m_setModifications(rSrc.m_setModifications) { - m_setModifications = rSrc.m_setModifications; } TTaskInfoEntry& TTaskInfoEntry::operator=(const TTaskInfoEntry& rSrc) Index: src/libchcore/TTaskOperationPlan.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TTaskOperationPlan.cpp (.../TTaskOperationPlan.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TTaskOperationPlan.cpp (.../TTaskOperationPlan.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -104,28 +104,4 @@ boost::shared_lock lock(m_lock); return m_eOperation; } - - size_t TOperationPlan::GetSubOperationsCount() const - { - boost::shared_lock lock(m_lock); - return m_vSubOperations.size(); - } - - ESubOperationType TOperationPlan::GetSubOperationAt(size_t stIndex) const - { - boost::shared_lock lock(m_lock); - if (stIndex >= m_vSubOperations.size()) - THROW_CORE_EXCEPTION(eErr_BoundsExceeded); - else - return m_vSubOperations[stIndex].first; - } - - double TOperationPlan::GetEstimatedTimeAt(size_t stIndex) const - { - boost::shared_lock lock(m_lock); - if (stIndex >= m_vSubOperations.size()) - THROW_CORE_EXCEPTION(eErr_BoundsExceeded); - else - return m_vSubOperations[stIndex].second; - } } Index: src/libchcore/TTaskOperationPlan.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TTaskOperationPlan.h (.../TTaskOperationPlan.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TTaskOperationPlan.h (.../TTaskOperationPlan.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -46,11 +46,6 @@ EOperationType GetOperationType() const; private: - size_t GetSubOperationsCount() const; - ESubOperationType GetSubOperationAt(size_t stIndex) const; - double GetEstimatedTimeAt(size_t stIndex) const; - - private: EOperationType m_eOperation; #pragma warning(push) #pragma warning(disable: 4251) Index: src/libchcore/TTaskStatsSnapshot.cpp =================================================================== diff -u -rcadc78491ac98e5f21d395aa25578cdd740ce819 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/TTaskStatsSnapshot.cpp (.../TTaskStatsSnapshot.cpp) (revision cadc78491ac98e5f21d395aa25578cdd740ce819) +++ src/libchcore/TTaskStatsSnapshot.cpp (.../TTaskStatsSnapshot.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -50,7 +50,8 @@ m_dTaskCountSpeed(0.0), m_dTaskSizeSpeed(0.0), m_dCombinedProgress(0.0), - m_uiBufferCount(0) + m_uiBufferCount(0), + m_tTaskID(0) { } Index: src/libchcore/Tests/TOverlappedDataBufferQueueTests.cpp =================================================================== diff -u -radf2d680643ef85665b042e03fed274ab8f11180 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libchcore/Tests/TOverlappedDataBufferQueueTests.cpp (.../TOverlappedDataBufferQueueTests.cpp) (revision adf2d680643ef85665b042e03fed274ab8f11180) +++ src/libchcore/Tests/TOverlappedDataBufferQueueTests.cpp (.../TOverlappedDataBufferQueueTests.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -223,7 +223,7 @@ queue.AddFullBuffer(pBuffer); EXPECT_SIGNALED(queue.GetEventWritePossibleHandle()); - pBuffer = queue.GetFullBuffer(); + queue.GetFullBuffer(); EXPECT_TIMEOUT(queue.GetEventWritePossibleHandle()); } @@ -267,13 +267,14 @@ queue.AddFullBuffer(pBuffers[1]); queue.AddFullBuffer(pBuffers[2]); - TOverlappedDataBuffer* pBuffer = queue.GetFullBuffer(); + queue.GetFullBuffer(); EXPECT_FALSE(queue.IsDataWritingFinished()); - pBuffer = queue.GetFullBuffer(); + + queue.GetFullBuffer(); EXPECT_FALSE(queue.IsDataWritingFinished()); // getting the last buffer (marked as eof) causes setting the data-writing-finished flag - pBuffer = queue.GetFullBuffer(); + queue.GetFullBuffer(); EXPECT_TRUE(queue.IsDataWritingFinished()); } Index: src/libicpf/callback.cpp =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/callback.cpp (.../callback.cpp) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/callback.cpp (.../callback.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -53,7 +53,7 @@ } } -const callback_list& callback_list::operator=(const callback_list& rSrc) +callback_list& callback_list::operator=(const callback_list& rSrc) { assert(false); // we shouldn't use the assignment operator at all!!! if (this != &rSrc) @@ -77,7 +77,7 @@ bool callback_list::remove(PFNFUNC pfn) { m_lock.lock(); - for (std::vector::iterator it=STORAGE->begin();it != STORAGE->end();it++) + for (std::vector::iterator it=STORAGE->begin();it != STORAGE->end();++it) { if ((*it).pfn == pfn) { Index: src/libicpf/callback.h =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/callback.h (.../callback.h) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/callback.h (.../callback.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -63,7 +63,7 @@ void lock(); void unlock(); - const callback_list& operator=(const callback_list& rSrc); + callback_list& operator=(const callback_list& rSrc); protected: icpf::mutex m_lock; ///< A locking mechanism for the storage area @@ -104,10 +104,9 @@ void exec(P1 data) { m_lock.lock(); - CLBDATA* pData; for (size_t i=0;i != size();i++) { - pData=at(i); + CLBDATA* pData=at(i); if (pData) (*(PFNCALLBACKPROC1)(pData->pfn))(pData->param, data); } @@ -166,10 +165,9 @@ void exec(P1 data1, P2 data2) { m_lock.lock(); - CLBDATA* pData; for (size_t i=0;i != size();i++) { - pData=at(i); + CLBDATA* pData=at(i); if (pData) (*(PFNCALLBACKPROC2)(pData->pfn))(pData->param, data1, data2); } @@ -229,10 +227,9 @@ void exec(P1 data1, P2 data2, P3 data3) { m_lock.lock(); - CLBDATA* pData; for (size_t i=0;i != size();i++) { - pData=at(i); + CLBDATA* pData=at(i); if (pData) (*(PFNCALLBACKPROC3)(pData->pfn))(pData->param, data1, data2, data3); } Index: src/libicpf/cfg.cpp =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/cfg.cpp (.../cfg.cpp) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/cfg.cpp (.../cfg.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -96,7 +96,7 @@ size_t property_tracker::get_ids(uint_t* puiProps, size_t stMaxCount) { size_t tIndex=0; - for (std::set::iterator it=m_psProperties->begin();it != m_psProperties->end();it++) + for (std::set::iterator it=m_psProperties->begin();it != m_psProperties->end();++it) { puiProps[tIndex++]=(*it); if(tIndex >= stMaxCount) @@ -114,7 +114,7 @@ */ void property_tracker::enum_ids(bool(*pfn)(uint_t uiProp, ptr_t pParam), ptr_t pParam) { - for (std::set::iterator it=m_psProperties->begin();it != m_psProperties->end();it++) + for (std::set::iterator it=m_psProperties->begin();it != m_psProperties->end();++it) { if(!(*pfn)((*it), pParam)) break; @@ -784,14 +784,14 @@ { m_lock.lock(); - ptr_t hFind=NULL; - for (std::vector::iterator it=m_pvProps->begin();it != m_pvProps->end();it++) + for (std::vector::iterator it=m_pvProps->begin();it != m_pvProps->end();++it) { // is this an array property ? if((*it).is_array()) (*it).clear_array(); // and fill with value(s) + ptr_t hFind=NULL; if( (hFind=m_pCfgBase->find((*it).get_name())) != NULL) { PROPINFO pi; @@ -816,7 +816,7 @@ m_lock.lock(); tchar_t szBuffer[128]; - for (std::vector::iterator it=m_pvProps->begin();it != m_pvProps->end();it++) + for (std::vector::iterator it=m_pvProps->begin();it != m_pvProps->end();++it) { // clear the current attributes for the property m_pCfgBase->clear((*it).get_name()); Index: src/libicpf/cfg.h =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/cfg.h (.../cfg.h) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/cfg.h (.../cfg.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -86,7 +86,7 @@ public: /** \name Construction/destruction */ /**@{*/ - config(config_base_types eCfgType); ///< Standard constructor + explicit config(config_base_types eCfgType); ///< Standard constructor virtual ~config(); ///< Standard destructor /**@}*/ Index: src/libicpf/cfg_ini.cpp =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/cfg_ini.cpp (.../cfg_ini.cpp) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/cfg_ini.cpp (.../cfg_ini.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -228,12 +228,12 @@ // and write tstring_t strLine; - for(ini_storage::iterator iterSections = m_pMainNode->begin(); iterSections != m_pMainNode->end(); iterSections++) + for(ini_storage::iterator iterSections = m_pMainNode->begin(); iterSections != m_pMainNode->end(); ++iterSections) { strLine = _t("[") + (*iterSections).first + _t("]") + ENDL; if(_fputts(strLine.c_str(), pFile) == TEOF) THROW(_t("Cannot put section name"), 0, errno, 0); - for(attr_storage::iterator iterAttribute = (*iterSections).second.begin(); iterAttribute != (*iterSections).second.end(); iterAttribute++) + for(attr_storage::iterator iterAttribute = (*iterSections).second.begin(); iterAttribute != (*iterSections).second.end(); ++iterAttribute) { strLine = (*iterAttribute).first + _t("=") + (*iterAttribute).second + ENDL; if(_fputts(strLine.c_str(), pFile) == TEOF) @@ -330,7 +330,7 @@ pi.pszName = (*pfh->itAttr).first.c_str(); pi.pszValue = (*pfh->itAttr).second.c_str(); pi.bGroup = false; - pfh->itAttr++; + ++pfh->itAttr; return true; } else @@ -360,7 +360,7 @@ pi.pszName = (*pfh->itAttr).first.c_str(); pi.pszValue = (*pfh->itAttr).second.c_str(); - pfh->itAttr++; + ++pfh->itAttr; if(pfh->itAttr == pfh->itAttrEnd) pfh->bSection = true; return true; Index: src/libicpf/circ_buffer.cpp =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/circ_buffer.cpp (.../circ_buffer.cpp) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/circ_buffer.cpp (.../circ_buffer.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -88,14 +88,17 @@ // copy the old stuff m_pbyBuffer=new byte_t[rSrc.m_tSize]; memcpy(m_pbyBuffer, rSrc.m_pbyBuffer, rSrc.m_tDataSize); + m_tSize=rSrc.m_tSize; m_tDataSize=rSrc.m_tDataSize; + m_tBitsAtEndCount = rSrc.m_tBitsAtEndCount; } else { m_pbyBuffer=NULL; m_tSize=0; m_tDataSize=0; + m_tBitsAtEndCount = 0; } } Index: src/libicpf/config_property.cpp =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/config_property.cpp (.../config_property.cpp) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/config_property.cpp (.../config_property.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -827,7 +827,7 @@ { case type_signed_num: { - for (std::vector::iterator it=m_paSigneds->begin();it != m_paSigneds->end();it++) + for (std::vector::iterator it=m_paSigneds->begin();it != m_paSigneds->end();++it) { if ((*it) < m_range.ll.llLo) (*it)=m_range.ll.llLo; @@ -838,7 +838,7 @@ } case type_unsigned_num: { - for (std::vector::iterator it=m_paUnsigneds->begin();it != m_paUnsigneds->end();it++) + for (std::vector::iterator it=m_paUnsigneds->begin();it != m_paUnsigneds->end();++it) { if ((*it) < m_range.ull.ullLo) (*it)=m_range.ull.ullLo; Index: src/libicpf/dmutex.h =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/dmutex.h (.../dmutex.h) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/dmutex.h (.../dmutex.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -49,7 +49,7 @@ /** \name Construction/destruction */ /**@{*/ d_mutex(); ///< Constructs an unnamed mutex - d_mutex(const char_t* pszStr); ///< Constructs a named mutex + explicit d_mutex(const char_t* pszStr); ///< Constructs a named mutex virtual ~d_mutex(); ///< Standard destructor /**@}*/ Index: src/libicpf/dumpctx.h =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/dumpctx.h (.../dumpctx.h) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/dumpctx.h (.../dumpctx.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -68,7 +68,9 @@ public: /** \name Construction/destruction */ /**@{*/ - explicit dumpctx(uint_t uiType, ptr_t pParam=NULL); ///< Standard constructor + explicit dumpctx(uint_t uiType, ptr_t pParam = NULL); ///< Standard constructor + dumpctx(const dumpctx&) = delete; + dumpctx& operator=(const dumpctx&) = delete; ~dumpctx(); ///< Standard destructor /**@}*/ Index: src/libicpf/exception.cpp =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/exception.cpp (.../exception.cpp) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/exception.cpp (.../exception.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -196,6 +196,9 @@ tchar_t* psz=new tchar_t[(size_t)MAX_EXCEPTION]; _vsntprintf(psz, (size_t)MAX_EXCEPTION, pszFormat, vl); psz[MAX_EXCEPTION-1]=_t('\0'); + + va_end(vl); + return psz; } Index: src/libicpf/file.cpp =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/file.cpp (.../file.cpp) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/file.cpp (.../file.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -419,7 +419,6 @@ if (m_bBuffered) { uint_t uiStrPos=0; // current index in pszString - uint_t uiMin=0; // helper uint_t uiSize=uiLen+2; // processing whole string @@ -429,7 +428,7 @@ _write_packet(); // count of chars to be copied - uiMin=minval(uiSize-uiStrPos, m_uiBufferSize-m_uiCurrentPos); + unsigned int uiMin=minval(uiSize-uiStrPos, m_uiBufferSize-m_uiCurrentPos); // copy data from pszString into internal buffer (maybe part of it) memcpy(m_pbyBuffer+m_uiCurrentPos, pszData+uiStrPos, uiMin); Index: src/libicpf/log.cpp =================================================================== diff -u -rb5982438edac1abb34f8f5013ba073fd01523afc -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libicpf/log.cpp (.../log.cpp) (revision b5982438edac1abb34f8f5013ba073fd01523afc) +++ src/libicpf/log.cpp (.../log.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -254,7 +254,6 @@ // read the string to the eol tchar_t szBuffer[4096]; fgets(szBuffer, 4096, pFile); - iNewSize-=_tcslen(szBuffer); // new size correction int_t iSrc=ftell(pFile); int_t iDst=0; Index: src/libictranslate/LanguageDialog.cpp =================================================================== diff -u -r579a3dc9b73a32cf58e8ce7786e7154db4a8787e -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libictranslate/LanguageDialog.cpp (.../LanguageDialog.cpp) (revision 579a3dc9b73a32cf58e8ce7786e7154db4a8787e) +++ src/libictranslate/LanguageDialog.cpp (.../LanguageDialog.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -27,12 +27,30 @@ ///////////////////////////////////////////////////////////////////////////// // CDlgTemplate -CDlgTemplate::CDlgTemplate(const DLGTEMPLATE* pDlgTemplate) +ictranslate::CDlgTemplate::CDlgTemplate() : + m_dlgTemplate({ 0 }), + m_wMenu((WORD)-1), + m_pszMenu(NULL), + m_wClass((WORD)-1), + m_pszClass(NULL), + m_wTitle((WORD)-1), + m_pszTitle(NULL), + m_wFontSize(0), + m_wWeight(0), + m_byItalic(0), + m_byCharset(0), + m_pszFace(NULL) { +} + +CDlgTemplate::CDlgTemplate(const DLGTEMPLATE* pDlgTemplate) : + m_dlgTemplate({ 0 }) +{ Open(pDlgTemplate); } -CDlgTemplate::CDlgTemplate(const DLGTEMPLATEEX* pDlgTemplate) +CDlgTemplate::CDlgTemplate(const DLGTEMPLATEEX* pDlgTemplate) : + m_dlgTemplate({ 0 }) { Open((DLGTEMPLATE*)pDlgTemplate); } @@ -46,7 +64,7 @@ // items vector<_ITEM>::iterator it; - for (it=m_vItems.begin();it != m_vItems.end();it++) + for (it=m_vItems.begin();it != m_vItems.end();++it) { delete [] (*it).m_pbyCreationData; delete [] (*it).m_pszClass; @@ -447,7 +465,7 @@ break; } - it++; + ++it; } delete m_pFont; @@ -596,10 +614,10 @@ } // the controls - CWnd* pWnd; vector::iterator it; - for (it=dt.m_vItems.begin();it != dt.m_vItems.end();it++) + for (it=dt.m_vItems.begin();it != dt.m_vItems.end();++it) { + CWnd* pWnd = nullptr; // skip controls that cannot be modified if ( (*it).m_itemTemplate.id == 0xffff || (pWnd=GetDlgItem((*it).m_itemTemplate.id)) == NULL) continue; @@ -839,14 +857,13 @@ GetClientRect(&m_rcDialogInitialPosition); // enum through the controls to get their current positions - CWnd* pWnd = NULL; CRect rcControl; std::map::iterator iterControl = m_mapResizeInfo.begin(); while(iterControl != m_mapResizeInfo.end()) { // get the control if exists - pWnd = GetDlgItem((*iterControl).second.GetControlID()); + CWnd* pWnd = GetDlgItem((*iterControl).second.GetControlID()); if(!(*iterControl).second.IsInitialized()) { if(pWnd && ::IsWindow(pWnd->m_hWnd)) Index: src/libictranslate/LanguageDialog.h =================================================================== diff -u -r9842d6266c37f4268f3b53911194425ae886ef70 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libictranslate/LanguageDialog.h (.../LanguageDialog.h) (revision 9842d6266c37f4268f3b53911194425ae886ef70) +++ src/libictranslate/LanguageDialog.h (.../LanguageDialog.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -96,9 +96,9 @@ class CDlgTemplate { public: - CDlgTemplate() { m_wMenu=(WORD)-1; m_pszMenu=NULL; m_wClass=(WORD)-1; m_pszClass=NULL, m_wTitle=(WORD)-1; m_pszTitle=NULL; m_wFontSize=0; m_wWeight=0; m_byItalic=0; m_byCharset=0; m_pszFace=NULL; }; - CDlgTemplate(const DLGTEMPLATE* pDlgTemplate); - CDlgTemplate(const DLGTEMPLATEEX* pDlgTemplate); + CDlgTemplate(); + explicit CDlgTemplate(const DLGTEMPLATE* pDlgTemplate); + explicit CDlgTemplate(const DLGTEMPLATEEX* pDlgTemplate); ~CDlgTemplate(); bool Open(const DLGTEMPLATE* pDlgTemplate); @@ -176,7 +176,7 @@ { public: // Construction/destruction - CLanguageDialog(bool* pLock=NULL); + explicit CLanguageDialog(bool* pLock=NULL); CLanguageDialog(PCTSTR lpszTemplateName, CWnd* pParent = NULL, bool* pLock=NULL); // standard constructor CLanguageDialog(UINT uiIDTemplate, CWnd* pParent = NULL, bool* pLock=NULL); // standard constructor Index: src/libictranslate/ResourceManager.cpp =================================================================== diff -u -r579a3dc9b73a32cf58e8ce7786e7154db4a8787e -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision 579a3dc9b73a32cf58e8ce7786e7154db4a8787e) +++ src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -41,6 +41,10 @@ { } +CFormat::CFormat() +{ +} + CFormat::~CFormat() { } @@ -120,17 +124,11 @@ return SetParam(pszName, szBuffer); } -CTranslationItem::CTranslationItem() : - m_pszText(NULL), - m_uiChecksum(0), - m_stTextLength(0) +CTranslationItem::CTranslationItem() { } -CTranslationItem::CTranslationItem(const tchar_t* pszText, uint_t uiChecksum) : - m_pszText(NULL), - m_stTextLength(0), - m_uiChecksum(uiChecksum) +CTranslationItem::CTranslationItem(const tchar_t* pszText, uint_t uiChecksum) { if(pszText) { @@ -142,9 +140,26 @@ UnescapeString(); } + + m_uiChecksum = uiChecksum; } } +ictranslate::CTranslationItem::CTranslationItem(const CTranslationItem& rSrc) +{ + if(rSrc.m_pszText) + { + m_stTextLength = _tcslen(rSrc.m_pszText); + if(m_stTextLength > 0) + { + m_pszText = new tchar_t[ m_stTextLength + 1 ]; + _tcscpy(m_pszText, rSrc.m_pszText); + + UnescapeString(); + } + } +} + CTranslationItem::~CTranslationItem() { Clear(); @@ -281,15 +296,14 @@ setFmtStrings.clear(); const tchar_t* pszData = m_pszText; - const tchar_t* pszNext = NULL; const size_t stMaxFmt = 256; tchar_t szFmt[stMaxFmt]; while((pszData = _tcschr(pszData, _t('%'))) != NULL) { pszData++; // it works assuming the string is null-terminated // search the end of fmt string - pszNext = pszData; + const tchar_t* pszNext = pszData; while(*pszNext && isalpha(*pszNext)) pszNext++; @@ -660,7 +674,7 @@ cfg.set_string(_T("Info/Format version"), TRANSLATION_FORMAT_VERSION); tstring_t strText; - for(translation_map::iterator it = m_mapTranslation.begin(); it != m_mapTranslation.end(); it++) + for(translation_map::iterator it = m_mapTranslation.begin(); it != m_mapTranslation.end(); ++it) { uint_t uiKey = (*it).first; _sntprintf(szTemp, iBufferSize - 1, UIFMT _T("/") UIFMT _T("[") UIXFMT _T("]"), (uiKey >> 16), uiKey & 0x0000ffff, (*it).second.GetChecksum()); @@ -946,7 +960,7 @@ { if (::IsWindow((*it)->m_hWnd)) (*it)->PostMessage(WM_RMNOTIFY, RMNT_LANGCHANGE, 0); - it++; + ++it; } // send the notification stuff to the others Index: src/libictranslate/ResourceManager.h =================================================================== diff -u -r3f9f8af037199406b260eee3f6acb5cd6a588960 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/libictranslate/ResourceManager.h (.../ResourceManager.h) (revision 3f9f8af037199406b260eee3f6acb5cd6a588960) +++ src/libictranslate/ResourceManager.h (.../ResourceManager.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -42,8 +42,8 @@ class LIBICTRANSLATE_API CFormat { public: - CFormat() {}; - CFormat(const tchar_t* pszFormat); + CFormat(); + explicit CFormat(const tchar_t* pszFormat); ~CFormat(); void SetFormat(const tchar_t* pszFormat); @@ -75,6 +75,7 @@ }; public: CTranslationItem(); + CTranslationItem(const CTranslationItem& rSrc); CTranslationItem(const tchar_t* pszText, uint_t uiChecksum); ~CTranslationItem(); @@ -96,9 +97,9 @@ bool GetFormatStrings(std::set& setFmtStrings) const; protected: - tchar_t* m_pszText; - size_t m_stTextLength; - uint_t m_uiChecksum; + tchar_t* m_pszText = nullptr; + size_t m_stTextLength = 0; + uint_t m_uiChecksum = 0; }; typedef void(*PFNENUMCALLBACK)(uint_t, const CTranslationItem*, ptr_t); @@ -219,10 +220,8 @@ CLangData m_ld; // current language data list m_lhDialogs; // currently displayed dialog boxes (even hidden) - uint_t m_uiNotificationMsgID; // window message to send to windows HMODULE m_hRes; PFNNOTIFYCALLBACK m_pfnCallback; -// UINT m_uiMsg; CRITICAL_SECTION m_cs; protected: Index: src/rc2lng/rc.cpp =================================================================== diff -u -r1a1cfbeb68f7d321843a27a0e81a81952274829c -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/rc2lng/rc.cpp (.../rc.cpp) (revision 1a1cfbeb68f7d321843a27a0e81a81952274829c) +++ src/rc2lng/rc.cpp (.../rc.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -213,7 +213,7 @@ if(!pFile) THROW(icpf::exception::format(_T("Error: Cannot open file: ") TSTRFMT _T(" for writing."), pszFile), 0, errno, 0); - for (std::vector::const_iterator it=rLines.begin();it != rLines.end();it++) + for (std::vector::const_iterator it=rLines.begin();it != rLines.end();++it) { CString str = (*it); str += _T("\r\n"); @@ -517,14 +517,13 @@ bool CRCFile::ProcessRCFile() { - int iPos; CString strData; - std::vector vStrTable; - for (std::vector::iterator it=m_vInRCFile.begin();it != m_vInRCFile.end();it++) + for (std::vector::iterator it=m_vInRCFile.begin();it != m_vInRCFile.end();++it) { CString strLine = *it; strLine.Trim(); + int iPos = 0; if ( (iPos=strLine.Find(_T(" MENU"))) >= 0 && iPos == (strLine.GetLength() - (int)_tcslen(_T(" MENU"))) ) { // add the line to the output rc with no change @@ -533,7 +532,7 @@ UINT uiID = GetResourceID(strLine.Left(iPos)); // begin enumerating items - it++; + ++it; // process the menu ProcessMenu(uiID, &it); @@ -545,17 +544,20 @@ UINT uiID = GetResourceID(strLine.Left(iPos)); // begin processing dialog template - it++; + ++it; ProcessDialog(uiID, &it); } else if ( (iPos=strLine.Find(_T("STRINGTABLE"))) >= 0 && iPos == (strLine.GetLength() - (int)_tcslen(_T("STRINGTABLE")))) { // begin of the string table - it++; + ++it; ProcessStringTable(0, &it); } else m_vOutRCFile.push_back(*it); + + if(it == m_vInRCFile.end()) + break; } return true; Index: src/rc2lng/rc.h =================================================================== diff -u -r8443d0d98d380facaf07b540c8d98da08365b816 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/rc2lng/rc.h (.../rc.h) (revision 8443d0d98d380facaf07b540c8d98da08365b816) +++ src/rc2lng/rc.h (.../rc.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -32,8 +32,11 @@ }; public: CRCFile(); + CRCFile(const CRCFile&) = delete; ~CRCFile(); + CRCFile& operator=(const CRCFile&) = delete; + void ReadRC(PCTSTR pszFilename); void ReadResourceIDs(PCTSTR pszFilename); Index: tools/libicpf32u.dll =================================================================== diff -u -ref66618c03735e362f78ddd3822a3f5c40efa366 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 Binary files differ Index: tools/rc2lng.exe =================================================================== diff -u -rd2f9bbe90e8ca2a2013cb6bc87b630a7b8c6445c -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 Binary files differ