OSDN Git Service

`BOOL` becomes `bool` and related (1)
authorGreyMerlin <GreyMerlin7@gmail.com>
Sat, 29 Sep 2018 05:56:24 +0000 (22:56 -0700)
committerGreyMerlin <GreyMerlin7@gmail.com>
Thu, 11 Oct 2018 18:25:46 +0000 (11:25 -0700)
* Retains `BOOL` where necessary for MFC or Win API interfaces
* Retains `BOOL` in `*.c` files (GNU diffutils, and others) as `bool` is unavailable
* Mostly retains `BOOL` in CrystalEdit and BCMenu related files
* Retains `BOOL` in Poco and Boost source files.
* Retains `BOOL` when used with values other than simply `TRUE` and `FALSE`, such as values of
`-1`, or with additional flag bits.  These should be modernized with some future commits.
* Also `TRUE` becomes `true` and `FALSE` becomes `false` where appropriate.

100 files changed:
Externals/crystaledit/editlib/statbar.cpp
Externals/crystaledit/editlib/statbar.h
Src/7zCommon.cpp
Src/ChildFrm.cpp
Src/ChildFrm.h
Src/Common/BCMenu.cpp
Src/Common/BCMenu.h
Src/Common/CMoveConstraint.h
Src/Common/ClipBoard.cpp
Src/Common/ColorButton.cpp
Src/Common/ColorButton.h
Src/Common/LanguageSelect.cpp
Src/Common/LanguageSelect.h
Src/Common/MDITabBar.cpp
Src/Common/MDITabBar.h
Src/Common/MessageBoxDialog.cpp
Src/Common/MessageBoxDialog.h
Src/Common/Picture.cpp
Src/Common/Picture.h
Src/Common/PreferencesDlg.cpp
Src/Common/PropertyPageHost.cpp
Src/Common/PropertyPageHost.h
Src/Common/RegKey.cpp
Src/Common/RegKey.h
Src/Common/RegOptionsMgr.cpp
Src/Common/ShellFileOperations.cpp
Src/Common/SortHeaderCtrl.cpp
Src/Common/SortHeaderCtrl.h
Src/Common/SplitterWndEx.cpp
Src/Common/SplitterWndEx.h
Src/Common/UniFile.cpp
Src/Common/VersionInfo.cpp
Src/Common/VersionInfo.h
Src/Common/lwdisp.h
Src/Common/memdc.h
Src/Common/multiformatText.h
Src/Common/scbarcf.cpp
Src/Common/scbarcf.h
Src/Common/scbarg.cpp
Src/Common/scbarg.h
Src/Common/sizecbar.cpp
Src/Common/sizecbar.h
Src/CompareEngines/Wrap_DiffUtils.cpp
Src/ConfigLog.cpp
Src/DiffTextBuffer.h
Src/DiffViewBar.cpp
Src/DirCmpReport.cpp
Src/DirCmpReportDlg.cpp
Src/DirColsDlg.cpp
Src/DirCompProgressBar.cpp
Src/DirCompProgressBar.h
Src/DirDoc.cpp
Src/DirDoc.h
Src/DirView.cpp
Src/DirView.h
Src/Environment.cpp
Src/FileActionScript.cpp
Src/FileActionScript.h
Src/FileFilterHelper.h
Src/FileFiltersDlg.cpp
Src/FileOrFolderSelect.cpp
Src/FileOrFolderSelect.h
Src/FileTransform.h
Src/FilepathEdit.cpp
Src/FilepathEdit.h
Src/FolderCmp.cpp
Src/HexMergeDoc.cpp
Src/HexMergeDoc.h
Src/HexMergeFrm.cpp
Src/HexMergeView.cpp
Src/HexMergeView.h
Src/ImgMergeFrm.cpp
Src/ImgMergeFrm.h
Src/LocationBar.cpp
Src/LocationView.cpp
Src/LocationView.h
Src/MainFrm.cpp
Src/MainFrm.h
Src/Merge.cpp
Src/Merge.h
Src/MergeDoc.cpp
Src/MergeEditSplitterView.cpp
Src/MergeEditView.cpp
Src/MergeEditView.h
Src/OpenView.cpp
Src/OpenView.h
Src/OptionsSyntaxColors.cpp
Src/PatchDlg.cpp
Src/PatchTool.cpp
Src/Plugins.h
Src/PropArchive.cpp
Src/PropCompareBinary.cpp
Src/PropEditor.cpp
Src/PropRegistry.cpp
Src/TempFile.cpp
Src/Test.cpp
Src/Win_VersionHelper.h
Src/dllpstub.cpp
Src/dllpstub.h
Src/heksedit.h

index d608f4d..b7336e9 100644 (file)
@@ -38,28 +38,28 @@ Create (CWnd * pParentWnd, DWORD dwStyle, UINT nID)
   return bCreatedOK;
 }
 
-BOOL CEditStatusBar::
-SetPaneFormattedText (int nIndex, BOOL bUpdate, LPCTSTR lpszFmt,...)
+bool CEditStatusBar::
+SetPaneFormattedText (int nIndex, bool bUpdate, LPCTSTR lpszFmt,...)
 {
   TCHAR buffer[256];
   va_list argptr;
   va_start (argptr, lpszFmt);
   _vsntprintf_s (buffer, _TRUNCATE, lpszFmt, argptr);
   va_end (argptr);
-  BOOL bResult = SetPaneText (nIndex, buffer, bUpdate);
+  bool bResult = SetPaneText (nIndex, buffer, bUpdate);
   UpdateWindow ();
   return bResult;
 }
 
-BOOL CEditStatusBar::
-SetPaneFormattedText (int nIndex, BOOL bUpdate, UINT nId,...)
+bool CEditStatusBar::
+SetPaneFormattedText (int nIndex, bool bUpdate, UINT nId,...)
 {
   CString str;
   if (str.LoadString (nId))
     {
       va_list argptr;
       va_start (argptr, nId);
-      BOOL bResult = SetPaneFormattedText (nIndex, bUpdate, str, argptr);
+      bool bResult = SetPaneFormattedText (nIndex, bUpdate, str, argptr);
       va_end (argptr);
       return bResult;
     }
@@ -67,14 +67,14 @@ SetPaneFormattedText (int nIndex, BOOL bUpdate, UINT nId,...)
   return false;
 }
 
-BOOL CEditStatusBar::
-SetPaneText (int nIndex, LPCTSTR lpszNewText, BOOL bUpdate /*= true*/ )
+bool CEditStatusBar::
+SetPaneText (int nIndex, LPCTSTR lpszNewText, bool bUpdate /*= true*/ )
 {
   return CStatusBar::SetPaneText (nIndex, lpszNewText, bUpdate);
 }
 
-BOOL CEditStatusBar::
-SetPaneText (int nIndex, UINT nId, BOOL bUpdate /*= true*/ )
+bool CEditStatusBar::
+SetPaneText (int nIndex, UINT nId, bool bUpdate /*= true*/ )
 {
   CString str;
   if (str.LoadString (nId))
index f4eb731..90b9f32 100644 (file)
@@ -28,10 +28,10 @@ protected :
     CString m_strClockFormat;
 
 public :
-    BOOL SetPaneFormattedText (int nIndex, BOOL bUpdate, LPCTSTR lpszFmt,...);
-    BOOL SetPaneFormattedText (int nIndex, BOOL bUpdate, UINT nId,...);
-    BOOL SetPaneText (int nIndex, LPCTSTR lpszNewText, BOOL bUpdate = true);
-    BOOL SetPaneText (int nIndex, UINT nId, BOOL bUpdate = true);
+    bool SetPaneFormattedText (int nIndex, bool bUpdate, LPCTSTR lpszFmt,...);
+    bool SetPaneFormattedText (int nIndex, bool bUpdate, UINT nId,...);
+    bool SetPaneText (int nIndex, LPCTSTR lpszNewText, bool bUpdate = true);
+    bool SetPaneText (int nIndex, UINT nId, bool bUpdate = true);
     void SetClockFormat (LPCTSTR strClockFormat);
 
     // Overrides
index e4138dd..002333d 100644 (file)
@@ -140,16 +140,15 @@ bool IsArchiveFile(const String& pszFile)
        try {\r
                Merge7z::Format *piHandler = ArchiveGuessFormat(pszFile);\r
                if (piHandler)\r
-                       return TRUE;\r
+                       return true;\r
                else\r
-                       return FALSE;\r
+                       return false;\r
        }\r
        catch (CException *e)\r
        {\r
                e->Delete();\r
-               return FALSE;\r
+               return false;\r
        }\r
-//~    return FALSE;\r
 }\r
 \r
 /**\r
@@ -285,7 +284,7 @@ interface Merge7z *Merge7z::Proxy::operator->()
        {\r
                // Merge7z has not yet been loaded\r
 \r
-               if (!GetOptionsMgr()->GetInt(OPT_ARCHIVE_ENABLE))\r
+               if (GetOptionsMgr()->GetInt(OPT_ARCHIVE_ENABLE) == 0)\r
                        throw new CResourceException();\r
                if (DWORD ver = VersionOf7z())\r
                {\r
index ec943b3..f15ca4f 100644 (file)
@@ -78,7 +78,7 @@ CChildFrame::CChildFrame()
 : m_hIdentical(NULL)
 , m_hDifferent(NULL)
 {
-       m_bActivated = FALSE;
+       m_bActivated = false;
        std::fill_n(m_nLastSplitPos, 2, 0);
        m_pMergeDoc = 0;
 }
@@ -232,28 +232,28 @@ int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  * The bars are identified with their ID. This means the missing bar bug is triggered
  * when we run WinMerge after changing the ID of a bar. 
  */
-BOOL CChildFrame::EnsureValidDockState(CDockState& state) 
+bool CChildFrame::EnsureValidDockState(CDockState& state) 
 {
        for (int i = (int) state.m_arrBarInfo.GetSize()-1 ; i >= 0; i--) 
        {
-               BOOL barIsCorrect = TRUE;
+               bool barIsCorrect = true;
                CControlBarInfo* pInfo = (CControlBarInfo*)state.m_arrBarInfo[i];
                if (! pInfo) 
-                       barIsCorrect = FALSE;
+                       barIsCorrect = false;
                else
                {
                        if (! pInfo->m_bFloating) 
                        {
                                pInfo->m_pBar = GetControlBar(pInfo->m_nBarID);
                                if (!pInfo->m_pBar) 
-                                       barIsCorrect = FALSE; //toolbar id's probably changed   
+                                       barIsCorrect = false; //toolbar id's probably changed   
                        }
                }
 
                if (! barIsCorrect)
                        state.m_arrBarInfo.RemoveAt(i);
        }
-       return TRUE;
+       return true;
 }
 
 static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -283,7 +283,7 @@ static BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
        }
        else
        {
-               BOOL bHidden = static_cast<BOOL>(reinterpret_cast<uintptr_t>(RemoveProp(hwnd, _T("Hidden"))));
+               bool bHidden = RemoveProp(hwnd, _T("Hidden")) != nullptr;
                if (!bHidden)
                        ::SendMessage(hwnd, WM_SETREDRAW, (WPARAM)lParam, 0);
        }
@@ -294,7 +294,7 @@ static BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
  * @brief Alternative LockWindowUpdate(hWnd) API.
  * See the comment near the code that calls this function.
  */
-static BOOL MyLockWindowUpdate(HWND hwnd)
+static bool MyLockWindowUpdate(HWND hwnd)
 {
        WNDPROC pfnOldWndProc;
 
@@ -302,14 +302,14 @@ static BOOL MyLockWindowUpdate(HWND hwnd)
 
        pfnOldWndProc = (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)WndProc);
        SetProp(hwnd, _T("OldWndProc"), (HANDLE)pfnOldWndProc);
-       return TRUE;
+       return true;
 }
 
 /**
  * @brief Alternative LockWindowUpdate(NULL) API.
  * See the comment near the code that calls this function.
  */
-static BOOL MyUnlockWindowUpdate(HWND hwnd)
+static bool MyUnlockWindowUpdate(HWND hwnd)
 {
        WNDPROC pfnOldWndProc = (WNDPROC)RemoveProp(hwnd, _T("OldWndProc"));
        if (pfnOldWndProc)
@@ -317,7 +317,7 @@ static BOOL MyUnlockWindowUpdate(HWND hwnd)
 
        EnumChildWindows(hwnd, EnumChildProc, TRUE);
 
-       return TRUE;
+       return true;
 }
 
 void CChildFrame::ActivateFrame(int nCmdShow) 
@@ -327,7 +327,7 @@ void CChildFrame::ActivateFrame(int nCmdShow)
 
        if (!m_bActivated) 
        {
-               m_bActivated = TRUE;
+               m_bActivated = true;
 
                // get the active child frame, and a flag whether it is maximized
                if (oldActiveFrame == NULL)
index baf27d3..3463d51 100644 (file)
@@ -78,7 +78,7 @@ public:
 
 // Implementation
 private:
-       BOOL EnsureValidDockState(CDockState& state);
+       bool EnsureValidDockState(CDockState& state);
        void SavePosition();
        virtual ~CChildFrame();
        CSplitterWndEx& GetMergeEditSplitterWnd(int iRow)
@@ -88,7 +88,7 @@ private:
 private:
        int m_nLastSplitPos[2];
        void UpdateHeaderSizes();
-       BOOL m_bActivated;
+       bool m_bActivated;
        CMergeDoc * m_pMergeDoc;
        HICON m_hIdentical;
        HICON m_hDifferent;
index e8fc657..e40cc5f 100644 (file)
@@ -39,7 +39,7 @@
 #error This code does not work on Versions of MFC prior to 4.0
 #endif
 
-BOOL BCMenu::hicolor_bitmaps=FALSE;
+bool BCMenu::hicolor_bitmaps=false;
 
 CImageList BCMenu::m_AllImages;
 CArray<int,int&> BCMenu::m_AllImagesID;
@@ -76,7 +76,7 @@ typedef sBGR *pBGR;
 static pBGR MyGetDibBits(HDC hdcSrc, HBITMAP hBmpSrc, int nx, int ny)
 {
        BITMAPINFO bi;
-       BOOL bRes;
+       int nRes;
        pBGR buf;
 
        bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
@@ -90,10 +90,10 @@ static pBGR MyGetDibBits(HDC hdcSrc, HBITMAP hBmpSrc, int nx, int ny)
        bi.bmiHeader.biClrImportant = 0;
        
        buf = (pBGR) malloc(nx * 4 * ny);
-       bRes = GetDIBits(hdcSrc, hBmpSrc, 0, ny, buf, &bi, DIB_RGB_COLORS);
-       if (!bRes) {
+       nRes = GetDIBits(hdcSrc, hBmpSrc, 0, ny, buf, &bi, DIB_RGB_COLORS);
+       if (nRes == 0) {
                free(buf);
-               buf = 0;
+               buf = nullptr;
        }
        return buf;
 }
@@ -202,12 +202,12 @@ void BCMenuData::SetWideString(const wchar_t *szWideString)
                m_szMenuText=NULL;//set to NULL so we need not bother about dangling non-NULL Ptrs
 }
 
-BOOL BCMenu::IsMenu(CMenu *submenu)
+bool BCMenu::IsMenu(CMenu *submenu)
 {
        return IsMenu(submenu->m_hMenu);
 }
 
-BOOL BCMenu::IsMenu(HMENU submenu)
+bool BCMenu::IsMenu(HMENU submenu)
 {
        INT_PTR m;
        INT_PTR numSubMenus = m_AllSubMenus.GetUpperBound();
@@ -289,8 +289,10 @@ void BCMenu::DrawItem_Win9xNT2000 (LPDRAWITEMSTRUCT lpDIS)
        }
        else{
                CRect rect2;
-               BOOL standardflag=FALSE,selectedflag=FALSE,disableflag=FALSE;
-               BOOL checkflag=FALSE;
+               bool standardflag = false;
+               bool selectedflag = false;
+               bool disableflag = false;
+               bool checkflag=false;
                COLORREF crText = GetSysColor(COLOR_MENUTEXT);
                int x0,y0,dy;
                int nIconNormal=-1;
@@ -328,9 +330,9 @@ void BCMenu::DrawItem_Win9xNT2000 (LPDRAWITEMSTRUCT lpDIS)
                        if(state&ODS_CHECKED && nIconNormal<0){
                        }
                        else if(nIconNormal != -1){
-                               standardflag=TRUE;
-                               if(state&ODS_SELECTED && !(state&ODS_GRAYED))selectedflag=TRUE;
-                               else if(state&ODS_GRAYED) disableflag=TRUE;
+                               standardflag=true;
+                               if(state&ODS_SELECTED && !(state&ODS_GRAYED))selectedflag=true;
+                               else if(state&ODS_GRAYED) disableflag=true;
                        }
                }
                else{
@@ -1107,19 +1109,19 @@ BCMenuData *BCMenu::NewODMenu(UINT pos,UINT nFlags,UINT_PTR nID,CString string)
        return(mdata);
 };
 
-BOOL BCMenu::LoadToolbars(const UINT *arID,int n)
+bool BCMenu::LoadToolbars(const UINT *arID,int n)
 {
        ASSERT(arID);
-       BOOL returnflag=TRUE;
+       bool returnflag=true;
        for(int i=0;i<n;++i){
-               if(!LoadToolbar(arID[i]))returnflag=FALSE;
+               if(!LoadToolbar(arID[i]))returnflag=false;
        }
        return(returnflag);
 }
 
-BOOL BCMenu::LoadToolbar(UINT nToolBar)
+bool BCMenu::LoadToolbar(UINT nToolBar)
 {
-       BOOL returnflag=FALSE;
+       bool returnflag=false;
        CToolBar bar;
        
        CWnd* pWnd = AfxGetMainWnd();
@@ -1129,7 +1131,7 @@ BOOL BCMenu::LoadToolbar(UINT nToolBar)
                CImageList imglist;
                imglist.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
                if(AddBitmapToImageList(&imglist,nToolBar)){
-                       returnflag=TRUE;
+                       returnflag=true;
                        for(int i=0;i<bar.GetCount();++i){
                                UINT nID = bar.GetItemID(i); 
                                if(nID && GetMenuState(nID, MF_BYCOMMAND)
@@ -1149,15 +1151,15 @@ BOOL BCMenu::LoadToolbar(UINT nToolBar)
        return(returnflag);
 }
 
-BOOL BCMenu::LoadFromToolBar(UINT nID,UINT nToolBar,int& xoffset)
+bool BCMenu::LoadFromToolBar(UINT nID,UINT nToolBar,int& xoffset)
 {
        // Optimization: avoid creating toolbar window if not needed
        HINSTANCE hInst = AfxFindResourceHandle(MAKEINTRESOURCE(nID), RT_TOOLBAR);
        HRSRC hRsrc = ::FindResource(hInst, MAKEINTRESOURCE(nID), RT_TOOLBAR);
        if (hRsrc == NULL)
-               return FALSE;
+               return false;
 
-       BOOL returnflag=FALSE;
+       bool returnflag=false;
        CToolBar bar;
        
        CWnd* pWnd = AfxGetMainWnd();
@@ -1170,7 +1172,7 @@ BOOL BCMenu::LoadFromToolBar(UINT nID,UINT nToolBar,int& xoffset)
                        int xset;
                        bar.GetButtonInfo(offset,nID,nStyle,xset);
                        if(xset>0)xoffset=xset;
-                       returnflag=TRUE;
+                       returnflag=true;
                }
        }
        return(returnflag);
@@ -1726,9 +1728,9 @@ void BCMenu::GetDisabledBitmap(CBitmap &bmp,COLORREF background)
        ddc.SelectObject(pddcOldBmp);
 }
 
-BOOL BCMenu::AddBitmapToImageList(CImageList *bmplist,UINT nResourceID, BOOL bDisabled/*=FALSE*/)
+bool BCMenu::AddBitmapToImageList(CImageList *bmplist,UINT nResourceID, bool bDisabled/*= false*/)
 {
-       BOOL bReturn=FALSE;
+       bool bReturn=false;
 
        HBITMAP hbmp=LoadSysColorBitmap(nResourceID);
        if(hbmp){
@@ -1737,25 +1739,25 @@ BOOL BCMenu::AddBitmapToImageList(CImageList *bmplist,UINT nResourceID, BOOL bDi
                if (bDisabled)
                        GetDisabledBitmap(bmp);
                if(m_bitmapBackgroundFlag){
-                       if(bmplist->Add(&bmp,m_bitmapBackground)>=0)bReturn=TRUE;
+                       if(bmplist->Add(&bmp,m_bitmapBackground)>=0)bReturn=true;
                }
                else{
-                       if(bmplist->Add(&bmp,GetSysColor(COLOR_3DFACE))>=0)bReturn=TRUE;
+                       if(bmplist->Add(&bmp,GetSysColor(COLOR_3DFACE))>=0)bReturn=true;
                }
        }
        else{ // a hicolor bitmap
                CBitmap mybmp;
                if(mybmp.LoadBitmap(nResourceID)){
-                       hicolor_bitmaps=TRUE;
+                       hicolor_bitmaps=true;
                        if (bDisabled)
                                GetDisabledBitmap(mybmp, GetSysColor(COLOR_3DFACE));
                        else
                                GetTransparentBitmap(mybmp);
                        if(m_bitmapBackgroundFlag){
-                               if(bmplist->Add(&mybmp,m_bitmapBackground)>=0)bReturn=TRUE;
+                               if(bmplist->Add(&mybmp,m_bitmapBackground)>=0)bReturn=true;
                        }
                        else{
-                               if(bmplist->Add(&mybmp,GetSysColor(COLOR_3DFACE))>=0)bReturn=TRUE;
+                               if(bmplist->Add(&mybmp,GetSysColor(COLOR_3DFACE))>=0)bReturn=true;
                        }
                }
        }
index 453f763..35f6d9b 100644 (file)
@@ -93,10 +93,10 @@ public:
        // Functions for loading and applying bitmaps to menus (see example application)
        virtual BOOL LoadMenu(LPCTSTR lpszResourceName);
        virtual BOOL LoadMenu(int nResource);
-       BOOL LoadToolbar(UINT nToolBar);
-       BOOL LoadToolbars(const UINT *arID,int n);
-       BOOL LoadFromToolBar(UINT nID,UINT nToolBar,int& xoffset);
-       BOOL AddBitmapToImageList(CImageList *list,UINT nResourceID,BOOL bDisabled=FALSE);
+       bool LoadToolbar(UINT nToolBar);
+       bool LoadToolbars(const UINT *arID,int n);
+       bool LoadFromToolBar(UINT nID,UINT nToolBar,int& xoffset);
+       bool AddBitmapToImageList(CImageList *list,UINT nResourceID,bool bDisabled=false);
        static HBITMAP LoadSysColorBitmap(int nResourceId);
        
        // functions for appending a menu option, use the AppendMenu call (see above define)
@@ -263,8 +263,8 @@ public:
 
        // Static functions used for handling menu's in the mainframe
        static void UpdateMenu(CMenu *pmenu);
-       static BOOL IsMenu(CMenu *submenu);
-       static BOOL IsMenu(HMENU submenu);
+       static bool IsMenu(CMenu *submenu);
+       static bool IsMenu(HMENU submenu);
        static LRESULT FindKeyboardShortcut(UINT nChar,UINT nFlags,CMenu *pMenu);
 
        // Customizing:
@@ -326,7 +326,7 @@ protected:
        static int m_iconY;
        COLORREF m_bitmapBackground;
        BOOL m_bitmapBackgroundFlag;
-       static BOOL hicolor_bitmaps;
+       static bool hicolor_bitmaps;
        BOOL m_loadmenu;
        static MARGINS m_marginCheck;
        static MARGINS m_marginSeparator;
index 1c5193c..01ff2b4 100644 (file)
@@ -170,7 +170,6 @@ protected:
        void GrabCurrentDimensionsAsOriginal(HWND hwndParent);
        bool DoConstrain(CWnd * pWnd, HWND hwndChild, double fLeftX, double fExpandX, double fAboveY, double fExpandY);
        void InitializeChildConstraintData(HWND hwndParent, Constraint & constraint);
-       BOOL CheckConstraint(HWND hwndChild);
        // handle WM_SIZE
        void Resize(HWND hWnd, UINT nType);
        // handle WM_GETMINMAXINFO
@@ -181,7 +180,6 @@ protected:
        bool OnTtnNeedText(TOOLTIPTEXT * pTTT, LRESULT * plresult);
        bool PaintGrip();
        void ClearMostData();
-       void DeleteAllConstraints();
        // handle WM_DESTROY
        void OnDestroy();
 
index 8c877b4..f86f5b4 100644 (file)
@@ -10,7 +10,7 @@
  * @brief Copies string to clipboard.
  * @param [in] text Text to copy to clipboard.
  * @param [in] currentWindowHandle Handle to current window.
- * @return TRUE if text copying succeeds, FALSE otherwise.
+ * @return `true` if text copying succeeds, `false` otherwise.
  */
 bool PutToClipboard(const String & text, HWND currentWindowHandle)
 {
@@ -42,7 +42,7 @@ bool PutToClipboard(const String & text, HWND currentWindowHandle)
  * @brief Retrieves the string from clipboard.
  * @param [out] text Text copied from clipboard.
  * @param [in] currentWindowHandle Handle to current window.
- * @return TRUE if retrieving the clipboard text succeeds, FALSE otherwise.
+ * @return `true` if retrieving the clipboard text succeeds, `false` otherwise.
  */
 bool GetFromClipboard(String & text, HWND currentWindowHandle)
 {
index fb6a2c8..a468a91 100644 (file)
@@ -40,9 +40,9 @@ void CColorButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
 /** 
  * @brief Sets new button color
  * @param [in] crlFill New color
- * @param [in] bInvalidate If TRUE button is invalidated (causing redraw)
+ * @param [in] bInvalidate If `true` button is invalidated (causing redraw)
  */
-void CColorButton::SetColor(COLORREF clrFill, BOOL bInvalidate /* = TRUE*/)
+void CColorButton::SetColor(COLORREF clrFill, bool bInvalidate /* = true*/)
 {
        m_clrFill = clrFill;
        if (bInvalidate && m_hWnd)
index 5971f37..2892674 100644 (file)
@@ -20,7 +20,7 @@ public:
        CColorButton();
        explicit CColorButton(COLORREF clrFill);
 
-       void SetColor(COLORREF clrFill, BOOL bInvalidate = TRUE);
+       void SetColor(COLORREF clrFill, bool bInvalidate = true);
        COLORREF GetColor() const { return m_clrFill; };
        virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
 };
index 525f28e..4297c77 100644 (file)
@@ -569,13 +569,13 @@ static void unslash(unsigned codepage, std::string &s)
 /**
  * @brief Load language.file
  * @param [in] wLangId 
- * @return TRUE on success, FALSE otherwise.
+ * @return `true` on success, `false` otherwise.
  */
-BOOL CLanguageSelect::LoadLanguageFile(LANGID wLangId, BOOL bShowError)
+bool CLanguageSelect::LoadLanguageFile(LANGID wLangId, bool bShowError /*= false*/)
 {
        String strPath = GetFileName(wLangId);
        if (strPath.empty())
-               return FALSE;
+               return false;
 
        m_hCurrentDll = LoadLibrary(_T("MergeLang.dll"));
        // There is no point in translating error messages about inoperational
@@ -584,7 +584,7 @@ BOOL CLanguageSelect::LoadLanguageFile(LANGID wLangId, BOOL bShowError)
        {
                if (bShowError)
                        AfxMessageBox(_T("Failed to load MergeLang.dll"), MB_ICONSTOP);
-               return FALSE;
+               return false;
        }
        CVersionInfo viInstance(AfxGetInstanceHandle());
        unsigned instanceVerMS = 0;
@@ -600,14 +600,14 @@ BOOL CLanguageSelect::LoadLanguageFile(LANGID wLangId, BOOL bShowError)
                m_hCurrentDll = 0;
                if (bShowError)
                        AfxMessageBox(_T("MergeLang.dll version mismatch"), MB_ICONSTOP);
-               return FALSE;
+               return false;
        }
        HRSRC mergepot = FindResource(m_hCurrentDll, _T("MERGEPOT"), RT_RCDATA);
        if (mergepot == 0)
        {
                if (bShowError)
                        AfxMessageBox(_T("MergeLang.dll is invalid"), MB_ICONSTOP);
-               return FALSE;
+               return false;
        }
        size_t size = SizeofResource(m_hCurrentDll, mergepot);
        const char *data = (const char *)LoadResource(m_hCurrentDll, mergepot);
@@ -676,7 +676,7 @@ BOOL CLanguageSelect::LoadLanguageFile(LANGID wLangId, BOOL bShowError)
                        String str = _T("Failed to load ") + strPath;
                        AfxMessageBox(str.c_str(), MB_ICONSTOP);
                }
-               return FALSE;
+               return false;
        }
        ps = 0;
        msgid.erase();
@@ -764,22 +764,22 @@ BOOL CLanguageSelect::LoadLanguageFile(LANGID wLangId, BOOL bShowError)
                                _T("attempting to read translations from\n") + strPath;
                        AfxMessageBox(str.c_str(), MB_ICONSTOP);
                }
-               return FALSE;
+               return false;
        }
-       return TRUE;
+       return true;
 }
 
 /**
  * @brief Set UI language.
  * @param [in] wLangId 
- * @return TRUE on success, FALSE otherwise.
+ * @return `true` on success, `false` otherwise.
  */
-BOOL CLanguageSelect::SetLanguage(LANGID wLangId, BOOL bShowError)
+bool CLanguageSelect::SetLanguage(LANGID wLangId, bool bShowError /*= false*/)
 {
        if (wLangId == 0)
-               return FALSE;
+               return false;
        if (m_wCurLanguage == wLangId)
-               return TRUE;
+               return true;
        // reset the resource handle
        AfxSetResourceHandle(AfxGetInstanceHandle());
        // free the existing DLL
@@ -800,7 +800,7 @@ BOOL CLanguageSelect::SetLanguage(LANGID wLangId, BOOL bShowError)
        }
        m_wCurLanguage = wLangId;
        SetThreadLocale(MAKELCID(m_wCurLanguage, SORT_DEFAULT));
-       return TRUE;
+       return true;
 }
 
 /**
index 1c3d3a5..9a9995e 100644 (file)
@@ -36,7 +36,7 @@ public:
        String LoadString(UINT) const;
        std::wstring LoadDialogCaption(LPCTSTR lpDialogTemplateID) const;
        std::vector<std::pair<LANGID, String> > GetAvailableLanguages() const;
-       BOOL SetLanguage(LANGID, BOOL bShowError = FALSE);
+       bool SetLanguage(LANGID, bool bShowError = false);
 
 // Implementation data
 private:
@@ -49,5 +49,5 @@ private:
 // Implementation methods
 private:
        String GetFileName(LANGID) const;
-       BOOL LoadLanguageFile(LANGID, BOOL bShowError = FALSE);
+       bool LoadLanguageFile(LANGID, bool bShowError = false);
 };
index bf17c6a..9e485f1 100644 (file)
@@ -133,9 +133,9 @@ BOOL CMDITabBar::OnSelchange(NMHDR* pNMHDR, LRESULT* pResult)
        TC_ITEM tci;
        tci.mask = TCIF_PARAM;
        GetItem(GetCurSel(), &tci);
-       m_bInSelchange = TRUE;
+       m_bInSelchange = true;
        m_pMainFrame->MDIActivate(FromHandle((HWND)tci.lParam));
-       m_bInSelchange = FALSE;
+       m_bInSelchange = false;
 
        return TRUE;
 }
index 45dbde8..b2101d8 100644 (file)
@@ -16,7 +16,7 @@ class CMDITabBar : public CControlBar
 private:
        enum {MDITABBAR_MINTITLELENGTH = 8, MDITABBAR_MAXTITLELENGTH = 64};
 
-       BOOL m_bInSelchange;
+       bool m_bInSelchange;
        CMDIFrameWnd *m_pMainFrame;
        bool m_bMouseTracking;
        bool m_bCloseButtonDown;
@@ -26,7 +26,7 @@ private:
        CFont m_font;
 
 public:
-       CMDITabBar() : m_bInSelchange(FALSE), m_pMainFrame(NULL), m_bMouseTracking(false), m_bCloseButtonDown(false), m_bAutoMaxWidth(true), m_nDraggingTabItemIndex(-1) {}
+       CMDITabBar() : m_bInSelchange(false), m_pMainFrame(NULL), m_bMouseTracking(false), m_bCloseButtonDown(false), m_bAutoMaxWidth(true), m_nDraggingTabItemIndex(-1) {}
        virtual ~CMDITabBar() {}
        BOOL Create(CMDIFrameWnd* pParentWnd);
        void UpdateTabs();
index b56445a..6044608 100644 (file)
@@ -99,7 +99,7 @@ IMPLEMENT_DYNAMIC(CMessageBoxDialog, CDialog)
        // Do the default initialization.
        m_hIcon                         = NULL;
        m_nTimeoutSeconds       = 0;
-       m_bTimeoutDisabled      = FALSE;
+       m_bTimeoutDisabled      = false;
        m_nTimeoutTimer         = 0;
        m_strRegistryKey        = _T("");
        m_nDefaultButton        = IDC_STATIC;
@@ -291,7 +291,7 @@ inline HICON CMessageBoxDialog::GetMessageIcon ( )
  *     screen. All buttons will be disabled, until the countdown is finished.
  *     After that, the user can click any button.
  */
-void CMessageBoxDialog::SetTimeout ( UINT nSeconds, BOOL bDisabled )
+void CMessageBoxDialog::SetTimeout ( UINT nSeconds, bool bDisabled /*= false*/)
 {
        // Save the settings for the timeout.
        m_nTimeoutSeconds       = nSeconds;
@@ -310,7 +310,7 @@ inline UINT CMessageBoxDialog::GetTimeoutSeconds ( )
 /*
  *     Method for retrieving whether a timeout is disabled.
  */
-inline BOOL CMessageBoxDialog::GetTimeoutDisabled ( )
+inline bool CMessageBoxDialog::GetTimeoutDisabled ( )
 {
        // Return the flag whether the timeout is disabled.
        return m_bTimeoutDisabled;
@@ -465,7 +465,7 @@ INT_PTR CMessageBoxDialog::DoModal ( )
 void CMessageBoxDialog::EndDialog ( int nResult )
 {
        // Create a variable for storing the state of the checkbox.
-       BOOL bDontDisplayAgain = FALSE;
+       bool bDontDisplayAgain = false;
 
        // Try to access the checkbox control.
        CWnd* pCheckboxWnd = GetDlgItem(IDCHECKBOX);
@@ -920,8 +920,8 @@ CString CMessageBoxDialog::GenerateRegistryKey ( )
  *     This method adds a button to the list of buttons, which will be created in
  *     the dialog, but it will not create the button control itself.
  */
-void CMessageBoxDialog::AddButton ( UINT nID, UINT nTitle, BOOL bIsDefault,
-       BOOL bIsEscape )
+void CMessageBoxDialog::AddButton ( UINT nID, UINT nTitle, bool bIsDefault /*= false*/,
+       bool bIsEscape /*= false*/ )
 {
        // Create a new structure to store the button information.
        MSGBOXBTN bButton = { nID, nTitle };
index 1e753fd..02aa106 100644 (file)
@@ -142,13 +142,13 @@ public:
        HICON GetMessageIcon ( );
 
        // Method for setting a timeout.
-       void SetTimeout ( UINT nSeconds, BOOL bDisabled = FALSE );
+       void SetTimeout ( UINT nSeconds, bool bDisabled = false );
 
        // Method for retrieving the seconds for the timeout.
        UINT GetTimeoutSeconds ( );
 
        // Method for retrieving whether a timeout is disabled.
-       BOOL GetTimeoutDisabled ( );
+       bool GetTimeoutDisabled ( );
 
        // Method for retrieving the former result of the message box from the registry.
        int GetFormerResult();
@@ -213,7 +213,7 @@ private:
        HICON           m_hIcon;                        // Icon to be displayed in the dialog.
 
        UINT            m_nTimeoutSeconds;      // Seconds for a timeout.
-       BOOL            m_bTimeoutDisabled;     // Flag whether the timeout is disabled.
+       bool            m_bTimeoutDisabled;     // Flag whether the timeout is disabled.
        UINT_PTR        m_nTimeoutTimer;        // Timer for the timeout.
 
        CString         m_strRegistryKey;       // Entry for storing the result in the
@@ -264,8 +264,8 @@ private:
        CString GenerateRegistryKey ( );
 
        // Method for adding a button to the list of buttons.
-       void AddButton ( UINT nID, UINT nTitle, BOOL bIsDefault = FALSE,
-               BOOL bIsEscape = FALSE );
+       void AddButton ( UINT nID, UINT nTitle, bool bIsDefault = false,
+               bool bIsEscape = false );
 
        // Methods for converting a dialog units to a pixel values.
        int XDialogUnitToPixel ( int x );
index 48794a5..1776d7c 100644 (file)
@@ -28,7 +28,7 @@ CPicture::~CPicture()
 //////////////////
 // Load from resource. Looks for "IMAGE" type.
 //
-BOOL CPicture::Load(UINT nIDRes)
+bool CPicture::Load(UINT nIDRes)
 {
        // find resource in resource file
        HINSTANCE hInst = AfxGetInstanceHandle();
@@ -36,17 +36,17 @@ BOOL CPicture::Load(UINT nIDRes)
                MAKEINTRESOURCE(nIDRes),
                TEXT("IMAGE")); // type
        if (!hRsrc)
-               return FALSE;
+               return false;
 
        // load resource into memory
        DWORD len = SizeofResource(hInst, hRsrc);
        BYTE* lpRsrc = (BYTE*)LoadResource(hInst, hRsrc);
        if (!lpRsrc)
-               return FALSE;
+               return false;
 
        // create memory file and load it
        CMemFile file(lpRsrc, len);
-       BOOL bRet = Load(file);
+       bool bRet = Load(file);
        FreeResource(hRsrc);
 
        return bRet;
@@ -55,12 +55,12 @@ BOOL CPicture::Load(UINT nIDRes)
 //////////////////
 // Load from path name.
 //
-BOOL CPicture::Load(LPCTSTR pszPathName)
+bool CPicture::Load(LPCTSTR pszPathName)
 {
        CFile file;
        if (!file.Open(pszPathName, CFile::modeRead|CFile::shareDenyWrite))
-               return FALSE;
-       BOOL bRet = Load(file);
+               return false;
+       bool bRet = Load(file);
        file.Close();
        return bRet;
 }
@@ -68,7 +68,7 @@ BOOL CPicture::Load(LPCTSTR pszPathName)
 //////////////////
 // Load from CFile
 //
-BOOL CPicture::Load(CFile& file)
+bool CPicture::Load(CFile& file)
 {
        CArchive ar(&file, CArchive::load | CArchive::bNoFlushOnDelete);
        return Load(ar);
@@ -78,7 +78,7 @@ BOOL CPicture::Load(CFile& file)
 // Load from archive--create stream and load from stream.
 //
 // CArchiveStream Doesn't compile with VS2003.Net
-BOOL CPicture::Load(CArchive& ar)
+bool CPicture::Load(CArchive& ar)
 {
        CArchiveStream arcstream(&ar);
        return Load((IStream*)&arcstream);
@@ -89,19 +89,19 @@ BOOL CPicture::Load(CArchive& ar)
 // Load from stream (IStream). This is the one that really does it: call
 // OleLoadPicture to do the work.
 //
-BOOL CPicture::Load(IStream* pstm)
+bool CPicture::Load(IStream* pstm)
 {
        Free();
        HRESULT hr = OleLoadPicture(pstm, 0, FALSE,
                IID_IPicture, (void**)&m_spIPicture);
        ASSERT(SUCCEEDED(hr) && m_spIPicture);  
-       return TRUE;
+       return true;
 }
 
 //////////////////
 // Render to device context. Covert to HIMETRIC for IPicture.
 //
-BOOL CPicture::Render(CDC* pDC, CRect rc, LPCRECT prcMFBounds) const
+bool CPicture::Render(CDC* pDC, CRect rc, LPCRECT prcMFBounds) const
 {
        ASSERT(pDC);
 
@@ -115,7 +115,7 @@ BOOL CPicture::Render(CDC* pDC, CRect rc, LPCRECT prcMFBounds) const
        m_spIPicture->Render(*pDC, rc.left, rc.top, rc.Width(), rc.Height(),
                0, hmHeight, hmWidth, -hmHeight, prcMFBounds);
 
-       return TRUE;
+       return true;
 }
 
 //////////////////
index 6a5adba..015d5cb 100644 (file)
@@ -17,14 +17,14 @@ public:
        ~CPicture();
 
        // Load frm various sosurces
-       BOOL Load(UINT nIDRes);
-       BOOL Load(LPCTSTR pszPathName);
-       BOOL Load(CFile& file);
-       BOOL Load(CArchive& ar);
-       BOOL Load(IStream* pstm);
+       bool Load(UINT nIDRes);
+       bool Load(LPCTSTR pszPathName);
+       bool Load(CFile& file);
+       bool Load(CArchive& ar);
+       bool Load(IStream* pstm);
 
        // render to device context
-       BOOL Render(CDC* pDC, CRect rc=CRect(0,0,0,0),
+       bool Render(CDC* pDC, CRect rc=CRect(0,0,0,0),
                LPCRECT prcMFBounds=NULL) const;
 
        CSize GetImageSize(CDC* pDC=NULL) const;
index 7585652..f50f681 100644 (file)
@@ -324,12 +324,12 @@ void CPreferencesDlg::SetSyntaxColors(SyntaxColors *pColors)
 void CPreferencesDlg::OnImportButton()
 {
        String s;
-       if (SelectFile(GetSafeHwnd(), s, TRUE, NULL, _("Select file for import"), _("Options files (*.ini)|*.ini|All Files (*.*)|*.*||")))
+       if (SelectFile(GetSafeHwnd(), s, true, NULL, _("Select file for import"), _("Options files (*.ini)|*.ini|All Files (*.*)|*.*||")))
        {
                if (m_pOptionsMgr->ImportOptions(s) == COption::OPT_OK)
                {
                        Options::SyntaxColors::Load(m_pOptionsMgr, m_pSyntaxColors);
-                       ReadOptions(TRUE);
+                       ReadOptions(true);
                        LangMessageBox(IDS_OPT_IMPORT_DONE, MB_ICONINFORMATION);
                }
                else
@@ -343,7 +343,7 @@ void CPreferencesDlg::OnImportButton()
 void CPreferencesDlg::OnExportButton()
 {
        String settingsFile;
-       if (SelectFile(GetSafeHwnd(), settingsFile, FALSE, NULL, _("Select file for export"),
+       if (SelectFile(GetSafeHwnd(), settingsFile, false, NULL, _("Select file for export"),
                _("Options files (*.ini)|*.ini|All Files (*.*)|*.*||")))
        {
                // Add settings file extension if it is missing
index c195997..375ada4 100644 (file)
@@ -116,7 +116,7 @@ LRESULT CPropertyPageHost::OnGetCurrentPageHwnd(WPARAM wParam, LPARAM lParam)
        return pActive ? (LRESULT)pActive->GetSafeHwnd() : NULL;
 }
 
-BOOL CPropertyPageHost::SetActivePage(int nIndex, BOOL bAndFocus)
+bool CPropertyPageHost::SetActivePage(int nIndex, bool bAndFocus /*= true*/)
 {
        if (nIndex < 0 || nIndex >= m_aPages.GetSize())
                return FALSE;
@@ -178,15 +178,15 @@ BOOL CPropertyPageHost::SetActivePage(int nIndex, BOOL bAndFocus)
                pFocus->SetFocus();
 
        m_nSelIndex = nIndex;
-       return TRUE;
+       return true;
 }
 
-BOOL CPropertyPageHost::SetActivePage(CPropertyPage* pPage, BOOL bAndFocus)
+bool CPropertyPageHost::SetActivePage(CPropertyPage* pPage, bool bAndFocus /*= true*/)
 {
        return SetActivePage(FindPage(pPage));
 }
 
-BOOL CPropertyPageHost::AddPage(CPropertyPage* pPage, LPCTSTR szTitle, DWORD dwItemData)
+bool CPropertyPageHost::AddPage(CPropertyPage* pPage, LPCTSTR szTitle, DWORD dwItemData)
 {
        if (!pPage || !pPage->IsKindOf(RUNTIME_CLASS(CPropertyPage)))
                return FALSE;
index c06ee83..23da419 100644 (file)
@@ -37,9 +37,9 @@ public:
        
        int GetActiveIndex();
        CPropertyPage* GetActivePage();
-       BOOL AddPage(CPropertyPage* pPage, LPCTSTR szTitle = NULL, DWORD dwItemData = 0);
-       BOOL SetActivePage(int nIndex, BOOL bAndFocus = TRUE);
-       BOOL SetActivePage(CPropertyPage* pPage, BOOL bAndFocus = TRUE);
+       bool AddPage(CPropertyPage* pPage, LPCTSTR szTitle = NULL, DWORD dwItemData = 0);
+       bool SetActivePage(int nIndex, bool bAndFocus = true);
+       bool SetActivePage(CPropertyPage* pPage, bool bAndFocus = true);
        int GetPageCount() { return (int) m_aPages.GetSize(); }
        CString GetPageTitle(int nIndex);
        DWORD GetPageItemData(int nIndex);
index 3e31e1f..9e654b1 100644 (file)
@@ -120,12 +120,12 @@ LONG CRegKeyEx::WriteDword(LPCTSTR pszKey, DWORD dwVal)
 }
 
 /**
- * @brief Write BOOL value to registry.
+ * @brief Write `bool` value to registry.
  * @param [in] pszKey Path to actual registry key to access.
  * @param [in] bVal Value to write.
  * @return ERROR_SUCCESS on success, or error value.
  */
-LONG CRegKeyEx::WriteBool(LPCTSTR pszKey, BOOL bVal)
+LONG CRegKeyEx::WriteBool(LPCTSTR pszKey, bool bVal)
 {
        assert(m_hKey);
        assert(pszKey);
@@ -269,12 +269,12 @@ float CRegKeyEx::ReadFloat(LPCTSTR pszKey, float defval)
 }
 
 /**
- * @brief Read BOOL value from registry.
+ * @brief Read `bool` value from registry.
  * @param [in] pszKey Path to actual registry key to access.
  * @param [in] defval Default value to return if reading fails.
- * @return Read BOOL value.
+ * @return Read `bool` value.
  */
-BOOL CRegKeyEx::ReadBool(LPCTSTR pszKey, BOOL defval)
+bool CRegKeyEx::ReadBool(LPCTSTR pszKey, bool defval)
 {
        assert(m_hKey);
        assert(pszKey);
index b702b57..ffca774 100644 (file)
@@ -30,12 +30,12 @@ public:
 
        LONG WriteDword (LPCTSTR pszKey, DWORD dwVal);
        LONG WriteString (LPCTSTR pszKey, LPCTSTR pszVal);
-       LONG WriteBool (LPCTSTR pszKey, BOOL bVal);
+       LONG WriteBool (LPCTSTR pszKey, bool bVal);
        LONG WriteFloat (LPCTSTR pszKey, float fVal);
 
        DWORD ReadDword (LPCTSTR pszKey, DWORD defval);
        float ReadFloat (LPCTSTR pszKey, float defval);
-       BOOL ReadBool(LPCTSTR pszKey, BOOL defval);
+       bool ReadBool(LPCTSTR pszKey, bool defval);
        LONG ReadLong (LPCTSTR pszKey, LONG defval);
        UINT ReadUint (LPCTSTR pszKey, UINT defval);
        UINT ReadInt (LPCTSTR pszKey, int defval);
index c778c94..9dbb2c1 100644 (file)
@@ -529,7 +529,7 @@ int CRegOptionsMgr::ExportOptions(const String& filename, const bool bHexColor /
                        strVal = value.GetString();
                }
 
-               BOOL bRet = WritePrivateProfileString(_T("WinMerge"), name.c_str(),
+               bool bRet = !!WritePrivateProfileString(_T("WinMerge"), name.c_str(),
                                strVal.c_str(), filename.c_str());
                if (!bRet)
                        retVal = COption::OPT_ERR;
@@ -567,9 +567,9 @@ int CRegOptionsMgr::ImportOptions(const String& filename)
                varprop::VariantValue value = Get(pKey);
                if (value.GetType() == varprop::VT_BOOL)
                {
-                       BOOL boolVal = GetPrivateProfileInt(_T("WinMerge"), pKey, 0, filename.c_str());
-                       value.SetBool(boolVal == 1);
-                       SaveOption(pKey, boolVal == 1);
+                       bool boolVal = GetPrivateProfileInt(_T("WinMerge"), pKey, 0, filename.c_str()) == 1;
+                       value.SetBool(boolVal);
+                       SaveOption(pKey, boolVal);
                }
                else if (value.GetType() == varprop::VT_INT)
                {
index 3f20dbc..c2fa87e 100644 (file)
@@ -178,10 +178,10 @@ bool ShellFileOperations::Run()
        if (ret == 0x75) // DE_OPCANCELLED
                m_isCanceled = true;
 
-       BOOL anyAborted = fileop.fAnyOperationsAborted;
+       bool anyAborted = !!fileop.fAnyOperationsAborted;
 
        // SHFileOperation returns 0 when succeeds
-       if (ret == 0 && anyAborted == FALSE)
+       if (ret == 0 && !anyAborted)
                return true;
        return false;
 }
index b40fe76..0e48526 100644 (file)
@@ -17,7 +17,7 @@ BEGIN_MESSAGE_MAP(CSortHeaderCtrl, CHeaderCtrl)
        //}}AFX_MSG_MAP
 END_MESSAGE_MAP()
 
-CSortHeaderCtrl::CSortHeaderCtrl() : m_bSortAsc(TRUE), m_nSortCol(-1)
+CSortHeaderCtrl::CSortHeaderCtrl() : m_bSortAsc(true), m_nSortCol(-1)
 {
 }
 
@@ -25,7 +25,7 @@ CSortHeaderCtrl::~CSortHeaderCtrl()
 {
 }
 
-int CSortHeaderCtrl::SetSortImage(int nCol, BOOL bAsc)
+int CSortHeaderCtrl::SetSortImage(int nCol, bool bAsc)
 {
        int nPrevCol = m_nSortCol;
 
index ffe7f2d..99be32a 100644 (file)
@@ -19,7 +19,7 @@ public:
 // Attributes
 protected:
        int     m_nSortCol;
-       BOOL    m_bSortAsc;
+       bool    m_bSortAsc;
 
 // Operations
 public:
@@ -29,7 +29,7 @@ public:
        //{{AFX_VIRTUAL(CSortHeaderCtrl)
        //}}AFX_VIRTUAL
 
-       virtual int     SetSortImage(int nCol, BOOL bAsc);
+       virtual int     SetSortImage(int nCol, bool bAsc);
 
 // Implementation
 public:
index 7e241f8..fe84411 100644 (file)
@@ -32,10 +32,10 @@ IMPLEMENT_DYNCREATE(CSplitterWndEx, CSplitterWnd)
 
 CSplitterWndEx::CSplitterWndEx()
 {
-       m_bBarLocked = FALSE;
-       m_bResizePanes = FALSE;
-       m_bAutoResizePanes = FALSE;
-       m_bHideBorders = FALSE;
+       m_bBarLocked = false;
+       m_bResizePanes = false;
+       m_bAutoResizePanes = false;
+       m_bHideBorders = false;
 }
 
 CSplitterWndEx::~CSplitterWndEx()
@@ -295,8 +295,8 @@ void CSplitterWndEx::FlipSplit()
        std::vector<CWnd *> pColPanes(nCols);
        std::vector<CWnd *> pRowPanes(nRows);
 
-       BOOL bHasVScroll = m_bHasHScroll;
-       BOOL bHasHScroll = m_bHasVScroll;
+       bool bHasVScroll = m_bHasHScroll;
+       bool bHasHScroll = m_bHasVScroll;
 
        CScrollBar *pBar;
        int pane;
index 4d9222b..608cd05 100644 (file)
@@ -12,10 +12,10 @@ class CSplitterWndEx : public CSplitterWnd
 public:
        CSplitterWndEx();
        virtual ~CSplitterWndEx();
-       void LockBar(BOOL bState=TRUE){m_bBarLocked=bState;};
-       void ResizablePanes(BOOL bState=TRUE){m_bResizePanes=bState;};
-       void AutoResizePanes(BOOL bState=TRUE){m_bAutoResizePanes=bState;};
-       void HideBorders(BOOL bHide)
+       void LockBar(bool bState=true){m_bBarLocked=bState;};
+       void ResizablePanes(bool bState=true){m_bResizePanes=bState;};
+       void AutoResizePanes(bool bState=true){m_bAutoResizePanes=bState;};
+       void HideBorders(bool bHide)
        {
                m_cxBorder = m_cyBorder = bHide ? 0 : 2;
                m_bHideBorders = bHide;
@@ -31,10 +31,10 @@ public:
        CScrollBar* GetScrollBarCtrl(CWnd* pWnd, int nBar) const;
 
 private:
-       BOOL m_bBarLocked;
-       BOOL m_bResizePanes;
-       BOOL m_bAutoResizePanes;
-       BOOL m_bHideBorders;
+       bool m_bBarLocked;
+       bool m_bResizePanes;
+       bool m_bAutoResizePanes;
+       bool m_bHideBorders;
 
 protected:
        afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
index 0237c72..c9bb52b 100644 (file)
@@ -377,8 +377,8 @@ void UniMemFile::SetBom(bool bom)
 /**
  * @brief Read one (DOS or UNIX or Mac) line. Do not include eol chars.
  * @param [out] line Line read.
- * @param [out] lossy TRUE if there were lossy encoding.
- * @return TRUE if there is more lines to read, TRUE when last line is read.
+ * @param [out] lossy `true` if there were lossy encoding.
+ * @return `true` if there is more lines to read, `false` when last line is read.
  */
 bool UniMemFile::ReadString(String & line, bool * lossy)
 {
index d1b05d8..9726695 100644 (file)
@@ -29,10 +29,10 @@ struct LANGUAGEANDCODEPAGE
  * not several strings there are. This saves some time.
  * @param [in] bVersionOnly If TRUE only version numbers are read.
  */
-CVersionInfo::CVersionInfo(BOOL bVersionOnly)
+CVersionInfo::CVersionInfo(bool bVersionOnly)
 : m_wLanguage(0)
 , m_bVersionOnly(bVersionOnly)
-, m_bDllVersion(FALSE)
+, m_bDllVersion(false)
 {
        GetVersionInfo();
 }
@@ -48,8 +48,8 @@ CVersionInfo::CVersionInfo(BOOL bVersionOnly)
  */
 CVersionInfo::CVersionInfo(WORD wLanguage)
 : m_wLanguage(wLanguage)
-, m_bVersionOnly(FALSE)
-, m_bDllVersion(FALSE)
+, m_bVersionOnly(false)
+, m_bDllVersion(false)
 {
        GetVersionInfo();
 }
@@ -60,9 +60,9 @@ CVersionInfo::CVersionInfo(WORD wLanguage)
  * @param [in] bDllVersion If TRUE queries DLL version.
  */
 CVersionInfo::CVersionInfo(LPCTSTR szFileToVersion, 
-                                                  BOOL bDllVersion)
+                                                  bool bDllVersion)
 : m_wLanguage(0)
-, m_bVersionOnly(FALSE)
+, m_bVersionOnly(false)
 , m_bDllVersion(bDllVersion)
 {
        if (szFileToVersion != NULL)
@@ -80,8 +80,8 @@ CVersionInfo::CVersionInfo(LPCTSTR szFileToVersion /* = NULL*/,
                                                   LPCTSTR szLanguage /* = NULL*/,
                                                   LPCTSTR szCodepage /* = NULL*/)
 : m_wLanguage(0)
-, m_bVersionOnly(FALSE)
-, m_bDllVersion(FALSE)
+, m_bVersionOnly(false)
+, m_bDllVersion(false)
 {
        if (szFileToVersion != NULL)
                m_strFileName = szFileToVersion;
@@ -98,8 +98,8 @@ CVersionInfo::CVersionInfo(LPCTSTR szFileToVersion /* = NULL*/,
  */
 CVersionInfo::CVersionInfo(HINSTANCE hModule)
 : m_wLanguage(0)
-, m_bVersionOnly(FALSE)
-, m_bDllVersion(FALSE)
+, m_bVersionOnly(false)
+, m_bDllVersion(false)
 {
        TCHAR szFileName[MAX_PATH];
        GetModuleFileName(hModule, szFileName, MAX_PATH);
@@ -254,17 +254,17 @@ String CVersionInfo::GetFixedFileVersion()
  * This function returns version number given as two DWORDs.
  * @param [out] versionMS High DWORD for version number.
  * @param [out] versionLS Low DWORD for version number.
- * @return TRUE if version info was found, FALSE otherwise.
+ * @return `true` if version info was found, `false` otherwise.
  */
-BOOL CVersionInfo::GetFixedFileVersion(unsigned& versionMS, unsigned& versionLS)
+bool CVersionInfo::GetFixedFileVersion(unsigned& versionMS, unsigned& versionLS)
 {
        if (m_bVersionFound)
        {
                versionMS = m_FixedFileInfo.dwFileVersionMS;
                versionLS = m_FixedFileInfo.dwFileVersionLS;
-               return TRUE;
+               return true;
        }
-       return FALSE;
+       return false;
 }
 
 /** 
@@ -300,12 +300,12 @@ void CVersionInfo::GetVersionInfo()
        DWORD dwVerInfoSize = ::GetFileVersionInfoSize(szFileName, &dwVerHnd);
        if (dwVerInfoSize)
        {
-               m_bVersionFound = TRUE;
+               m_bVersionFound = true;
                m_pVffInfo.reset(new BYTE[dwVerInfoSize]);
                if (::GetFileVersionInfo(szFileName, 0, dwVerInfoSize, m_pVffInfo.get()))
                {
                        GetFixedVersionInfo();
-                       if (m_bVersionOnly == FALSE)
+                       if (!m_bVersionOnly)
                                QueryStrings();
                }
        }
@@ -385,7 +385,7 @@ void CVersionInfo::QueryValue(LPCTSTR szId, String& s)
        assert(m_pVffInfo != NULL);
        LPTSTR   lpVersion;                     // String pointer to 'version' text
        UINT    uVersionLen;
-       BOOL    bRetCode;
+       bool    bRetCode;
 
        TCHAR szSelector[256];
        StringCchPrintf(szSelector, countof(szSelector) - 1,
@@ -413,7 +413,7 @@ void CVersionInfo::GetFixedVersionInfo()
 {
        VS_FIXEDFILEINFO * pffi;
        UINT len = sizeof(*pffi);
-       BOOL bRetCode = VerQueryValue(
+       bool bRetCode = VerQueryValue(
                (LPVOID)m_pVffInfo.get(), _T("\\"), (LPVOID *)&pffi, &len);
        if (bRetCode)
                m_FixedFileInfo = *pffi;
@@ -432,9 +432,9 @@ void CVersionInfo::GetFixedVersionInfo()
  * find existing version info data.
  * @param [in] wLanguage Language ID for which we need matching codepage.
  * @param [out] wCodePage Found codepage.
- * @return TRUE if language was found from version info block.
+ * @return `true` if language was found from version info block.
  */
-BOOL CVersionInfo::GetCodepageForLanguage(WORD wLanguage, WORD & wCodePage)
+bool CVersionInfo::GetCodepageForLanguage(WORD wLanguage, WORD & wCodePage)
 {
        LANGUAGEANDCODEPAGE *lpTranslate;
        UINT cbTranslate;
@@ -449,13 +449,13 @@ BOOL CVersionInfo::GetCodepageForLanguage(WORD wLanguage, WORD & wCodePage)
 
        const int nLangCount = cbTranslate / sizeof(LANGUAGEANDCODEPAGE);
        int i = 0;
-       BOOL bFound = FALSE;
-       while (bFound == FALSE && i < nLangCount)
+       bool bFound = false;
+       while (!bFound && i < nLangCount)
        {
                if (lpTranslate[i].wLanguage == wLanguage)
                {
                        wCodePage = lpTranslate[i].wCodePage;
-                       bFound = TRUE;
+                       bFound = true;
                }
                else
                        ++i;
index 8b82be6..59e403e 100644 (file)
@@ -13,7 +13,7 @@
  * @brief Class providing access to version information of a file.
  * This class reads version information block from a file. Version information
  * consists of version numbers, copyright, descriptions etc. Since that is
- * many strings to read, there is constructor taking BOOL parameter and
+ * many strings to read, there is constructor taking `bool` parameter and
  * only reading version numbers. That constructor is suggested to be used
  * if string information is not needed.
  */
@@ -22,10 +22,10 @@ class CVersionInfo
 private:
        VS_FIXEDFILEINFO m_FixedFileInfo; /**< Fixed file information */
        std::unique_ptr<BYTE[]> m_pVffInfo; /**< Pointer to version information block */
-       BOOL m_bVersionOnly; /**< Ask version numbers only */
-       BOOL m_bDllVersion; /**< Dll file version is being queried */
+       bool m_bVersionOnly; /**< Ask version numbers only */
+       bool m_bDllVersion; /**< Dll file version is being queried */
        WORD m_wLanguage; /**< Language-ID to use (if given) */
-       BOOL m_bVersionFound; /**< Was version info found from file? */
+       bool m_bVersionFound; /**< Was version info found from file? */
 
        String m_strFileName;
        String m_strLanguage;
@@ -43,10 +43,10 @@ private:
        String m_strPrivateBuild;
 
 public:
-       explicit CVersionInfo(BOOL bVersionOnly);
+       explicit CVersionInfo(bool bVersionOnly);
        explicit CVersionInfo(WORD wLanguage);
        CVersionInfo(LPCTSTR szFileToVersion,
-                                  BOOL bDllVersion);
+                                  bool bDllVersion);
        CVersionInfo(LPCTSTR szFileToVersion = NULL,
                                   LPCTSTR szLanguage = NULL,
                                   LPCTSTR szCodepage = NULL);
@@ -65,12 +65,12 @@ public:
        String GetFixedProductVersion();
        String GetFixedFileVersion();
        DLLVERSIONINFO m_dvi;
-       BOOL GetFixedFileVersion(unsigned& versionMS, unsigned& versionLS);
+       bool GetFixedFileVersion(unsigned& versionMS, unsigned& versionLS);
 
 protected:
        void GetVersionInfo();
        void GetFixedVersionInfo();
        void QueryStrings();
        void QueryValue(LPCTSTR szId, String& s);
-       BOOL GetCodepageForLanguage(WORD wLanguage, WORD & wCodePage);
+       bool GetCodepageForLanguage(WORD wLanguage, WORD & wCodePage);
 };
index ca254da..078d067 100644 (file)
@@ -1,4 +1,4 @@
-/* File:       lwdisp.c - light weight dispatch API
+/* File:       lwdisp.h - light weight dispatch API
  * Author:     Jochen Tucht 2003/01/09
  *                     Copyright (C) 2003 herbert dahm datensysteme GmbH
  *
index 2fa4b91..255c401 100644 (file)
@@ -31,7 +31,7 @@ private:
        CBitmap*        m_oldBitmap;    // bitmap originally found in CMemDC
        CDC*            m_pDC;                  // Saves CDC passed in constructor
        CRect           m_rect;                 // Rectangle of drawing area.
-       BOOL            m_bMemDC;               // TRUE if CDC really is a Memory DC.
+       bool            m_bMemDC;               // `true` if CDC really is a Memory DC.
 public:
        
        CMyMemDC(CDC* pDC, const CRect* pRect = NULL) : CDC()
index 02e2807..38a8e4e 100644 (file)
@@ -103,7 +103,7 @@ public:
        /// return number of valid transformation until now
        int & GetNChangedValid() { return m_nChangedValid; }
        /// return format of original data
-       int GetOriginalMode() const { return m_bOriginalIsUnicode; }
+       bool GetOriginalMode() const { return m_bOriginalIsUnicode; }
 
 private:
        void Initialize();
@@ -112,7 +112,7 @@ private:
 // Implementation data
 private:
        // original data mode ANSI/UNICODE
-       int m_bOriginalIsUnicode;
+       bool m_bOriginalIsUnicode;
 
        // current format of data : BUFFER/FILE, ANSI/UNICODE
        bool m_bCurrentIsUnicode;
index 059ed06..1057b4e 100644 (file)
@@ -49,7 +49,7 @@ int CALLBACK EnumFontFamProc(ENUMLOGFONT FAR *lpelf,
  
 CSizingControlBarCF::CSizingControlBarCF()
 {
-    m_bActive = FALSE;
+    m_bActive = false;
 
     CDC dc;
     dc.CreateCompatibleDC(NULL);
@@ -72,15 +72,15 @@ void CSizingControlBarCF::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHnd
     if (!HasGripper())
         return;
 
-    BOOL bNeedPaint = FALSE;
+    bool bNeedPaint = false;
 
     CWnd* pFocus = GetFocus();
-    BOOL bActiveOld = m_bActive;
+    bool bActiveOld = m_bActive;
 
     m_bActive = (pFocus->GetSafeHwnd() && IsChild(pFocus));
 
     if (m_bActive != bActiveOld)
-        bNeedPaint = TRUE;
+        bNeedPaint = true;
 
     if (bNeedPaint)
         SendMessage(WM_NCPAINT);
@@ -92,7 +92,7 @@ void CSizingControlBarCF::NcPaintGripper(CDC* pDC, CRect rcClient)
         return;
 
     // compute the caption rectangle
-    BOOL bHorz = IsHorzDocked();
+    bool bHorz = IsHorzDocked();
     CRect rcGrip = rcClient;
     const int lpx = pDC->GetDeviceCaps(LOGPIXELSX);
     auto pointToPixel = [lpx](double point) { return static_cast<int>(point * lpx / 72); };
@@ -173,7 +173,7 @@ void CSizingControlBarCF::NcPaintGripper(CDC* pDC, CRect rcClient)
     // draw the caption text - first select a font
     CFont font;
     LOGFONT lf;
-    BOOL bFont = font.CreatePointFont(85/*8.5 points*/, m_sFontFace);
+    bool bFont = !!font.CreatePointFont(85/*8.5 points*/, m_sFontFace);
     if (bFont)
     {
         // get the text color
index c6a9db2..25cfcdf 100644 (file)
@@ -53,7 +53,7 @@ protected:
     virtual void NcPaintGripper(CDC* pDC, CRect rcClient);
 
 protected:
-    BOOL    m_bActive; // a child has focus
+    bool    m_bActive; // a child has focus
     CString m_sFontFace;
 
 // Generated message map functions
index 36b9a45..d7d3bee 100644 (file)
@@ -82,7 +82,7 @@ void CSizingControlBarG::NcCalcClient(LPRECT pRc, UINT nDockBarID)
 
     CRect rc(pRc); // the client rect as calculated by the base class
 
-    BOOL bHorz = (nDockBarID == AFX_IDW_DOCKBAR_TOP) ||
+    bool bHorz = (nDockBarID == AFX_IDW_DOCKBAR_TOP) ||
                  (nDockBarID == AFX_IDW_DOCKBAR_BOTTOM);
 
     const int lpx = CClientDC(this).GetDeviceCaps(LOGPIXELSX);
@@ -116,7 +116,7 @@ void CSizingControlBarG::NcPaintGripper(CDC* pDC, CRect rcClient)
     auto pointToPixel = [lpx](double point) { return static_cast<int>(point * lpx / 72); };
     CRect gripper = rcClient;
     CRect rcbtn(m_biHide.ptOrg, CSize(pointToPixel(m_biHide.dblBoxSize), pointToPixel(m_biHide.dblBoxSize)));
-    BOOL bHorz = IsHorzDocked();
+    bool bHorz = IsHorzDocked();
 
     gripper.DeflateRect(1, 1);
     if (bHorz)
@@ -174,17 +174,17 @@ void CSizingControlBarG::OnUpdateCmdUI(CFrameWnd* pTarget,
     if (!HasGripper())
         return;
 
-    BOOL bNeedPaint = FALSE;
+    bool bNeedPaint = false;
 
     CPoint pt;
     ::GetCursorPos(&pt);
-    BOOL bHit = (OnNcHitTest(pt) == HTCLOSE);
-    BOOL bLButtonDown = (::GetKeyState(VK_LBUTTON) < 0);
+    bool bHit = (OnNcHitTest(pt) == HTCLOSE);
+    bool bLButtonDown = (::GetKeyState(VK_LBUTTON) < 0);
 
-    BOOL bWasPushed = m_biHide.bPushed;
+    bool bWasPushed = m_biHide.bPushed;
     m_biHide.bPushed = bHit && bLButtonDown;
 
-    BOOL bWasRaised = m_biHide.bRaised;
+    bool bWasRaised = m_biHide.bRaised;
     m_biHide.bRaised = bHit && !bLButtonDown;
 
     bNeedPaint |= (m_biHide.bPushed ^ bWasPushed) ||
@@ -199,8 +199,8 @@ void CSizingControlBarG::OnUpdateCmdUI(CFrameWnd* pTarget,
 
 CSCBButton::CSCBButton()
 {
-    bRaised = FALSE;
-    bPushed = FALSE;
+    bRaised = false;
+    bPushed = false;
 }
 
 void CSCBButton::Paint(CDC* pDC)
@@ -231,13 +231,13 @@ void CSCBButton::Paint(CDC* pDC)
     pDC->SetTextColor(clrOldTextColor);
 }
 
-BOOL CSizingControlBarG::HasGripper() const
+bool CSizingControlBarG::HasGripper() const
 {
 #if defined(_SCB_MINIFRAME_CAPTION) || !defined(_SCB_REPLACE_MINIFRAME)
     // if the miniframe has a caption, don't display the gripper
     if (IsFloating())
-        return FALSE;
+        return false;
 #endif //_SCB_MINIFRAME_CAPTION
 
-    return TRUE;
+    return true;
 }
index 614939a..7fb1159 100644 (file)
@@ -47,8 +47,8 @@ public:
     void Move(CPoint ptTo) {ptOrg = ptTo; };
     void Paint(CDC* pDC);
 
-    BOOL    bPushed;
-    BOOL    bRaised;
+    bool    bPushed;
+    bool    bRaised;
     const double  dblBoxSize = 8.25;
     CPoint  ptOrg;
 };
@@ -70,7 +70,7 @@ public:
 
 // Attributes
 public:
-    virtual BOOL HasGripper() const;
+    virtual bool HasGripper() const;
 
 // Operations
 public:
index a0a36bc..b070d87 100644 (file)
@@ -75,11 +75,11 @@ CSizingControlBar::CSizingControlBar()
     m_szHorz = CSize(120, 200);
     m_szVert = CSize(120, 200);
     m_szFloat = CSize(120, 200);
-    m_bTracking = FALSE;
-    m_bKeepSize = FALSE;
-    m_bParentSizing = FALSE;
+    m_bTracking = false;
+    m_bKeepSize = false;
+    m_bParentSizing = false;
     m_cxEdge = 5;
-    m_bDragShowContent = FALSE;
+    m_bDragShowContent = false;
     m_nDockBarID = 0;
     m_dwSCBStyle = 0;
        m_htEdge = 0;
@@ -118,7 +118,7 @@ END_MESSAGE_MAP()
 
 // old creation method, still here for compatibility reasons
 BOOL CSizingControlBar::Create(LPCTSTR lpszWindowName, CWnd* pParentWnd,
-                               CSize sizeDefault, BOOL bHasGripper,
+                               CSize sizeDefault, bool bHasGripper,
                                UINT nID, DWORD dwStyle)
 {
     UNUSED_ALWAYS(bHasGripper);
@@ -187,7 +187,7 @@ int CSizingControlBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
 
     // query SPI_GETDRAGFULLWINDOWS system parameter
     // OnSettingChange() will update m_bDragShowContent
-    m_bDragShowContent = FALSE;
+    m_bDragShowContent = false;
     ::SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0,
         &m_bDragShowContent, 0);
 
@@ -214,24 +214,24 @@ LRESULT CSizingControlBar::OnSetText(WPARAM wParam, LPARAM lParam)
     return lResult;
 }
 
-const BOOL CSizingControlBar::IsFloating() const
+const bool CSizingControlBar::IsFloating() const
 {
     return !IsHorzDocked() && !IsVertDocked();
 }
 
-const BOOL CSizingControlBar::IsHorzDocked() const
+const bool CSizingControlBar::IsHorzDocked() const
 {
     return (m_nDockBarID == AFX_IDW_DOCKBAR_TOP ||
         m_nDockBarID == AFX_IDW_DOCKBAR_BOTTOM);
 }
 
-const BOOL CSizingControlBar::IsVertDocked() const
+const bool CSizingControlBar::IsVertDocked() const
 {
     return (m_nDockBarID == AFX_IDW_DOCKBAR_LEFT ||
         m_nDockBarID == AFX_IDW_DOCKBAR_RIGHT);
 }
 
-const BOOL CSizingControlBar::IsSideTracking() const
+const bool CSizingControlBar::IsSideTracking() const
 {
     // don't call this when not tracking
     ASSERT(m_bTracking && !IsFloating());
@@ -272,10 +272,10 @@ CSize CSizingControlBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
 
     if (IsVisible() && !IsFloating() &&
         m_bParentSizing && arrSCBars[0] == this)
-        if (NegotiateSpace(nLengthTotal, (bHorz != FALSE)))
+        if (NegotiateSpace(nLengthTotal, (!!bHorz)))
             AlignControlBars();
 
-    m_bParentSizing = FALSE;
+    m_bParentSizing = false;
 
     if (bHorz)
         return CSize(max(m_szMinHorz.cx, m_szHorz.cx),
@@ -290,7 +290,7 @@ CSize CSizingControlBar::CalcDynamicLayout(int nLength, DWORD dwMode)
     if (dwMode & (LM_HORZDOCK | LM_VERTDOCK)) // docked ?
     {
         if (nLength == -1)
-            m_bParentSizing = TRUE;
+            m_bParentSizing = true;
 
         return baseCSizingControlBar::CalcDynamicLayout(nLength, dwMode);
     }
@@ -354,7 +354,7 @@ void CSizingControlBar::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)
 
     if (!IsFloating())
         if (lpwndpos->flags & SWP_SHOWWINDOW)
-            m_bKeepSize = TRUE;
+            m_bKeepSize = true;
 }
 
 /////////////////////////////////////////////////////////////////////////
@@ -466,7 +466,7 @@ void CSizingControlBar::OnNcCalcSize(BOOL bCalcValidRects,
         int nThis;
         GetRowSizingBars(arrSCBars, nThis);
 
-        BOOL bHorz = IsHorzDocked();
+        bool bHorz = IsHorzDocked();
         if (nThis > 0)
             m_dwSCBStyle |= bHorz ? SCBS_EDGELEFT : SCBS_EDGETOP;
 
@@ -589,7 +589,7 @@ void CSizingControlBar::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
 {
     baseCSizingControlBar::OnSettingChange(uFlags, lpszSection);
 
-    m_bDragShowContent = FALSE;
+    m_bDragShowContent = false;
     ::SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0,
         &m_bDragShowContent, 0); // update
 }
@@ -628,10 +628,10 @@ void CSizingControlBar::StartTracking(UINT nHitTest, CPoint point)
         RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW);
 
     m_htEdge = nHitTest;
-    m_bTracking = TRUE;
+    m_bTracking = true;
 
-    BOOL bHorz = IsHorzDocked();
-    BOOL bHorzTracking = m_htEdge == HTLEFT || m_htEdge == HTRIGHT;
+    bool bHorz = IsHorzDocked();
+    bool bHorzTracking = m_htEdge == HTLEFT || m_htEdge == HTRIGHT;
 
     m_nTrackPosOld = bHorzTracking ? point.x : point.y;
 
@@ -663,7 +663,7 @@ void CSizingControlBar::StartTracking(UINT nHitTest, CPoint point)
             reposQuery, &rcT, NULL, TRUE);
         int nMaxWidth = bHorz ? rcT.Height() - 2 : rcT.Width() - 2;
 
-        BOOL bTopOrLeft = m_htEdge == HTTOP || m_htEdge == HTLEFT;
+        bool bTopOrLeft = m_htEdge == HTTOP || m_htEdge == HTLEFT;
 
         m_nTrackPosMin -= bTopOrLeft ? nMaxWidth : nExcessWidth;
         m_nTrackPosMax += bTopOrLeft ? nExcessWidth : nMaxWidth;
@@ -698,7 +698,7 @@ void CSizingControlBar::StopTracking()
 {
     OnTrackInvertTracker(); // erase tracker
 
-    m_bTracking = FALSE;
+    m_bTracking = false;
     ReleaseCapture();
 
     m_pDockSite->DelayRecalcLayout();
@@ -708,7 +708,7 @@ void CSizingControlBar::OnTrackUpdateSize(CPoint& point)
 {
     ASSERT(!IsFloating());
 
-    BOOL bHorzTrack = m_htEdge == HTLEFT || m_htEdge == HTRIGHT;
+    bool bHorzTrack = m_htEdge == HTLEFT || m_htEdge == HTRIGHT;
 
     int nTrackPos = bHorzTrack ? point.x : point.y;
     nTrackPos = max(m_nTrackPosMin, min(m_nTrackPosMax, nTrackPos));
@@ -722,7 +722,7 @@ void CSizingControlBar::OnTrackUpdateSize(CPoint& point)
 
     m_nTrackPosOld = nTrackPos;
     
-    BOOL bHorz = IsHorzDocked();
+    bool bHorz = IsHorzDocked();
 
     CSize sizeNew = bHorz ? m_szHorz : m_szVert;
     switch (m_htEdge)
@@ -748,7 +748,7 @@ void CSizingControlBar::OnTrackUpdateSize(CPoint& point)
     else
     {
         int nGrowingBar = nThis;
-        BOOL bBefore = m_htEdge == HTTOP || m_htEdge == HTLEFT;
+        bool bBefore = m_htEdge == HTTOP || m_htEdge == HTLEFT;
         if (bBefore && nDelta > 0)
             nGrowingBar--;
         if (!bBefore && nDelta < 0)
@@ -791,7 +791,7 @@ void CSizingControlBar::OnTrackInvertTracker()
     if (m_bDragShowContent)
         return; // don't show tracker if DragFullWindows is on
 
-    BOOL bHorz = IsHorzDocked();
+    bool bHorz = IsHorzDocked();
     CRect rc, rcBar, rcDock, rcFrame;
     GetWindowRect(rcBar);
     m_pDockBar->GetWindowRect(rcDock);
@@ -802,7 +802,7 @@ void CSizingControlBar::OnTrackInvertTracker()
             CRect(rcDock.left + 1, rc.top, rcDock.right - 1, rc.bottom) :
             CRect(rc.left, rcDock.top + 1, rc.right, rcDock.bottom - 1);
 
-    BOOL bHorzTracking = m_htEdge == HTLEFT || m_htEdge == HTRIGHT;
+    bool bHorzTracking = m_htEdge == HTLEFT || m_htEdge == HTRIGHT;
     int nOfs = m_nTrackPosOld - m_nTrackEdgeOfs;
     nOfs -= bHorzTracking ? rc.CenterPoint().x : rc.CenterPoint().y;
     rc.OffsetRect(bHorzTracking ? nOfs : 0, bHorzTracking ? 0 : nOfs);
@@ -819,13 +819,13 @@ void CSizingControlBar::OnTrackInvertTracker()
     m_pDockSite->ReleaseDC(pDC);
 }
 
-BOOL CSizingControlBar::GetEdgeRect(CRect rcWnd, UINT nHitTest,
+bool CSizingControlBar::GetEdgeRect(CRect rcWnd, UINT nHitTest,
                                     CRect& rcEdge)
 {
     rcEdge = rcWnd;
     if (m_dwSCBStyle & SCBS_SHOWEDGES)
         rcEdge.DeflateRect(1, 1);
-    BOOL bHorz = IsHorzDocked();
+    bool bHorz = IsHorzDocked();
 
     switch (nHitTest)
     {
@@ -915,7 +915,7 @@ void CSizingControlBar::GetRowSizingBars(CSCBArray& arrSCBars, int& nThis)
     }
 }
 
-BOOL CSizingControlBar::NegotiateSpace(int nLengthTotal, BOOL bHorz)
+bool CSizingControlBar::NegotiateSpace(int nLengthTotal, bool bHorz)
 {
     ASSERT(bHorz == IsHorzDocked());
 
@@ -934,7 +934,7 @@ BOOL CSizingControlBar::NegotiateSpace(int nLengthTotal, BOOL bHorz)
         pBar = static_cast<CSizingControlBar*>(m_pDockBar->m_arrBars[i]);
         if (HIWORD(pBar) == 0) continue; // placeholder
         if (!pBar->IsVisible()) continue;
-        BOOL bIsSizingBar = 
+        bool bIsSizingBar = 
             pBar->IsKindOf(RUNTIME_CLASS(CSizingControlBar));
 
         int nLengthBar; // minimum length of the bar
@@ -956,7 +956,7 @@ BOOL CSizingControlBar::NegotiateSpace(int nLengthTotal, BOOL bHorz)
             {
                 m_pDockBar->m_arrBars.InsertAt(i + 1,
                     (CControlBar*) NULL);
-                return FALSE;
+                return false;
             }
             
             // only this sizebar remains on the row, adjust it to minsize
@@ -967,7 +967,7 @@ BOOL CSizingControlBar::NegotiateSpace(int nLengthTotal, BOOL bHorz)
                 else
                     m_szVert.cy = m_szMinVert.cy;
 
-                return TRUE; // the dockbar will split the row for us
+                return true; // the dockbar will split the row for us
             }
 
             // we have enough bars - go negotiate with them
@@ -998,12 +998,12 @@ BOOL CSizingControlBar::NegotiateSpace(int nLengthTotal, BOOL bHorz)
         ASSERT(arrSCBars[0] == this);
 
         if (nDelta == 0)
-            return TRUE;
+            return true;
         
-        m_bKeepSize = FALSE;
+        m_bKeepSize = false;
         (bHorz ? m_szHorz.cx : m_szVert.cy) += nDelta;
 
-        return TRUE;
+        return true;
     }
 
     // make all the bars the same width
@@ -1039,10 +1039,10 @@ BOOL CSizingControlBar::NegotiateSpace(int nLengthTotal, BOOL bHorz)
         // clear m_bKeepSize flags
         if ((nDeltaOld == nDelta) || (nDelta == 0))
             for (i = 0; i < nNumBars; i++)
-                arrSCBars[i]->m_bKeepSize = FALSE;
+                arrSCBars[i]->m_bKeepSize = false;
     }
 
-    return TRUE;
+    return true;
 }
 
 void CSizingControlBar::AlignControlBars()
@@ -1050,8 +1050,8 @@ void CSizingControlBar::AlignControlBars()
     int nFirst, nLast, nThis;
     GetRowInfo(nFirst, nLast, nThis);
 
-    BOOL bHorz = IsHorzDocked();
-    BOOL bNeedRecalc = FALSE;
+    bool bHorz = IsHorzDocked();
+    bool bNeedRecalc = false;
     int nAlign = bHorz ? -2 : 0;
 
     CRect rc, rcDock;
@@ -1080,7 +1080,7 @@ void CSizingControlBar::AlignControlBars()
             else
                 rc.OffsetRect(nAlign - rc.left, 0);
             pBar->MoveWindow(rc);
-            bNeedRecalc = TRUE;
+            bNeedRecalc = true;
         }
         nAlign += (bHorz ? rc.Width() : rc.Height()) - 2;
     }
index 639a9cd..d3dc1ed 100644 (file)
@@ -81,18 +81,18 @@ public:
     CSizingControlBar();
 
     virtual BOOL Create(LPCTSTR lpszWindowName, CWnd* pParentWnd,
-        CSize sizeDefault, BOOL bHasGripper,
+        CSize sizeDefault, bool bHasGripper,
         UINT nID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP);
     virtual BOOL Create(LPCTSTR lpszWindowName, CWnd* pParentWnd,
         UINT nID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP);
 
 // Attributes
 public:
-    const BOOL IsFloating() const;
-    const BOOL IsHorzDocked() const;
-    const BOOL IsVertDocked() const;
-    const BOOL IsSideTracking() const;
-    const BOOL GetSCBStyle() const {return m_dwSCBStyle;}
+    const bool IsFloating() const;
+    const bool IsHorzDocked() const;
+    const bool IsVertDocked() const;
+    const bool IsSideTracking() const;
+    const bool GetSCBStyle() const {return (m_dwSCBStyle != 0);}
 
 // Operations
 public:
@@ -125,7 +125,7 @@ public:
 protected:
     // implementation helpers
     UINT GetEdgeHTCode(int nEdge);
-    BOOL GetEdgeRect(CRect rcWnd, UINT nHitTest, CRect& rcEdge);
+    bool GetEdgeRect(CRect rcWnd, UINT nHitTest, CRect& rcEdge);
     virtual void StartTracking(UINT nHitTest, CPoint point);
     virtual void StopTracking();
     virtual void OnTrackUpdateSize(CPoint& point);
@@ -137,7 +137,7 @@ protected:
     void GetRowInfo(int& nFirst, int& nLast, int& nThis);
     void GetRowSizingBars(CSCBArray& arrSCBars);
     void GetRowSizingBars(CSCBArray& arrSCBars, int& nThis);
-    BOOL NegotiateSpace(int nLengthTotal, BOOL bHorz);
+    bool NegotiateSpace(int nLengthTotal, bool bHorz);
 
 protected:
     DWORD   m_dwSCBStyle;
@@ -153,10 +153,10 @@ protected:
     int     m_nTrackPosMax;
     int     m_nTrackPosOld;
     int     m_nTrackEdgeOfs;
-    BOOL    m_bTracking;
-    BOOL    m_bKeepSize;
-    BOOL    m_bParentSizing;
-    BOOL    m_bDragShowContent;
+    bool    m_bTracking;
+    bool    m_bKeepSize;
+    bool    m_bParentSizing;
+    bool    m_bDragShowContent;
     UINT    m_nDockBarID;
     int     m_cxEdge;
 
index 7ef60b2..b4b1a57 100644 (file)
@@ -304,12 +304,12 @@ bool DiffUtils::RegExpFilter(int StartPos, int EndPos, int FileNo) const
  * @param [out] diffs Pointer to list of change structs where diffdata is stored.
  * @param [in] depth Depth in folder compare (we use 0).
  * @param [out] bin_status used to return binary status from compare.
- * @param [in] bMovedBlocks If TRUE moved blocks are analyzed.
+ * @param [in] bMovedBlocks If `true` moved blocks are analyzed.
  * @param [out] bin_file Returns which file was binary file as bitmap.
     So if first file is binary, first bit is set etc. Can be NULL if binary file
     info is not needed (faster compare since diffutils don't bother checking
     second file if first is binary).
- * @return TRUE when compare succeeds, FALSE if error happened during compare.
+ * @return `true` when compare succeeds, `false` if error happened during compare.
  */
 bool DiffUtils::Diff2Files(struct change ** diffs, int depth,
                int * bin_status, bool bMovedBlocks, int * bin_file) const
index c290ef8..80b8ecf 100644 (file)
@@ -408,7 +408,7 @@ bool CConfigLog::DoFile(String &sError)
        WritePluginsInLogFile(L"BUFFER_PREDIFF");
        FileWriteString(_T("\r\n Editor scripts: "));
        WritePluginsInLogFile(L"EDITOR_SCRIPT");
-       if (plugin::IsWindowsScriptThere() == FALSE)
+       if (!plugin::IsWindowsScriptThere())
                FileWriteString(_T("\r\n .sct scripts disabled (Windows Script Host not found)\r\n"));
 
        FileWriteString(_T("\r\n\r\n"));
index 40b0172..aac764f 100644 (file)
@@ -54,7 +54,7 @@ public :
                const FileTextEncoding & encoding, CString &sError);
        int SaveToFile (const String& pszFileName, bool bTempFile, String & sError,
                PackingInfo * infoUnpacker = NULL, CRLFSTYLE nCrlfStyle = CRLF_STYLE_AUTOMATIC,
-               bool bClearModifiedFlag = TRUE, int nStartLine = 0, int nLines = -1);
+               bool bClearModifiedFlag = true, int nStartLine = 0, int nLines = -1);
        ucr::UNICODESET getUnicoding() const { return m_encoding.m_unicoding; }
        void setUnicoding(ucr::UNICODESET value) { m_encoding.m_unicoding = value; }
        int getCodepage() const { return m_encoding.m_codepage; }
@@ -72,7 +72,7 @@ public :
        // if line has any text (including eol), set strLine to text (including eol)
        bool GetFullLine(int nLineIndex, CString &strLine) const;
 
-       virtual void SetModified (bool bModified = TRUE) override;
+       virtual void SetModified (bool bModified = true) override;
        void prepareForRescan();
        virtual void OnNotifyLineHasBeenEdited(int nLine) override;
        bool IsInitialized() const;
index fe7f428..1cfeaba 100644 (file)
@@ -82,7 +82,7 @@ void CDiffViewBar::OnLButtonDown(UINT nFlags, CPoint point)
        TViewBarBase::OnLButtonDown(nFlags, point);
        if (m_pDockBar != NULL)
        {
-               if (IsHorzDocked() == FALSE)
+               if (!IsHorzDocked())
                        m_pDockContext->ToggleDocking();
        }
 }
index 02eaeaa..8ecee64 100644 (file)
@@ -140,7 +140,7 @@ static HGLOBAL ConvertToUTF16ForClipboard(HGLOBAL hMem, int codepage)
 /**
  * @brief Generate report and save it to file.
  * @param [out] errStr Empty if succeeded, otherwise contains error message.
- * @return TRUE if report was created, FALSE if user canceled report.
+ * @return `true` if report was created, `false` if user canceled report.
  */
 bool DirCmpReport::GenerateReport(String &errStr)
 {
@@ -158,9 +158,9 @@ bool DirCmpReport::GenerateReport(String &errStr)
                if (dlg.m_bCopyToClipboard)
                {
                        if (!CWnd::GetSafeOwner()->OpenClipboard())
-                               return FALSE;
+                               return false;
                        if (!EmptyClipboard())
-                               return FALSE;
+                               return false;
                        CSharedFile file(GMEM_DDESHARE|GMEM_MOVEABLE|GMEM_ZEROINIT);
                        m_pFile = &file;
                        GenerateReport(dlg.m_nReportType);
@@ -208,15 +208,15 @@ bool DirCmpReport::GenerateReport(String &errStr)
                        if (!paths::CreateIfNeeded(path))
                        {
                                errStr = _("Folder does not exist.");
-                               return FALSE;
+                               return false;
                        }
                        CFile file(dlg.m_sReportFile.c_str(),
                                CFile::modeWrite|CFile::modeCreate|CFile::shareDenyWrite);
                        m_pFile = &file;
-                       m_bIncludeFileCmpReport = !!dlg.m_bIncludeFileCmpReport;
+                       m_bIncludeFileCmpReport = dlg.m_bIncludeFileCmpReport;
                        GenerateReport(dlg.m_nReportType);
                }
-               bRet = TRUE;
+               bRet = true;
        }
        catch (CException *e)
        {
index e37794c..cc43fea 100644 (file)
@@ -138,7 +138,7 @@ void DirCmpReportDlg::OnBtnClickReportBrowse()
        String filter = tr(f_types[m_ctlStyle.GetCurSel()].browseFilter);
 
        String chosenFilepath;
-       if (SelectFile(GetSafeHwnd(), chosenFilepath, FALSE, folder.c_str(), _T(""), filter))
+       if (SelectFile(GetSafeHwnd(), chosenFilepath, false, folder.c_str(), _T(""), filter))
        {
                m_sReportFile = chosenFilepath;
                m_ctlReportFile.SetWindowText(chosenFilepath.c_str());
index 0e8c515..80d3fe4 100644 (file)
@@ -151,7 +151,7 @@ void CDirColsDlg::MoveItem(int index, int newIndex)
 {
        // Get current column data
        String text =  m_listColumns.GetItemText(index, 0);
-       BOOL checked = m_listColumns.GetCheck(index);
+       bool checked = m_listColumns.GetCheck(index);
        UINT state = m_listColumns.GetItemState(index, LVIS_SELECTED);
        DWORD_PTR data = m_listColumns.GetItemData(index);
 
@@ -238,7 +238,7 @@ void CDirColsDlg::OnOK()
 
        for (int i = 0; i < m_listColumns.GetItemCount(); i++)
        {
-               BOOL checked = m_listColumns.GetCheck(i);
+               bool checked = m_listColumns.GetCheck(i);
                DWORD_PTR data = m_listColumns.GetItemData(i);
                column & col1 = m_cols[data];
                if (checked)
index c29fa1d..387fbff 100644 (file)
@@ -37,7 +37,7 @@ void DirCompProgressBar::ClearStat()
  * @param [in] pParent Parent window for progress dialog.
  */
 DirCompProgressBar::DirCompProgressBar()
-: m_bCompareReady(FALSE)
+: m_bCompareReady(false)
 , m_prevState(CompareStats::STATE_IDLE)
 , m_pCompareStats(NULL)
 #ifdef __ITaskbarList3_INTERFACE_DEFINED__
@@ -154,12 +154,12 @@ void DirCompProgressBar::OnTimer(UINT_PTR nIDEvent)
                // Update total items too since we might get only this one state
                // when compare is fast.
                else if (state == CompareStats::STATE_IDLE &&
-                       m_bCompareReady == FALSE && m_pCompareStats->IsCompareDone() )
+                       !m_bCompareReady && m_pCompareStats->IsCompareDone() )
                {
                        SetProgressState(m_pCompareStats->GetComparedItems(), m_pCompareStats->GetTotalItems());
                        EndUpdating();
                        m_prevState = CompareStats::STATE_COMPARE;
-                       m_bCompareReady = TRUE;
+                       m_bCompareReady = true;
                }
        }
        else
index c816048..2e20c5b 100644 (file)
@@ -62,7 +62,7 @@ protected:
 private:
        CompareStats *m_pCompareStats; /**< Pointer to comparestats */
        CompareStats::CMP_STATE m_prevState; /**< Previous state for compare (to track changes) */
-       BOOL m_bCompareReady; /**< Compare ready, waiting for closing? */
+       bool m_bCompareReady; /**< Compare ready, waiting for closing? */
 #ifdef __ITaskbarList3_INTERFACE_DEFINED__
        ITaskbarList3 *m_pTaskbarList;
 #endif
index 6253c7a..7707f32 100644 (file)
@@ -71,7 +71,7 @@ CDirDoc::CDirDoc()
 : m_pCtxt(nullptr)
 , m_pDirView(nullptr)
 , m_pCompareStats(nullptr)
-, m_bMarkedRescan(FALSE)
+, m_bMarkedRescan(false)
 , m_pTempPathContext(nullptr)
 , m_bGeneratingReport(false)
 {
@@ -188,7 +188,7 @@ void CDirDoc::LoadLineFilterList()
 {
        ASSERT(m_pCtxt);
        
-       BOOL bFilters = GetOptionsMgr()->GetBool(OPT_LINEFILTER_ENABLED);
+       bool bFilters = GetOptionsMgr()->GetBool(OPT_LINEFILTER_ENABLED);
        String filters = theApp.m_pLineFilters->GetAsString();
        if (!bFilters || filters.empty())
        {
@@ -289,9 +289,9 @@ void CDirDoc::Rescan()
        m_diffThread.SetContext(m_pCtxt.get());
        m_diffThread.RemoveListener(this, &CDirDoc::DiffThreadCallback);
        m_diffThread.AddListener(this, &CDirDoc::DiffThreadCallback);
-       m_diffThread.SetCompareSelected(!!m_bMarkedRescan);
+       m_diffThread.SetCompareSelected(m_bMarkedRescan);
        m_diffThread.CompareDirectories();
-       m_bMarkedRescan = FALSE;
+       m_bMarkedRescan = false;
 }
 
 /**
@@ -412,14 +412,14 @@ void CDirDoc::MergeDocClosing(IMergeDoc * pMergeDoc)
  *
  * Asks confirmation for docs containing unsaved data and then
  * closes MergeDocs.
- * @return TRUE if success, FALSE if user canceled or closing failed
+ * @return `true` if success, `false` if user canceled or closing failed
  */
-BOOL CDirDoc::CloseMergeDocs()
+bool CDirDoc::CloseMergeDocs()
 {
        while (!m_MergeDocs.IsEmpty())
                if (!m_MergeDocs.GetTail()->CloseNow())
-                       return FALSE;
-       return TRUE;
+                       return false;
+       return true;
 }
 
 /**
@@ -430,7 +430,7 @@ BOOL CDirDoc::CloseMergeDocs()
  * @param [in] bIdentical TRUE if files became identical, FALSE otherwise.
  */
 void CDirDoc::UpdateChangedItem(PathContext &paths,
-       UINT nDiffs, UINT nTrivialDiffs, BOOL bIdentical)
+       UINT nDiffs, UINT nTrivialDiffs, bool bIdentical)
 {
        uintptr_t pos = FindItemFromPaths(*m_pCtxt, paths);
        // If we failed files could have been swapped so lets try again
index 3ce73e4..9da0f9d 100644 (file)
@@ -61,7 +61,7 @@ public:
 
 // Operations
 public:
-       BOOL CloseMergeDocs();
+       bool CloseMergeDocs();
        CDirView * GetMainView() const;
 
 // Overrides
@@ -91,7 +91,7 @@ public:
        void RefreshOptions();
        void CompareReady();
        void UpdateChangedItem(PathContext & paths,
-               UINT nDiffs, UINT nTrivialDiffs, BOOL bIdentical);
+               UINT nDiffs, UINT nTrivialDiffs, bool bIdentical);
        void UpdateResources();
        void InitStatusStrings();
        void ReloadItemStatus(uintptr_t diffPos, int idx);
@@ -112,7 +112,7 @@ public:
        bool HasDiffs() const { return m_pCtxt != NULL; }
        const CDiffContext & GetDiffContext() const { return *m_pCtxt; }
        CDiffContext& GetDiffContext() { return *m_pCtxt.get(); }
-       void SetMarkedRescan() {m_bMarkedRescan = TRUE; }
+       void SetMarkedRescan() {m_bMarkedRescan = true; }
        const CompareStats * GetCompareStats() const { return m_pCompareStats.get(); };
        bool IsArchiveFolders() const;
        PluginManager& GetPluginManager() { return m_pluginman; };
@@ -141,6 +141,6 @@ private:
        String m_strDesc[3]; /**< Left/middle/right side desription text */
        String m_sReportFile;
        PluginManager m_pluginman;
-       bool m_bMarkedRescan; /**< If TRUE next rescan scans only marked items */
+       bool m_bMarkedRescan; /**< If `true` next rescan scans only marked items */
        bool m_bGeneratingReport;
 };
index 81e5362..ece89c2 100644 (file)
@@ -2658,7 +2658,7 @@ void CDirView::OnToolsGeneratePatch()
        const CDiffContext& ctxt = GetDiffContext();
 
        // Get selected items from folder compare
-       BOOL bValidFiles = TRUE;
+       bool bValidFiles = true;
        for (DirItemIterator it = SelBegin(); bValidFiles && it != SelEnd(); ++it)
        {
                const DIFFITEM &item = *it;
@@ -2666,13 +2666,13 @@ void CDirView::OnToolsGeneratePatch()
                {
                        LangMessageBox(IDS_CANNOT_CREATE_BINARYPATCH, MB_ICONWARNING |
                                MB_DONT_DISPLAY_AGAIN, IDS_CANNOT_CREATE_BINARYPATCH);
-                       bValidFiles = FALSE;
+                       bValidFiles = false;
                }
                else if (item.diffcode.isDirectory())
                {
                        LangMessageBox(IDS_CANNOT_CREATE_DIRPATCH, MB_ICONWARNING |
                                MB_DONT_DISPLAY_AGAIN, IDS_CANNOT_CREATE_DIRPATCH);
-                       bValidFiles = FALSE;
+                       bValidFiles = false;
                }
 
                if (bValidFiles)
@@ -2949,7 +2949,7 @@ void CDirView::OnItemRename()
  */
 void CDirView::OnUpdateItemRename(CCmdUI* pCmdUI)
 {
-       BOOL bEnabled = (1 == m_pList->GetSelectedCount());
+       bool bEnabled = (1 == m_pList->GetSelectedCount());
        pCmdUI->Enable(bEnabled && SelBegin() != SelEnd());
 }
 
index f62362b..610cdbe 100644 (file)
@@ -206,11 +206,11 @@ protected:
        bool m_bExpandSubdirs;
        CFont m_font; /**< User-selected font */
        UINT m_nHiddenItems; /**< Count of items we have hidden */
-       bool m_bTreeMode; /**< TRUE if tree mode is on*/
+       bool m_bTreeMode; /**< `true` if tree mode is on*/
        DirViewFilterSettings m_dirfilter;
        std::unique_ptr<DirCompProgressBar> m_pCmpProgressBar;
        clock_t m_compareStart; /**< Starting process time of the compare */
-       bool m_bUserCancelEdit; /**< TRUE if the user cancels rename */
+       bool m_bUserCancelEdit; /**< `true` if the user cancels rename */
        String m_lastCopyFolder; /**< Last Copy To -target folder. */
 
        int m_firstDiffItem;
index 942d35c..c3d2897 100644 (file)
@@ -166,7 +166,7 @@ static bool launchProgram(const String& sCmd, WORD wShowWindow)
        stInfo.dwFlags = STARTF_USESHOWWINDOW;
        stInfo.wShowWindow = wShowWindow;
        PROCESS_INFORMATION processInfo;
-       BOOL retVal = CreateProcess(NULL, (LPTSTR)sCmd.c_str(),
+       bool retVal = !!CreateProcess(NULL, (LPTSTR)sCmd.c_str(),
                NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE, NULL, NULL,
                &stInfo, &processInfo);
        if (!retVal)
index b8eee11..3d48271 100644 (file)
@@ -36,11 +36,11 @@ using std::vector;
  * @brief Standard constructor.
  */
 FileActionScript::FileActionScript()
-: m_bUseRecycleBin(TRUE)
-, m_bHasCopyOperations(FALSE)
-, m_bHasMoveOperations(FALSE)
-, m_bHasRenameOperations(FALSE)
-, m_bHasDelOperations(FALSE)
+: m_bUseRecycleBin(true)
+, m_bHasCopyOperations(false)
+, m_bHasMoveOperations(false)
+, m_bHasRenameOperations(false)
+, m_bHasDelOperations(false)
 , m_hParentWindow(NULL)
 , m_pCopyOperations(new ShellFileOperations())
 , m_pMoveOperations(new ShellFileOperations())
@@ -78,9 +78,9 @@ void FileActionScript::SetParentWindow(HWND hWnd)
 
 /**
  * @brief Does user want to move deleted files to Recycle Bin?
- * @param [in] bUseRecycleBin If TRUE deleted files are moved to Recycle Bin.
+ * @param [in] bUseRecycleBin If `true` deleted files are moved to Recycle Bin.
  */
-void FileActionScript::UseRecycleBin(BOOL bUseRecycleBin)
+void FileActionScript::UseRecycleBin(bool bUseRecycleBin)
 {
        m_bUseRecycleBin = bUseRecycleBin;
 }
@@ -107,8 +107,7 @@ int FileActionScript::CreateOperationsScripts()
 {
        UINT operation = 0;
        FILEOP_FLAGS operFlags = 0;
-       BOOL bApplyToAll = FALSE;
-       BOOL bContinue = TRUE;
+       bool bContinue = true;
 
        // Copy operations first
        operation = FO_COPY;
@@ -117,33 +116,33 @@ int FileActionScript::CreateOperationsScripts()
                operFlags |= FOF_ALLOWUNDO;
 
        vector<FileActionItem>::const_iterator iter = m_actions.begin();
-       while (iter != m_actions.end() && bContinue == TRUE)
+       while (iter != m_actions.end() && bContinue)
        {
-               BOOL bSkip = FALSE;
+               bool bSkip = false;
                if ((*iter).atype == FileAction::ACT_COPY && !(*iter).dirflag)
                {
                        if (bContinue)
                        {
-                               if (!theApp.CreateBackup(TRUE, (*iter).dest))
+                               if (!theApp.CreateBackup(true, (*iter).dest))
                                {
                                        String strErr = _("Error backing up file");
                                        AfxMessageBox(strErr.c_str(), MB_OK | MB_ICONERROR);
-                                       bContinue = FALSE;
+                                       bContinue = false;
                                }
                        }
                }
 
                if ((*iter).atype == FileAction::ACT_COPY &&
-                       bSkip == FALSE && bContinue == TRUE)
+                       !bSkip && bContinue)
                {
                        m_pCopyOperations->AddSourceAndDestination((*iter).src, (*iter).dest);
-                       m_bHasCopyOperations = TRUE;
+                       m_bHasCopyOperations = true;
                }
                ++iter;
        }
-       if (bContinue == FALSE)
+       if (!bContinue)
        {
-               m_bHasCopyOperations = FALSE;
+               m_bHasCopyOperations = false;
                m_pCopyOperations->Reset();
                return SCRIPT_USERCANCEL;
        }
@@ -163,7 +162,7 @@ int FileActionScript::CreateOperationsScripts()
                if ((*iter).atype == FileAction::ACT_MOVE)
                {
                        m_pMoveOperations->AddSourceAndDestination((*iter).src, (*iter).dest);
-                       m_bHasMoveOperations = TRUE;
+                       m_bHasMoveOperations = true;
                }
                ++iter;
        }
@@ -182,7 +181,7 @@ int FileActionScript::CreateOperationsScripts()
                if ((*iter).atype == FileAction::ACT_RENAME)
                {
                        m_pRenameOperations->AddSourceAndDestination((*iter).src, (*iter).dest);
-                       m_bHasRenameOperations = TRUE;
+                       m_bHasRenameOperations = true;
                }
                ++iter;
        }
@@ -203,7 +202,7 @@ int FileActionScript::CreateOperationsScripts()
                        m_pDelOperations->AddSource((*iter).src);
                        if (!(*iter).dest.empty())
                                m_pDelOperations->AddSource((*iter).dest);
-                       m_bHasDelOperations = TRUE;
+                       m_bHasDelOperations = true;
                }
                ++iter;
        }
@@ -235,14 +234,14 @@ bool FileActionScript::RunOp(ShellFileOperations *oplist, bool & userCancelled)
 
 /**
  * @brief Execute fileoperations.
- * @return TRUE if all actions were done successfully, FALSE otherwise.
+ * @return `true` if all actions were done successfully, `false` otherwise.
  */
-BOOL FileActionScript::Run()
+bool FileActionScript::Run()
 {
        // Now process files/directories that got added to list
        bool bFileOpSucceed = true;
        bool bUserCancelled = false;
-       BOOL bRetVal = TRUE;
+       bool bRetVal = true;
 
        CreateOperationsScripts();
 
@@ -265,7 +264,7 @@ BOOL FileActionScript::Run()
                        bFileOpSucceed = RunOp(m_pMoveOperations.get(), bUserCancelled);
                }
                else
-                       bRetVal = FALSE;
+                       bRetVal = false;
        }
 
        if (m_bHasRenameOperations)
@@ -275,7 +274,7 @@ BOOL FileActionScript::Run()
                        bFileOpSucceed = RunOp(m_pRenameOperations.get(), bUserCancelled);
                }
                else
-                       bRetVal = FALSE;
+                       bRetVal = false;
        }
 
        if (m_bHasDelOperations)
@@ -285,11 +284,11 @@ BOOL FileActionScript::Run()
                        bFileOpSucceed = RunOp(m_pDelOperations.get(), bUserCancelled);
                }
                else
-                       bRetVal = FALSE;
+                       bRetVal = false;
        }
 
        if (!bFileOpSucceed || bUserCancelled)
-               bRetVal = FALSE;
+               bRetVal = false;
 
        return bRetVal;
 }
index 08a3e23..ae2ecf9 100644 (file)
@@ -61,7 +61,7 @@ struct FileAction
 
        String src; /**< Source for action */
        String dest; /**< Destination action */
-       bool dirflag; /**< Is it directory? (TRUE means directory) */
+       bool dirflag; /**< Is it directory? (`true` means directory) */
        ACT_TYPE atype; /**< Action's type */
 };
 
@@ -110,8 +110,8 @@ public:
        ~FileActionScript();
 
        void SetParentWindow(HWND hWnd);
-       void UseRecycleBin(BOOL bUseRecycleBin);
-       BOOL Run();
+       void UseRecycleBin(bool bUseRecycleBin);
+       bool Run();
 
        // Manipulate the FileActionList
        size_t GetActionItemCount() const;
@@ -139,13 +139,13 @@ protected:
 private:
        std::vector<FileActionItem> m_actions; /**< List of all actions for this script. */
        std::unique_ptr<ShellFileOperations> m_pCopyOperations; /**< Copy operations. */
-       BOOL m_bHasCopyOperations; /**< flag if we've put anything into m_pCopyOperations */
+       bool m_bHasCopyOperations; /**< flag if we've put anything into m_pCopyOperations */
        std::unique_ptr<ShellFileOperations> m_pMoveOperations; /**< Move operations. */
-       BOOL m_bHasMoveOperations; /**< flag if we've put anything into m_pMoveOperations */
+       bool m_bHasMoveOperations; /**< flag if we've put anything into m_pMoveOperations */
        std::unique_ptr<ShellFileOperations> m_pRenameOperations; /**< Rename operations. */
-       BOOL m_bHasRenameOperations; /**< flag if we've put anything into m_pRenameOperations */
+       bool m_bHasRenameOperations; /**< flag if we've put anything into m_pRenameOperations */
        std::unique_ptr<ShellFileOperations> m_pDelOperations; /**< Delete operations. */
-       BOOL m_bHasDelOperations; /**< flag if we've put anything into m_pDelOperations */
-       BOOL m_bUseRecycleBin; /**< Use recycle bin for script actions? */
+       bool m_bHasDelOperations; /**< flag if we've put anything into m_pDelOperations */
+       bool m_bUseRecycleBin; /**< Use recycle bin for script actions? */
        HWND m_hParentWindow; /**< Parent window for showing messages */
 };
index ef61262..a6a96dc 100644 (file)
@@ -155,7 +155,7 @@ private:
        std::unique_ptr<FileFilterMgr> m_fileFilterMgr;  /*< Associated FileFilterMgr */
        String m_sFileFilterPath;        /*< Path to current filter */
        String m_sMask;   /*< File mask (if defined) "*.cpp *.h" etc */
-       bool m_bUseMask;   /*< If TRUE file mask is used, filter otherwise */
+       bool m_bUseMask;   /*< If `true` file mask is used, filter otherwise */
        String m_sGlobalFilterPath;    /*< Path for shared filters */
        String m_sUserSelFilterPath;     /*< Path for user's private filters */
 };
index e2453dc..1dcffab 100644 (file)
@@ -426,7 +426,7 @@ void FileFiltersDlg::OnBnClickedFilterfileNewbutton()
                path = paths::AddTrailingSlash(path);
        
        String s;
-       if (SelectFile(GetSafeHwnd(), s, FALSE, path.c_str(), _("Select filename for new filter"),
+       if (SelectFile(GetSafeHwnd(), s, false, path.c_str(), _("Select filename for new filter"),
                _("File Filters (*.flt)|*.flt|All Files (*.*)|*.*||")))
        {
                // Fix file extension
@@ -557,7 +557,7 @@ void FileFiltersDlg::OnBnClickedFilterfileInstall()
        String path;
        String userPath = theApp.m_pGlobalFileFilter->GetUserFilterPathWithCreate();
 
-       if (SelectFile(GetSafeHwnd(), s, TRUE, path.c_str(),_("Locate filter file to install"),
+       if (SelectFile(GetSafeHwnd(), s, true, path.c_str(),_("Locate filter file to install"),
                _("File Filters (*.flt)|*.flt|All Files (*.*)|*.*||")))
        {
                userPath = paths::ConcatPath(userPath, paths::FindFileName(s));
index 10cf7bd..96bec53 100644 (file)
@@ -60,7 +60,7 @@ static String LastSelectedFolder;
  * modality problems with this. Dialog can be lost behind other windows!
  * @param [in] defaultExtension Extension to append if user doesn't provide one
  */
-BOOL SelectFile(HWND parent, String& path,BOOL is_open /*=TRUE*/,
+bool SelectFile(HWND parent, String& path, bool is_open /*= true*/,
                LPCTSTR initialPath /*=NULL*/, const String& stitle /*=_T("")*/,
                const String& sfilter /*=_T("")*/, LPCTSTR defaultExtension /*=NULL*/)
 {
@@ -111,11 +111,11 @@ BOOL SelectFile(HWND parent, String& path,BOOL is_open /*=TRUE*/,
                ofn.lpstrDefExt = defaultExtension;
        ofn.Flags = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR;
 
-       BOOL bRetVal = FALSE;
+       bool bRetVal = false;
        if (is_open)
-               bRetVal = GetOpenFileName((OPENFILENAME *)&ofn);
+               bRetVal = !!GetOpenFileName((OPENFILENAME *)&ofn);
        else
-               bRetVal = GetSaveFileName((OPENFILENAME *)&ofn);
+               bRetVal = !!GetSaveFileName((OPENFILENAME *)&ofn);
        // common file dialog populated sSelectedFile variable's buffer
 
        if (bRetVal)
@@ -130,16 +130,16 @@ BOOL SelectFile(HWND parent, String& path,BOOL is_open /*=TRUE*/,
  * @param [in] root_path Initial path shown when dialog is opened
  * @param [in] titleid Resource string ID for dialog title.
  * @param [in] hwndOwner Handle to owner window or NULL
- * @return TRUE if valid folder selected (not cancelled)
+ * @return `true` if valid folder selected (not cancelled)
  */
-BOOL SelectFolder(String& path, LPCTSTR root_path /*=NULL*/, 
+bool SelectFolder(String& path, LPCTSTR root_path /*=NULL*/, 
                        const String& stitle /*=_T("")*/, 
                        HWND hwndOwner /*=NULL*/) 
 {
        BROWSEINFO bi;
        LPITEMIDLIST pidl;
        TCHAR szPath[MAX_PATH_FULL] = {0};
-       BOOL bRet = FALSE;
+       bool bRet = false;
        String title = stitle;
        if (root_path == NULL)
                LastSelectedFolder.clear();
@@ -160,7 +160,7 @@ BOOL SelectFolder(String& path, LPCTSTR root_path /*=NULL*/,
                if (SHGetPathFromIDList(pidl, szPath))
                {
                        path = szPath;
-                       bRet = TRUE;
+                       bRet = true;
                }
                CoTaskMemFree(pidl);
        }
@@ -210,9 +210,9 @@ static int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam,
  *     CMainFrame is used which can cause modality problems.
  * @param [out] path Selected folder/filename
  * @param [in] initialPath Initial file or folder shown/selected.
- * @return TRUE if user choosed a file/folder, FALSE if user canceled dialog.
+ * @return `true` if user choosed a file/folder, `false` if user canceled dialog.
  */
-BOOL SelectFileOrFolder(HWND parent, String& path, LPCTSTR initialPath /*=NULL*/)
+bool SelectFileOrFolder(HWND parent, String& path, LPCTSTR initialPath /*=NULL*/)
 {
        String title = _("Open");
 
@@ -259,7 +259,7 @@ BOOL SelectFileOrFolder(HWND parent, String& path, LPCTSTR initialPath /*=NULL*/
        ofn.lpstrFileTitle = NULL;
        ofn.Flags = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_NOTESTFILECREATE | OFN_NOCHANGEDIR;
 
-       BOOL bRetVal = GetOpenFileName((OPENFILENAME *)&ofn);
+       bool bRetVal = !!GetOpenFileName((OPENFILENAME *)&ofn);
 
        if (bRetVal)
        {
index 4c5b43e..ef3df2e 100644 (file)
 
 #include "UnicodeString.h"
 
-BOOL SelectFile(HWND parent, String& path, BOOL is_open =TRUE,
+bool SelectFile(HWND parent, String& path, bool is_open = true,
                        LPCTSTR initialPath = NULL, const String& stitle = _T(""),
                        const String& sfilter = _T(""), LPCTSTR defaultExtension = NULL);
 
-BOOL SelectFolder(String& path, LPCTSTR root_path = NULL, 
+bool SelectFolder(String& path, LPCTSTR root_path = NULL, 
                         const String& title = _T(""),
                         HWND hwndOwner = NULL);
 
-BOOL SelectFileOrFolder(HWND parent, String& path, LPCTSTR root_path = NULL);
+bool SelectFileOrFolder(HWND parent, String& path, LPCTSTR root_path = NULL);
index f1e4a9f..186dcdd 100644 (file)
@@ -84,7 +84,7 @@ public:
        int bToBeScanned; // TODO: Convert to PLUGIN_MODE and fix compile errors
        /// plugin name when it is defined
        String pluginName;
-       /// TRUE is the plugins exchange data through a file, false is the data is passed as parameter (BSTR/ARRAY)
+       /// `true` is the plugins exchange data through a file, false is the data is passed as parameter (BSTR/ARRAY)
        bool    bWithFile;
 };
 
index 819daf3..9fc867a 100644 (file)
@@ -112,7 +112,7 @@ static int FormatFilePathForDisplayWidth(CDC * pDC, int maxWidth, String & sFile
 CFilepathEdit::CFilepathEdit()
  : m_crBackGnd(RGB(255, 255, 255))
  , m_crText(RGB(0,0,0))
- , m_bActive(FALSE)
+ , m_bActive(false)
 {
 }
 
@@ -124,7 +124,7 @@ CFilepathEdit::CFilepathEdit()
  */
 BOOL CFilepathEdit::SubClassEdit(UINT nID, CWnd* pParent)
 {
-       m_bActive = FALSE;
+       m_bActive = false;
        return SubclassDlgItem(nID, pParent);
 };
 
index 4aa44e9..74a2002 100644 (file)
@@ -60,7 +60,7 @@ private:
 
        String m_sToolTipString; /**< buffer for return data from GetUpdatedTipText */
        String m_sOriginalText; /**< Full path that was given to control */
-       BOOL m_bActive; /**< Is the control active-looking? */
+       bool m_bActive; /**< Is the control active-looking? */
        COLORREF m_crText; /**< Control's text color. */
        COLORREF m_crBackGnd; /**< Control's background color. */
        CBrush m_brBackGnd; /**< Background brush for the control. */
index 1508fca..69b5153 100644 (file)
@@ -453,7 +453,7 @@ exitPrepAndCompare:
                if (m_pTimeSizeCompare == NULL)
                        m_pTimeSizeCompare.reset(new TimeSizeCompare());
 
-               m_pTimeSizeCompare->SetAdditionalOptions(!!pCtxt->m_bIgnoreSmallTimeDiff);
+               m_pTimeSizeCompare->SetAdditionalOptions(pCtxt->m_bIgnoreSmallTimeDiff);
                code = m_pTimeSizeCompare->CompareFiles(nCompMethod, pCtxt->GetCompareDirs(), di);
        }
        else
index f6363d0..241298f 100644 (file)
@@ -169,14 +169,14 @@ int CHexMergeDoc::UpdateDiffItem(CDirDoc *pDirDoc)
                        ::UpdateDiffItem(m_nBuffers, di, &ctxt);
                }
        }
-       BOOL bDiff = FALSE;
+       bool bDiff = false;
        int lengthFirst = m_pView[0]->GetLength();
        void *bufferFirst = m_pView[0]->GetBuffer(lengthFirst);
        for (int nBuffer = 1; nBuffer < m_nBuffers; nBuffer++)
        {
                int length = m_pView[nBuffer]->GetLength();
                if (lengthFirst != length)
-                       bDiff = TRUE;
+                       bDiff = true;
                else
                {
                        void *buffer = m_pView[nBuffer]->GetBuffer(length);
@@ -192,29 +192,29 @@ int CHexMergeDoc::UpdateDiffItem(CDirDoc *pDirDoc)
 /**
  * @brief Asks and then saves modified files
  */
-BOOL CHexMergeDoc::PromptAndSaveIfNeeded(BOOL bAllowCancel)
+bool CHexMergeDoc::PromptAndSaveIfNeeded(bool bAllowCancel)
 {
        bool bLModified = false, bMModified = false, bRModified = false;
 
        if (m_nBuffers == 3)
        {
-               bLModified = !!m_pView[0]->GetModified();
-               bMModified = !!m_pView[1]->GetModified();
-               bRModified = !!m_pView[2]->GetModified();
+               bLModified = m_pView[0]->GetModified();
+               bMModified = m_pView[1]->GetModified();
+               bRModified = m_pView[2]->GetModified();
        }
        else
        {
-               bLModified = !!m_pView[0]->GetModified();
-               bRModified = !!m_pView[1]->GetModified();
+               bLModified = m_pView[0]->GetModified();
+               bRModified = m_pView[1]->GetModified();
        }
        if (!bLModified && !bMModified && !bRModified)
-                return TRUE;
+                return true;
 
        const String &pathLeft = m_filePaths.GetLeft();
        const String &pathMiddle = m_filePaths.GetMiddle();
        const String &pathRight = m_filePaths.GetRight();
 
-       BOOL result = TRUE;
+       bool result = true;
        bool bLSaveSuccess = false, bMSaveSuccess = false, bRSaveSuccess = false;
 
        SaveClosingDlg dlg;
@@ -246,10 +246,10 @@ BOOL CHexMergeDoc::PromptAndSaveIfNeeded(BOOL bAllowCancel)
                                switch (Try(m_pView[0]->SaveFile(pathLeft.c_str())))
                                {
                                case 0:
-                                       bLSaveSuccess = TRUE;
+                                       bLSaveSuccess = true;
                                        break;
                                case IDCANCEL:
-                                       result = FALSE;
+                                       result = false;
                                        break;
                                }
                        }
@@ -265,10 +265,10 @@ BOOL CHexMergeDoc::PromptAndSaveIfNeeded(BOOL bAllowCancel)
                                switch (Try(m_pView[1]->SaveFile(pathMiddle.c_str())))
                                {
                                case 0:
-                                       bMSaveSuccess = TRUE;
+                                       bMSaveSuccess = true;
                                        break;
                                case IDCANCEL:
-                                       result = FALSE;
+                                       result = false;
                                        break;
                                }
                        }
@@ -284,10 +284,10 @@ BOOL CHexMergeDoc::PromptAndSaveIfNeeded(BOOL bAllowCancel)
                                switch (Try(m_pView[m_nBuffers - 1]->SaveFile(pathRight.c_str())))
                                {
                                case 0:
-                                       bRSaveSuccess = TRUE;
+                                       bRSaveSuccess = true;
                                        break;
                                case IDCANCEL:
-                                       result = FALSE;
+                                       result = false;
                                        break;
                                }
                        }
@@ -317,7 +317,7 @@ BOOL CHexMergeDoc::PromptAndSaveIfNeeded(BOOL bAllowCancel)
  */
 BOOL CHexMergeDoc::SaveModified()
 {
-       return PromptAndSaveIfNeeded(TRUE);
+       return PromptAndSaveIfNeeded(true);
 }
 
 /**
@@ -356,7 +356,7 @@ void CHexMergeDoc::DoFileSaveAs(int nBuffer)
                title = _("Save Right File As");
        else
                title = _("Save Middle File As");
-       if (SelectFile(AfxGetMainWnd()->GetSafeHwnd(), strPath, FALSE, path.c_str(), title))
+       if (SelectFile(AfxGetMainWnd()->GetSafeHwnd(), strPath, false, path.c_str(), title))
        {
                if (Try(m_pView[nBuffer]->SaveFile(strPath.c_str())) == IDCANCEL)
                        return;
@@ -462,7 +462,7 @@ void CHexMergeDoc::DirDocClosing(CDirDoc * pDirDoc)
 bool CHexMergeDoc::CloseNow()
 {
        // Allow user to cancel closing
-       if (!PromptAndSaveIfNeeded(TRUE))
+       if (!PromptAndSaveIfNeeded(true))
                return false;
 
        GetParentFrame()->CloseNow();
@@ -472,7 +472,7 @@ bool CHexMergeDoc::CloseNow()
 /**
 * @brief Load one file
 */
-HRESULT CHexMergeDoc::LoadOneFile(int index, LPCTSTR filename, BOOL readOnly, const String& strDesc)
+HRESULT CHexMergeDoc::LoadOneFile(int index, LPCTSTR filename, bool readOnly, const String& strDesc)
 {
        if (filename[0])
        {
@@ -583,7 +583,7 @@ void CHexMergeDoc::UpdateHeaderPath(int pane)
  */
 static void Customize(IHexEditorWindow::Settings *settings)
 {
-       settings->bSaveIni = FALSE;
+       settings->bSaveIni = false;
        //settings->iAutomaticBPL = FALSE;
        //settings->iBytesPerLine = 16;
        //settings->iFontSize = 8;
@@ -698,7 +698,7 @@ void CHexMergeDoc::OnUpdateFileSaveRight(CCmdUI* pCmdUI)
  */
 void CHexMergeDoc::OnUpdateFileSave(CCmdUI* pCmdUI)
 {
-       BOOL bModified = FALSE;
+       bool bModified = false;
        for (int nBuffer = 0; nBuffer < m_nBuffers; nBuffer++)
                bModified |= m_pView[nBuffer]->GetModified();
        pCmdUI->Enable(bModified);
@@ -717,7 +717,7 @@ void CHexMergeDoc::OnFileReload()
        for (int pane = 0; pane < m_nBuffers; pane++)
        {
                fileloc[pane].setPath(m_filePaths[pane]);
-               bRO[pane] = !!m_pView[pane]->GetReadOnly();
+               bRO[pane] = m_pView[pane]->GetReadOnly();
        }
        int nActivePane = GetActiveMergeView()->m_nThisPane;
        OpenDocs(m_nBuffers, fileloc, bRO, m_strDesc, nActivePane);
index 50aa969..5cc18e3 100644 (file)
@@ -77,7 +77,7 @@ public:
 public:
        ~CHexMergeDoc();
        int UpdateDiffItem(CDirDoc * pDirDoc);
-       BOOL PromptAndSaveIfNeeded(BOOL bAllowCancel);
+       bool PromptAndSaveIfNeeded(bool bAllowCancel);
        void SetDirDoc(CDirDoc * pDirDoc);
        void DirDocClosing(CDirDoc * pDirDoc);
        bool CloseNow();
@@ -91,7 +91,7 @@ public:
 private:
        void DoFileSave(int nBuffer);
        void DoFileSaveAs(int nBuffer);
-       HRESULT LoadOneFile(int index, LPCTSTR filename, BOOL readOnly, const String& strDesc);
+       HRESULT LoadOneFile(int index, LPCTSTR filename, bool readOnly, const String& strDesc);
 // Implementation data
 protected:
        CHexMergeView * m_pView[3]; /**< Pointer to left/right view */
index 96cfa0b..5130de9 100644 (file)
@@ -127,7 +127,7 @@ BOOL CHexMergeFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
                }
        }
 
-       m_wndSplitter.ResizablePanes(TRUE);
+       m_wndSplitter.ResizablePanes(true);
        m_wndSplitter.AutoResizePanes(GetOptionsMgr()->GetBool(OPT_RESIZE_PANES));
 
        // Merge frame has a header bar at top
index 4ac5512..7571e02 100644 (file)
@@ -244,9 +244,9 @@ int CHexMergeView::GetLength()
 /**
  * @brief Checks if file has changed since last update
  * @param [in] path File to check
- * @return TRUE if file is changed.
+ * @return `true` if file is changed.
  */
-BOOL CHexMergeView::IsFileChangedOnDisk(LPCTSTR path)
+bool CHexMergeView::IsFileChangedOnDisk(LPCTSTR path)
 {
        DiffFileInfo dfi;
        dfi.Update(path);
@@ -306,12 +306,12 @@ HRESULT CHexMergeView::SaveFile(LPCTSTR path)
        }
        // Ask user what to do about FILE_ATTRIBUTE_READONLY
        String strPath = path;
-       BOOL bApplyToAll = FALSE;
-       if (theApp.HandleReadonlySave(strPath, FALSE, bApplyToAll) == IDCANCEL)
+       bool bApplyToAll = false;
+       if (theApp.HandleReadonlySave(strPath, false, bApplyToAll) == IDCANCEL)
                return S_OK;
        path = strPath.c_str();
        // Take a chance to create a backup
-       if (!theApp.CreateBackup(FALSE, path))
+       if (!theApp.CreateBackup(false, path))
                return S_OK;
        // Write data to an intermediate file
        String tempPath = env::GetTemporaryPath();
@@ -352,9 +352,9 @@ HRESULT CHexMergeView::SaveFile(LPCTSTR path)
 /**
  * @brief Get modified flag
  */
-BOOL CHexMergeView::GetModified()
+bool CHexMergeView::GetModified()
 {
-       return m_pif->get_status()->iFileChanged;
+       return m_pif->get_status()->bFileChanged;
 }
 
 /**
@@ -376,7 +376,7 @@ void CHexMergeView::ClearUndoRecords()
 /**
  * @brief Get readonly flag
  */
-BOOL CHexMergeView::GetReadOnly()
+bool CHexMergeView::GetReadOnly()
 {
        return m_pif->get_settings()->bReadOnly;
 }
@@ -384,7 +384,7 @@ BOOL CHexMergeView::GetReadOnly()
 /**
  * @brief Set readonly flag
  */
-void CHexMergeView::SetReadOnly(BOOL bReadOnly)
+void CHexMergeView::SetReadOnly(bool bReadOnly)
 {
        m_pif->get_settings()->bReadOnly = bReadOnly;
 }
index 41c128a..527e198 100644 (file)
@@ -49,13 +49,13 @@ public:
        IHexEditorWindow *GetInterface() const { return m_pif; }
        BYTE *GetBuffer(int);
        int GetLength();
-       BOOL GetModified();
+       bool GetModified();
        void SetSavePoint();
        void ClearUndoRecords();
-       BOOL GetReadOnly();
-       void SetReadOnly(BOOL);
+       bool GetReadOnly();
+       void SetReadOnly(bool);
        void ResizeWindow();
-       BOOL IsFileChangedOnDisk(LPCTSTR);
+       bool IsFileChangedOnDisk(LPCTSTR);
        void ZoomText(int amount);
        static void CopySel(const CHexMergeView *src, CHexMergeView *dst);
        static void CopyAll(const CHexMergeView *src, CHexMergeView *dst);
index e1dcb29..17ef488 100644 (file)
@@ -523,21 +523,21 @@ int CImgMergeFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 * The bars are identified with their ID. This means the missing bar bug is triggered
 * when we run WinMerge after changing the ID of a bar.
 */
-BOOL CImgMergeFrame::EnsureValidDockState(CDockState& state)
+bool CImgMergeFrame::EnsureValidDockState(CDockState& state)
 {
        for (int i = (int)state.m_arrBarInfo.GetSize() - 1; i >= 0; i--)
        {
-               BOOL barIsCorrect = TRUE;
+               bool barIsCorrect = true;
                CControlBarInfo* pInfo = (CControlBarInfo*)state.m_arrBarInfo[i];
                if (!pInfo)
-                       barIsCorrect = FALSE;
+                       barIsCorrect = false;
                else
                {
                        if (!pInfo->m_bFloating)
                        {
                                pInfo->m_pBar = GetControlBar(pInfo->m_nBarID);
                                if (!pInfo->m_pBar)
-                                       barIsCorrect = FALSE; //toolbar id's probably changed   
+                                       barIsCorrect = false; //toolbar id's probably changed   
                        }
                }
 
@@ -655,8 +655,8 @@ bool CImgMergeFrame::DoFileSave(int pane)
                else
                {
                        String filename = ucr::toTString(m_pImgMergeWindow->GetFileName(pane));
-                       BOOL bApplyToAll = FALSE;
-                       if (theApp.HandleReadonlySave(filename, FALSE, bApplyToAll) == IDCANCEL)
+                       bool bApplyToAll = false;
+                       if (theApp.HandleReadonlySave(filename, false, bApplyToAll) == IDCANCEL)
                                return false;
                        theApp.CreateBackup(false, filename);
                        if (!m_pImgMergeWindow->SaveImage(pane))
@@ -680,10 +680,9 @@ bool CImgMergeFrame::DoFileSaveAs(int pane)
                title = _("Save Right File As");
        else
                title = _("Save Middle File As");
-       if (SelectFile(AfxGetMainWnd()->GetSafeHwnd(), strPath, FALSE, path.c_str(), title))
+       if (SelectFile(AfxGetMainWnd()->GetSafeHwnd(), strPath, false, path.c_str(), title))
        {
                std::wstring filename = ucr::toUTF16(strPath).c_str();
-               BOOL bApplyToAll = FALSE;
                if (m_pImgMergeWindow->SaveImageAs(pane, filename.c_str()))
                        return false;
                if (path.empty())
index db04cdb..2e3604a 100644 (file)
@@ -97,7 +97,7 @@ public:
 
 // Implementation
 private:
-       BOOL EnsureValidDockState(CDockState& state);
+       bool EnsureValidDockState(CDockState& state);
        void LoadOptions();
        void SaveOptions();
        void SavePosition();
index 06ab2d4..1eae229 100644 (file)
@@ -81,7 +81,7 @@ void CLocationBar::OnLButtonDown(UINT nFlags, CPoint point)
        TViewBarBase::OnLButtonDown(nFlags, point);
        if (m_pDockBar != NULL)
        {
-               if (IsVertDocked() == FALSE)
+               if (!IsVertDocked())
                        m_pDockContext->ToggleDocking();
        }
 }
index 5287ddf..ae5b00a 100644 (file)
@@ -88,7 +88,7 @@ CLocationView::CLocationView()
        , m_hwndFrame(nullptr)
        , m_pSavedBackgroundBitmap(nullptr)
        , m_bDrawn(false)
-       , m_bRecalculateBlocks(TRUE) // calculate for the first time
+       , m_bRecalculateBlocks(true) // calculate for the first time
 {
        // NB: set m_bIgnoreTrivials to false to see trivial diffs in the LocationView
        // There is no GUI to do this
@@ -151,7 +151,7 @@ CMergeDoc* CLocationView::GetDocument() // non-debug version is inline
  */
 void CLocationView::ForceRecalculate()
 {
-       m_bRecalculateBlocks = TRUE;
+       m_bRecalculateBlocks = true;
        Invalidate();
 }
 
@@ -163,7 +163,7 @@ void CLocationView::OnUpdate( CView* pSender, LPARAM lHint, CObject* pHint )
        UNREFERENCED_PARAMETER(pSender);
        UNREFERENCED_PARAMETER(lHint);
 
-       m_bRecalculateBlocks = TRUE;
+       m_bRecalculateBlocks = true;
        Invalidate();
 }
 
@@ -308,7 +308,7 @@ void CLocationView::CalculateBlocks()
 
                nDiff = pDoc->m_diffList.NextSignificantDiff(nDiff);
        }
-       m_bRecalculateBlocks = FALSE;
+       m_bRecalculateBlocks = false;
 }
 
 /**
@@ -365,14 +365,14 @@ void CLocationView::OnDraw(CDC* pDC)
 
        if (!pDoc->GetView(nGroup, 0)->IsInitialized()) return;
 
-       BOOL bEditedAfterRescan = FALSE;
+       bool bEditedAfterRescan = false;
        int nPaneNotModified = -1;
        for (int pane = 0; pane < pDoc->m_nBuffers; pane++)
        {
                if (!pDoc->IsEditedAfterRescan(pane))
                        nPaneNotModified = pane;
                else
-                       bEditedAfterRescan = TRUE;
+                       bEditedAfterRescan = true;
        }
 
        CRect rc;
@@ -435,7 +435,7 @@ void CLocationView::OnDraw(CDC* pDC)
                if (nPaneNotModified == -1)
                        continue;
                CMergeEditView *pView = pDoc->GetView(nGroup, nPaneNotModified);
-               const BOOL bInsideDiff = (nCurDiff == (*iter).diff_index);
+               const bool bInsideDiff = (nCurDiff == (*iter).diff_index);
 
                if ((nPrevEndY != (*iter).bottom_coord) || bInsideDiff)
                {
@@ -463,8 +463,8 @@ void CLocationView::OnDraw(CDC* pDC)
                nPrevEndY = (*iter).bottom_coord;
 
                // Test if we draw a connector
-               BOOL bDisplayConnectorFromLeft = FALSE;
-               BOOL bDisplayConnectorFromRight = FALSE;
+               bool bDisplayConnectorFromLeft = false;
+               bool bDisplayConnectorFromRight = false;
 
                switch (m_displayMovedBlocks)
                {
@@ -473,12 +473,12 @@ void CLocationView::OnDraw(CDC* pDC)
                        if (!bInsideDiff)
                                break;
                        // two sides may be linked to a block somewhere else
-                       bDisplayConnectorFromLeft = TRUE;
-                       bDisplayConnectorFromRight = TRUE;
+                       bDisplayConnectorFromLeft = true;
+                       bDisplayConnectorFromRight = true;
                        break;
                case DISPLAY_MOVED_ALL:
                        // we display all moved blocks, so once direction is enough
-                       bDisplayConnectorFromLeft = TRUE;
+                       bDisplayConnectorFromLeft = true;
                        break;
                default:
                        break;
@@ -568,7 +568,7 @@ void CLocationView::OnDraw(CDC* pDC)
  * @param [in] cr Color for rectangle.
  * @param [in] bSelected Is rectangle for selected difference?
  */
-void CLocationView::DrawRect(CDC* pDC, const CRect& r, COLORREF cr, BOOL bSelected)
+void CLocationView::DrawRect(CDC* pDC, const CRect& r, COLORREF cr, bool bSelected /*= false*/)
 {
        // Draw only colored blocks
        if (cr != CLR_NONE && cr != GetSysColor(COLOR_WINDOW))
@@ -683,11 +683,11 @@ void CLocationView::OnLButtonDblClk(UINT nFlags, CPoint point)
  * cannot be used to scroll to ghost lines.
  *
  * @param [in] point Point to move to
- * @param [in] bRealLine TRUE if we want to scroll using real line num,
+ * @param [in] bRealLine `true` if we want to scroll using real line num,
  * FALSE if view linenumbers are OK.
- * @return TRUE if succeeds, FALSE if point not inside bars.
+ * @return `true` if succeeds, `false` if point not inside bars.
  */
-bool CLocationView::GotoLocation(const CPoint& point, bool bRealLine)
+bool CLocationView::GotoLocation(const CPoint& point, bool bRealLine /*= true*/)
 {
        CRect rc;
        GetClientRect(rc);
@@ -706,7 +706,7 @@ bool CLocationView::GotoLocation(const CPoint& point, bool bRealLine)
        {
                // Outside bars, use left bar
                bar = BAR_0;
-               line = GetLineFromYPos(point.y, bar, FALSE);
+               line = GetLineFromYPos(point.y, bar, false);
        }
        else
                return false;
@@ -840,7 +840,7 @@ void CLocationView::OnContextMenu(CWnd* pWnd, CPoint point)
  * @param [in] bRealLine TRUE if real line is returned, FALSE for view line
  * @return 0-based index of view/real line in file [0...lines-1]
  */
-int CLocationView::GetLineFromYPos(int nYCoord, int bar, BOOL bRealLine)
+int CLocationView::GetLineFromYPos(int nYCoord, int bar, bool bRealLine /*= true*/)
 {
        CMergeEditView *pView = GetDocument()->GetActiveMergeGroupView(bar);
 
@@ -868,7 +868,7 @@ int CLocationView::GetLineFromYPos(int nYCoord, int bar, BOOL bRealLine)
        }
 
        // We've got a view line now
-       if (bRealLine == FALSE)
+       if (!bRealLine)
                return nLine;
 
        // Get real line (exclude ghost lines)
@@ -1059,7 +1059,7 @@ void CLocationView::OnSize(UINT nType, int cx, int cy)
        // TODO: Perhaps this should be determined from need to change bar size?
        // And we could change bar sizes more lazily, not from every one pixel change in size?
        if (cy != m_currentSize.cy)
-               m_bRecalculateBlocks = TRUE;
+               m_bRecalculateBlocks = true;
 
        if (cx != m_currentSize.cx)
        {
index e70281f..3dfb723 100644 (file)
@@ -81,9 +81,9 @@ protected:
 
 protected:
        CMergeDoc* GetDocument();
-       void DrawRect(CDC* pDC, const CRect& r, COLORREF cr, BOOL bSelected = FALSE);
+       void DrawRect(CDC* pDC, const CRect& r, COLORREF cr, bool bSelected = false);
        bool GotoLocation(const CPoint& point, bool bRealLine = true);
-       int GetLineFromYPos(int nYCoord, int bar, BOOL bRealLine = TRUE);
+       int GetLineFromYPos(int nYCoord, int bar, bool bRealLine = true);
        int IsInsideBar(const CRect& rc, const POINT& pt);
        void DrawVisibleAreaRect(CDC* pDC, int nTopLine = -1, int nBottomLine = -1);
        void DrawConnectLines(CDC* pDC);
@@ -107,7 +107,7 @@ private:
        std::unique_ptr<CBitmap> m_pSavedBackgroundBitmap; //*< Saved background */
        bool m_bDrawn; //*< Is already drawn in location pane? */
        std::vector<DiffBlock> m_diffBlocks; //*< List of pre-calculated diff blocks.
-       BOOL m_bRecalculateBlocks; //*< Recalculate diff blocks in next repaint.
+       bool m_bRecalculateBlocks; //*< Recalculate diff blocks in next repaint.
        CSize m_currentSize; //*< Current size of the panel.
 
        // Generated message map functions
index 398bf02..3127a3e 100644 (file)
@@ -267,7 +267,7 @@ static CPtrList &GetDocList(CMultiDocTemplate *pTemplate)
  * @todo Preference for logging?
  */
 CMainFrame::CMainFrame()
-: m_bFirstTime(TRUE)
+: m_bFirstTime(true)
 , m_pDropHandler(NULL)
 , m_bShowErrors(false)
 {
@@ -328,7 +328,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
        }
        m_wndTabBar.SetAutoMaxWidth(GetOptionsMgr()->GetBool(OPT_TABBAR_AUTO_MAXWIDTH));
 
-       if (GetOptionsMgr()->GetBool(OPT_SHOW_TABBAR) == false)
+       if (!GetOptionsMgr()->GetBool(OPT_SHOW_TABBAR))
                CMDIFrameWnd::ShowControlBar(&m_wndTabBar, false, 0);
 
        if (!m_wndStatusBar.Create(this))
@@ -346,7 +346,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
        m_wndStatusBar.SetPaneInfo(2, ID_STATUS_MERGINGMODE, 0, pointToPixel(75)); 
        m_wndStatusBar.SetPaneInfo(3, ID_STATUS_DIFFNUM, 0, pointToPixel(112)); 
 
-       if (GetOptionsMgr()->GetBool(OPT_SHOW_STATUSBAR) == false)
+       if (!GetOptionsMgr()->GetBool(OPT_SHOW_STATUSBAR))
                CMDIFrameWnd::ShowControlBar(&m_wndStatusBar, false, 0);
 
        m_pDropHandler = new DropHandler(std::bind(&CMainFrame::OnDropFiles, this, std::placeholders::_1));
@@ -525,7 +525,7 @@ HMENU CMainFrame::NewOpenViewMenu()
 void CMainFrame::OnMeasureItem(int nIDCtl,
        LPMEASUREITEMSTRUCT lpMeasureItemStruct)
 {
-       BOOL setflag = FALSE;
+       bool setflag = false;
        if (lpMeasureItemStruct->CtlType == ODT_MENU)
        {
                if (IsMenu(reinterpret_cast<HMENU>(static_cast<uintptr_t>(lpMeasureItemStruct->itemID))))
@@ -536,7 +536,7 @@ void CMainFrame::OnMeasureItem(int nIDCtl,
                        if (m_pMenus[MENU_DEFAULT]->IsMenu(cmenu))
                        {
                                m_pMenus[MENU_DEFAULT]->MeasureItem(lpMeasureItemStruct);
-                               setflag = TRUE;
+                               setflag = true;
                        }
                }
        }
@@ -715,7 +715,7 @@ bool CMainFrame::ShowMergeDoc(CDirDoc * pDirDoc,
        {
                if (dwFlags)
                {
-                       BOOL bModified = (dwFlags[pane] & FFILEOPEN_MODIFIED) > 0;
+                       bool bModified = (dwFlags[pane] & FFILEOPEN_MODIFIED) > 0;
                        if (bModified)
                        {
                                pMergeDoc->m_ptBuf[pane]->SetModified(TRUE);
@@ -879,10 +879,10 @@ static bool AddToRecentDocs(const PathContext& paths, const unsigned flags[], bo
  * @param [in] bRecurse Do we run recursive (folder) compare?
  * @param [in] pDirDoc Dir compare document to use.
  * @param [in] prediffer Prediffer plugin name.
- * @return TRUE if opening files and compare succeeded, FALSE otherwise.
+ * @return `true` if opening files and compare succeeded, `false` otherwise.
  */
-BOOL CMainFrame::DoFileOpen(const PathContext * pFiles /*=NULL*/,
-       const DWORD dwFlags[] /*=NULL*/, const String strDesc[] /*=NULL*/, const String& sReportFile /*=T("")*/, bool bRecurse /*=FALSE*/, CDirDoc *pDirDoc/*=NULL*/,
+bool CMainFrame::DoFileOpen(const PathContext * pFiles /*=NULL*/,
+       const DWORD dwFlags[] /*=NULL*/, const String strDesc[] /*=NULL*/, const String& sReportFile /*=T("")*/, bool bRecurse /*= false*/, CDirDoc *pDirDoc/*=NULL*/,
        String prediffer /*=_T("")*/, const PackingInfo *infoUnpacker/*=NULL*/)
 {
        if (pDirDoc && !pDirDoc->CloseMergeDocs())
@@ -1153,7 +1153,7 @@ void CMainFrame::ActivateFrame(int nCmdShow)
                return;
        }
 
-       m_bFirstTime = FALSE;
+       m_bFirstTime = false;
 
        WINDOWPLACEMENT wp;
        wp.length = sizeof(WINDOWPLACEMENT);
@@ -1200,7 +1200,7 @@ void CMainFrame::OnClose()
                return;
 
        // Check if there are multiple windows open and ask for closing them
-       BOOL bAskClosing = GetOptionsMgr()->GetBool(OPT_ASK_MULTIWINDOW_CLOSE);
+       bool bAskClosing = GetOptionsMgr()->GetBool(OPT_ASK_MULTIWINDOW_CLOSE);
        if (bAskClosing)
        {
                bool quit = AskCloseConfirmation();
@@ -1618,8 +1618,8 @@ void CMainFrame::OnToolsFilters()
                GetOptionsMgr()->SaveOption(OPT_LINEFILTER_ENABLED, linefiltersEnabled);
 
                // Check if compare documents need rescanning
-               BOOL bFileCompareRescan = FALSE;
-               BOOL bFolderCompareRescan = FALSE;
+               bool bFileCompareRescan = false;
+               bool bFolderCompareRescan = false;
                CFrameWnd * pFrame = GetActiveFrame();
                FRAMETYPE frame = GetFrameType(pFrame);
                if (frame == FRAME_FILE)
@@ -1627,7 +1627,7 @@ void CMainFrame::OnToolsFilters()
                        if (lineFiltersEnabledOrig != linefiltersEnabled ||
                                        !theApp.m_pLineFilters->Compare(lineFilters.get()))
                        {
-                               bFileCompareRescan = TRUE;
+                               bFileCompareRescan = true;
                        }
                }
                else if (frame == FRAME_FOLDER)
@@ -1638,7 +1638,7 @@ void CMainFrame::OnToolsFilters()
                        {
                                int res = LangMessageBox(IDS_FILTERCHANGED, MB_ICONWARNING | MB_YESNO);
                                if (res == IDYES)
-                                       bFolderCompareRescan = TRUE;
+                                       bFolderCompareRescan = true;
                        }
                }
 
@@ -1765,7 +1765,7 @@ void CMainFrame::OnFileOpenProject()
        
        // get the default projects path
        String strProjectPath = GetOptionsMgr()->GetString(OPT_PROJECTS_PATH);
-       if (!SelectFile(GetSafeHwnd(), sFilepath, TRUE, strProjectPath.c_str(), _T(""),
+       if (!SelectFile(GetSafeHwnd(), sFilepath, true, strProjectPath.c_str(), _T(""),
                        _("WinMerge Project Files (*.WinMerge)|*.WinMerge||")))
                return;
        
@@ -1979,7 +1979,7 @@ BOOL CMainFrame::CreateToolbar()
        nStyle |= TBSTYLE_DROPDOWN;
        m_wndToolBar.SetButtonInfo(index, nID, nStyle, iImage);
 
-       if (GetOptionsMgr()->GetBool(OPT_SHOW_TOOLBAR) == false)
+       if (!GetOptionsMgr()->GetBool(OPT_SHOW_TOOLBAR))
        {
                CMDIFrameWnd::ShowControlBar(&m_wndToolBar, false, 0);
        }
@@ -2205,11 +2205,11 @@ void CMainFrame::OnFileOpenConflict()
  * file as resolved file.
  * @param [in] conflictFile Full path to conflict file to open.
  * @param [in] checked If true, do not check if it really is project file.
- * @return TRUE if conflict file was opened for resolving.
+ * @return `true` if conflict file was opened for resolving.
  */
-BOOL CMainFrame::DoOpenConflict(const String& conflictFile, const String strDesc[], bool checked)
+bool CMainFrame::DoOpenConflict(const String& conflictFile, const String strDesc[] /*= nullptr*/, bool checked /*= false*/)
 {
-       BOOL conflictCompared = FALSE;
+       bool conflictCompared = false;
 
        if (!checked)
        {
@@ -2218,7 +2218,7 @@ BOOL CMainFrame::DoOpenConflict(const String& conflictFile, const String strDesc
                {
                        String message = strutils::format_string1(_("The file\n%1\nis not a conflict file."), conflictFile);
                        AfxMessageBox(message.c_str(), MB_ICONSTOP);
-                       return FALSE;
+                       return false;
                }
        }
 
@@ -2279,10 +2279,10 @@ BOOL CMainFrame::DoOpenConflict(const String& conflictFile, const String strDesc
 */
 CMainFrame::FRAMETYPE CMainFrame::GetFrameType(const CFrameWnd * pFrame) const
 {
-       BOOL bMergeFrame = pFrame->IsKindOf(RUNTIME_CLASS(CChildFrame));
-       BOOL bHexMergeFrame = pFrame->IsKindOf(RUNTIME_CLASS(CHexMergeFrame));
-       BOOL bImgMergeFrame = pFrame->IsKindOf(RUNTIME_CLASS(CImgMergeFrame));
-       BOOL bDirFrame = pFrame->IsKindOf(RUNTIME_CLASS(CDirFrame));
+       bool bMergeFrame = pFrame->IsKindOf(RUNTIME_CLASS(CChildFrame));
+       bool bHexMergeFrame = pFrame->IsKindOf(RUNTIME_CLASS(CHexMergeFrame));
+       bool bImgMergeFrame = pFrame->IsKindOf(RUNTIME_CLASS(CImgMergeFrame));
+       bool bDirFrame = pFrame->IsKindOf(RUNTIME_CLASS(CDirFrame));
 
        if (bMergeFrame)
                return FRAME_FILE;
index bf0247e..14ba00c 100644 (file)
@@ -78,7 +78,7 @@ public:
 
 // Attributes
 public:        
-       BOOL m_bShowErrors; /**< Show folder compare error items? */
+       bool m_bShowErrors; /**< Show folder compare error items? */
        LOGFONT m_lfDiff; /**< MergeView user-selected font */
        LOGFONT m_lfDir; /**< DirView user-selected font */
        static const TCHAR szClassName[];
@@ -95,7 +95,7 @@ public:
        void UpdatePrediffersMenu();
 
        void FileNew(int nPanes);
-       BOOL DoFileOpen(const PathContext *pFiles = NULL,
+       bool DoFileOpen(const PathContext *pFiles = NULL,
                const DWORD dwFlags[] = NULL, const String strDesc[] = NULL, const String& sReportFile = _T(""), bool bRecurse = false, CDirDoc *pDirDoc = NULL, String prediffer = _T(""), const PackingInfo * infoUnpacker = NULL);
        bool ShowAutoMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
                const DWORD dwFlags[], const String strDesc[], const String& sReportFile = _T(""), const PackingInfo * infoUnpacker = NULL);
@@ -112,7 +112,7 @@ public:
        void SelectFilter();
        void StartFlashing();
        bool AskCloseConfirmation();
-       BOOL DoOpenConflict(const String& conflictFile, const String strDesc[] = nullptr, bool checked = false);
+       bool DoOpenConflict(const String& conflictFile, const String strDesc[] = nullptr, bool checked = false);
        FRAMETYPE GetFrameType(const CFrameWnd * pFrame) const;
        void UpdateDocTitle();
        void ReloadMenu();
@@ -136,7 +136,7 @@ protected:
 
 // Public implementation data
 public:
-       BOOL m_bFirstTime; /**< If first time frame activated, get  pos from reg */
+       bool m_bFirstTime; /**< If first time frame activated, get  pos from reg */
 
 // Implementation data
 protected:
index aa90ae1..8949299 100644 (file)
@@ -105,7 +105,7 @@ END_MESSAGE_MAP()
 // CMergeApp construction
 
 CMergeApp::CMergeApp() :
-  m_bNeedIdleTimer(FALSE)
+  m_bNeedIdleTimer(false)
 , m_pOpenTemplate(0)
 , m_pDiffTemplate(0)
 , m_pHexMergeTemplate(0)
@@ -117,13 +117,13 @@ CMergeApp::CMergeApp() :
 , m_pGlobalFileFilter(new FileFilterHelper())
 , m_nActiveOperations(0)
 , m_pLangDlg(new CLanguageSelect())
-, m_bEscShutdown(FALSE)
+, m_bEscShutdown(false)
 , m_bExitIfNoDiff(MergeCmdLineInfo::Disabled)
 , m_pLineFilters(new LineFiltersList())
 , m_pFilterCommentsManager(new FilterCommentsManager())
 , m_pSyntaxColors(new SyntaxColors())
 , m_pMarkers(new CCrystalTextMarkers())
-, m_bMergingMode(FALSE)
+, m_bMergingMode(false)
 {
        // add construction code here,
        // Place all significant initialization in InitInstance
@@ -210,13 +210,13 @@ BOOL CMergeApp::InitInstance()
 
        // If paths were given to commandline we consider this being an invoke from
        // commandline (from other application, shellextension etc).
-       BOOL bCommandLineInvoke = cmdInfo.m_Files.GetSize() > 0;
+       bool bCommandLineInvoke = cmdInfo.m_Files.GetSize() > 0;
 
        // WinMerge registry settings are stored under HKEY_CURRENT_USER/Software/Thingamahoochie
        // This is the name of the company of the original author (Dean Grimm)
        SetRegistryKey(_T("Thingamahoochie"));
 
-       BOOL bSingleInstance = GetOptionsMgr()->GetBool(OPT_SINGLE_INSTANCE) ||
+       bool bSingleInstance = GetOptionsMgr()->GetBool(OPT_SINGLE_INSTANCE) ||
                (true == cmdInfo.m_bSingleInstance);
 
        // Create exclusion mutex name
@@ -259,7 +259,7 @@ BOOL CMergeApp::InitInstance()
        // Read last used filter from registry
        // If filter fails to set, reset to default
        const String filterString = m_pOptions->GetString(OPT_FILEFILTER_CURRENT);
-       BOOL bFilterSet = m_pGlobalFileFilter->SetFilter(filterString);
+       bool bFilterSet = m_pGlobalFileFilter->SetFilter(filterString);
        if (!bFilterSet)
        {
                String filter = m_pGlobalFileFilter->GetFilterNameOrMask();
@@ -397,15 +397,15 @@ BOOL CMergeApp::InitInstance()
 
        // Since this function actually opens paths for compare it must be
        // called after initializing CMainFrame!
-       BOOL bContinue = TRUE;
-       if (ParseArgsAndDoOpen(cmdInfo, pMainFrame) == FALSE && bCommandLineInvoke)
-               bContinue = FALSE;
+       bool bContinue = true;
+       if (!ParseArgsAndDoOpen(cmdInfo, pMainFrame) && bCommandLineInvoke)
+               bContinue = false;
 
        if (hMutex)
                ReleaseMutex(hMutex);
 
        // If user wants to cancel the compare, close WinMerge
-       if (bContinue == FALSE)
+       if (!bContinue)
        {
                pMainFrame->PostMessage(WM_CLOSE, 0, 0);
        }
@@ -501,7 +501,7 @@ int CMergeApp::DoMessageBox( LPCTSTR lpszPrompt, UINT nType, UINT nIDPrompt )
  */
 void CMergeApp::SetNeedIdleTimer()
 {
-       m_bNeedIdleTimer = TRUE
+       m_bNeedIdleTimer = true
 }
 
 bool CMergeApp::IsReallyIdle() const
@@ -528,7 +528,7 @@ BOOL CMergeApp::OnIdle(LONG lCount)
        // If anyone has requested notification when next idle occurs, send it
        if (m_bNeedIdleTimer)
        {
-               m_bNeedIdleTimer = FALSE;
+               m_bNeedIdleTimer = false;
                m_pMainWnd->SendMessageToDescendants(WM_TIMER, IDLE_TIMER, lCount, TRUE, FALSE);
        }
 
@@ -590,11 +590,11 @@ void CMergeApp::ApplyCommandLineConfigOptions(MergeCmdLineInfo& cmdInfo)
  * MergeCmdLineInfo class.
  * @param [in] cmdInfo Commandline parameters info.
  * @param [in] pMainFrame Pointer to application main frame.
- * @return TRUE if we opened the compare, FALSE if the compare was canceled.
+ * @return `true` if we opened the compare, `false` if the compare was canceled.
  */
-BOOL CMergeApp::ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainFrame)
+bool CMergeApp::ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainFrame)
 {
-       BOOL bCompared = FALSE;
+       bool bCompared = false;
        String strDesc[3];
        m_bNonInteractive = cmdInfo.m_bNonInteractive;
 
@@ -678,7 +678,7 @@ BOOL CMergeApp::ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainF
                }
                else if (cmdInfo.m_Files.GetSize() == 0) // if there are no input args, we can check the display file dialog flag
                {
-                       BOOL showFiles = m_pOptions->GetBool(OPT_SHOW_SELECT_FILES_AT_STARTUP);
+                       bool showFiles = m_pOptions->GetBool(OPT_SHOW_SELECT_FILES_AT_STARTUP);
                        if (showFiles)
                                pMainFrame->DoFileOpen();
                }
@@ -764,11 +764,11 @@ void CMergeApp::OpenFileToExternalEditor(const String& file, int nLineNumber/* =
                sCmd += _T("\"");
        }
 
-       BOOL retVal = FALSE;
+       bool retVal = false;
        STARTUPINFO stInfo = { sizeof STARTUPINFO };
        PROCESS_INFORMATION processInfo;
 
-       retVal = CreateProcess(NULL, (LPTSTR)sCmd.c_str(),
+       retVal = !!CreateProcess(NULL, (LPTSTR)sCmd.c_str(),
                NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE, NULL, NULL,
                &stInfo, &processInfo);
 
@@ -831,17 +831,17 @@ void CMergeApp::ShowHelp(LPCTSTR helpLocation /*= NULL*/)
  * succeeded or failed.
  * @param [in] bFolder Are we creating backup in folder compare?
  * @param [in] pszPath Full path to file to backup.
- * @return TRUE if backup succeeds, or isn't just done.
+ * @return `true` if backup succeeds, or isn't just done.
  */
-BOOL CMergeApp::CreateBackup(BOOL bFolder, const String& pszPath)
+bool CMergeApp::CreateBackup(bool bFolder, const String& pszPath)
 {
        // If user doesn't want to backups in folder compare, return
        // success so operations don't abort.
        if (bFolder && !(GetOptionsMgr()->GetBool(OPT_BACKUP_FOLDERCMP)))
-               return TRUE;
+               return true;
        // Likewise if user doesn't want backups in file compare
        else if (!bFolder && !(GetOptionsMgr()->GetBool(OPT_BACKUP_FILECMP)))
-               return TRUE;
+               return true;
 
        // create backup copy of file if destination file exists
        if (paths::DoesPathExist(pszPath) == paths::IS_EXISTING_FILE)
@@ -875,7 +875,7 @@ BOOL CMergeApp::CreateBackup(BOOL bFolder, const String& pszPath)
                        _RPTF0(_CRT_ERROR, "Unknown backup location!");
                }
 
-               BOOL success = FALSE;
+               bool success = false;
                if (GetOptionsMgr()->GetBool(OPT_BACKUP_ADD_BAK))
                {
                        // Don't add dot if there is no existing extension
@@ -903,7 +903,7 @@ BOOL CMergeApp::CreateBackup(BOOL bFolder, const String& pszPath)
                if ((bakPath.length() + filename.length() + ext.length())
                        < MAX_PATH_FULL)
                {
-                       success = TRUE;
+                       success = true;
                        bakPath = paths::ConcatPath(bakPath, filename);
                        bakPath += _T(".");
                        bakPath += ext;
@@ -920,13 +920,13 @@ BOOL CMergeApp::CreateBackup(BOOL bFolder, const String& pszPath)
                                _("Unable to backup original file:\n%1\n\nContinue anyway?"),
                                pszPath);
                        if (AfxMessageBox(msg.c_str(), MB_YESNO | MB_ICONWARNING | MB_DONT_ASK_AGAIN) != IDYES)
-                               return FALSE;
+                               return false;
                }
-               return TRUE;
+               return true;
        }
 
        // we got here because we're either not backing up of there was nothing to backup
-       return TRUE;
+       return true;
 }
 
 /**
@@ -943,13 +943,13 @@ BOOL CMergeApp::CreateBackup(BOOL bFolder, const String& pszPath)
  * @sa CMainFrame::SyncFileToVCS()
  * @sa CMergeDoc::DoSave()
  */
-int CMergeApp::HandleReadonlySave(String& strSavePath, BOOL bMultiFile,
-               BOOL &bApplyToAll)
+int CMergeApp::HandleReadonlySave(String& strSavePath, bool bMultiFile,
+               bool &bApplyToAll)
 {
        CFileStatus status;
        int nRetVal = IDOK;
-       BOOL bFileRO = FALSE;
-       BOOL bFileExists = FALSE;
+       bool bFileRO = false;
+       bool bFileExists = false;
        String s;
        String str;
        CString title;
@@ -1012,7 +1012,7 @@ int CMergeApp::HandleReadonlySave(String& strSavePath, BOOL bMultiFile,
                case IDNO:
                        if (!bMultiFile)
                        {
-                               if (SelectFile(AfxGetMainWnd()->GetSafeHwnd(), s, FALSE, strSavePath.c_str()))
+                               if (SelectFile(AfxGetMainWnd()->GetSafeHwnd(), s, false, strSavePath.c_str()))
                                {
                                        strSavePath = s;
                                        nRetVal = IDNO;
@@ -1090,7 +1090,7 @@ bool CMergeApp::SaveProjectFile(const String& sProject, const ProjectFile &proje
 /** 
  * @brief Read project and perform comparison specified
  * @param [in] sProject Full path to project file.
- * @return TRUE if loading project file and starting compare succeeded.
+ * @return `true` if loading project file and starting compare succeeded.
  */
 bool CMergeApp::LoadAndOpenProjectFile(const String& sProject, const String& sReportFile)
 {
@@ -1099,10 +1099,10 @@ bool CMergeApp::LoadAndOpenProjectFile(const String& sProject, const String& sRe
                return false;
        
        PathContext tFiles;
-       BOOL bLeftReadOnly = FALSE;
-       BOOL bMiddleReadOnly = FALSE;
-       BOOL bRightReadOnly = FALSE;
-       bool bRecursive = FALSE;
+       bool bLeftReadOnly = false;
+       bool bMiddleReadOnly = false;
+       bool bRightReadOnly = false;
+       bool bRecursive = false;
        project.GetPaths(tFiles, bRecursive);
        bLeftReadOnly = project.GetLeftReadOnly();
        bMiddleReadOnly = project.GetMiddleReadOnly();
@@ -1138,10 +1138,10 @@ bool CMergeApp::LoadAndOpenProjectFile(const String& sProject, const String& sRe
 
        GetOptionsMgr()->SaveOption(OPT_CMP_INCLUDE_SUBDIRS, bRecursive);
        
-       BOOL rtn = GetMainFrame()->DoFileOpen(&tFiles, dwFlags, NULL, sReportFile, bRecursive);
+       bool rtn = GetMainFrame()->DoFileOpen(&tFiles, dwFlags, NULL, sReportFile, bRecursive);
 
        AddToRecentProjectsMRU(sProject.c_str());
-       return !!rtn;
+       return rtn;
 }
 
 /**
index 17a8683..34ffab5 100644 (file)
@@ -59,7 +59,7 @@ enum { IDLE_TIMER = 9754 };
 class CMergeApp : public CWinApp
 {
 public:
-       BOOL m_bNeedIdleTimer;
+       bool m_bNeedIdleTimer;
        CMultiDocTemplate* m_pOpenTemplate;
        CMultiDocTemplate* m_pDiffTemplate;
        CMultiDocTemplate* m_pHexMergeTemplate;
@@ -69,7 +69,7 @@ public:
        std::unique_ptr<SyntaxColors> m_pSyntaxColors; /**< Syntax color container */
        std::unique_ptr<CCrystalTextMarkers> m_pMarkers; /**< Marker container */
        String m_strSaveAsPath; /**< "3rd path" where output saved if given */
-       BOOL m_bEscShutdown; /**< If commandline switch -e given ESC closes appliction */
+       bool m_bEscShutdown; /**< If commandline switch -e given ESC closes appliction */
        SyntaxColors * GetMainSyntaxColors() { return m_pSyntaxColors.get(); }
        CCrystalTextMarkers * GetMainMarkers() const { return m_pMarkers.get(); }
        MergeCmdLineInfo::ExitNoDiff m_bExitIfNoDiff; /**< Exit if files are identical? */
@@ -97,8 +97,8 @@ public:
        void ShowHelp(LPCTSTR helpLocation = NULL);
        void OpenFileToExternalEditor(const String& file, int nLineNumber = 1);
        void OpenFileOrUrl(LPCTSTR szFile, LPCTSTR szUrl);
-       BOOL CreateBackup(BOOL bFolder, const String& pszPath);
-       int HandleReadonlySave(String& strSavePath, BOOL bMultiFile, BOOL &bApplyToAll);
+       bool CreateBackup(bool bFolder, const String& pszPath);
+       int HandleReadonlySave(String& strSavePath, bool bMultiFile, bool &bApplyToAll);
        bool GetMergingMode() const;
        void SetMergingMode(bool bMergingMode);
        void SetupTempPath();
@@ -118,7 +118,7 @@ protected:
        //}}AFX_VIRTUAL
 
        void InitializeFileFilters();
-       BOOL ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainFrame);
+       bool ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainFrame);
        void UpdateDefaultCodepage(int cpDefaultMode, int cpCustomCodepage);
        void UpdateCodepageModule();
        void ApplyCommandLineConfigOptions(MergeCmdLineInfo & cmdInfo);
index 68007c2..7dc05fb 100644 (file)
@@ -423,7 +423,7 @@ int CMergeDoc::Rescan(bool &bBinary, IDENTLEVEL &identical,
                }
 
                m_diffWrapper.SetCreateDiffList(&m_diffList);
-               diffSuccess = !!m_diffWrapper.RunFileDiff();
+               diffSuccess = m_diffWrapper.RunFileDiff();
 
                // Read diff-status
                m_diffWrapper.GetDiffStatus(&status);
@@ -448,7 +448,7 @@ int CMergeDoc::Rescan(bool &bBinary, IDENTLEVEL &identical,
                        DiffList templist;
                        templist.Clear();
                        m_diffWrapper.SetCreateDiffList(&templist);
-                       diffSuccess = !!m_diffWrapper.RunFileDiff();
+                       diffSuccess = m_diffWrapper.RunFileDiff();
                        for (nBuffer = 0; nBuffer < m_nBuffers; nBuffer++)
                                nRealLine[nBuffer] = m_ptBuf[nBuffer]->ComputeRealLine(nStartLine[nBuffer]);
                        m_diffList.AppendDiffList(templist, nRealLine);
@@ -1330,7 +1330,7 @@ bool CMergeDoc::DoSave(LPCTSTR szPath, bool &bSaveSuccess, int nBuffer)
        DiffFileInfo fileInfo;
        String strSavePath(szPath);
        FileChange fileChanged;
-       BOOL bApplyToAll = false;       
+       bool bApplyToAll = false;       
        int nRetVal = -1;
 
        fileChanged = IsFileChangedOnDisk(szPath, fileInfo, true, nBuffer);
index 1fe2b05..5181bd1 100644 (file)
@@ -72,7 +72,7 @@ BOOL CMergeEditSplitterView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowNam
 {
        CView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
 
-       BOOL bSplitVert = !GetOptionsMgr()->GetBool(OPT_SPLIT_HORIZONTALLY);
+       bool bSplitVert = !GetOptionsMgr()->GetBool(OPT_SPLIT_HORIZONTALLY);
        if (m_bDetailView)
                bSplitVert = !bSplitVert;
 
@@ -96,7 +96,7 @@ BOOL CMergeEditSplitterView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowNam
                }
        }
 
-       m_wndSplitter.ResizablePanes(TRUE);
+       m_wndSplitter.ResizablePanes(true);
        m_wndSplitter.AutoResizePanes(GetOptionsMgr()->GetBool(OPT_RESIZE_PANES));
 
        m_nThisGroup = pDoc->m_nGroups;
index 7e83a67..9554c01 100644 (file)
@@ -704,7 +704,7 @@ void CMergeEditView::UpdateSiblingScrollPos (bool bHorz)
 /**
  * @brief Update other panes
  */
-void CMergeEditView::OnUpdateSibling (CCrystalTextView * pUpdateSource, BOOL bHorz)
+void CMergeEditView::OnUpdateSibling (CCrystalTextView * pUpdateSource, bool bHorz)
 {
        if (pUpdateSource != this)
        {
index 0d6c856..a67cc29 100644 (file)
@@ -107,7 +107,7 @@ private:
        /// active prediffer ID : helper to check the radio button
        int m_CurrentPredifferID;
 
-       bool m_bCurrentLineIsDiff; /**< TRUE if cursor is in diff line */
+       bool m_bCurrentLineIsDiff; /**< `true` if cursor is in diff line */
 
 // Operations
 public:
@@ -127,7 +127,7 @@ public:
        CMergeDoc* GetDocument();
        const CMergeDoc *GetDocument() const { return const_cast<CMergeEditView *>(this)->GetDocument(); }
        void UpdateResources();
-       BOOL IsModified() { return (LocateTextBuffer()->IsModified()); }
+       bool IsModified() { return (LocateTextBuffer()->IsModified()); }
        void PrimeListWithFile();
        void SetStatusInterface(IMergeEditStatus * piMergeEditStatus);
        void SelectArea(const CPoint & ptStart, const CPoint & ptEnd) { SetSelection(ptStart, ptEnd); } // make public
@@ -191,7 +191,7 @@ public:
 // Implementation
 protected:
        virtual ~CMergeEditView();
-       virtual void OnUpdateSibling (CCrystalTextView * pUpdateSource, BOOL bHorz);
+       virtual void OnUpdateSibling (CCrystalTextView * pUpdateSource, bool bHorz);
        virtual void OnUpdateCaret();
        bool MergeModeKeyDown(MSG* pMsg);
        int FindPrediffer(LPCTSTR prediffer) const;
index f3757c5..5696395 100644 (file)
@@ -248,16 +248,16 @@ void COpenView::OnInitialUpdate()
        m_ctlPath[2].AttachSystemImageList();
        LoadComboboxStates();
 
-       BOOL bDoUpdateData = TRUE;
+       bool bDoUpdateData = true;
        for (int index = 0; index < countof(m_strPath); index++)
        {
                if (!m_strPath[index].empty())
-                       bDoUpdateData = FALSE;
+                       bDoUpdateData = false;
        }
        UpdateData(bDoUpdateData);
 
        String filterNameOrMask = theApp.m_pGlobalFileFilter->GetFilterNameOrMask();
-       BOOL bMask = theApp.m_pGlobalFileFilter->IsUsingMask();
+       bool bMask = theApp.m_pGlobalFileFilter->IsUsingMask();
 
        if (!bMask)
        {
@@ -286,11 +286,11 @@ void COpenView::OnInitialUpdate()
 
        UpdateButtonStates();
 
-       BOOL bOverwriteRecursive = FALSE;
+       bool bOverwriteRecursive = false;
        if (m_dwFlags[0] & FFILEOPEN_PROJECT || m_dwFlags[1] & FFILEOPEN_PROJECT)
-               bOverwriteRecursive = TRUE;
+               bOverwriteRecursive = true;
        if (m_dwFlags[0] & FFILEOPEN_CMDLINE || m_dwFlags[1] & FFILEOPEN_CMDLINE)
-               bOverwriteRecursive = TRUE;
+               bOverwriteRecursive = true;
        if (!bOverwriteRecursive)
                m_bRecurse = GetOptionsMgr()->GetBool(OPT_CMP_INCLUDE_SUBDIRS);
 
@@ -516,7 +516,7 @@ void COpenView::OnOK()
        }
        else
        {
-               BOOL bFilterSet = theApp.m_pGlobalFileFilter->SetFilter(filter);
+               bool bFilterSet = theApp.m_pGlobalFileFilter->SetFilter(filter);
                if (!bFilterSet)
                        m_strExt = theApp.m_pGlobalFileFilter->GetFilterNameOrMask();
                GetOptionsMgr()->SaveOption(OPT_FILEFILTER_CURRENT, filter);
@@ -545,7 +545,7 @@ void COpenView::OnOK()
        PackingInfo tmpPackingInfo(pDoc->m_infoHandler);
        GetMainFrame()->DoFileOpen(
                &tmpPathContext, std::array<DWORD, 3>(pDoc->m_dwFlags).data(), 
-               NULL, _T(""), !!pDoc->m_bRecurse, NULL, _T(""), &tmpPackingInfo);
+               NULL, _T(""), pDoc->m_bRecurse, NULL, _T(""), &tmpPackingInfo);
 }
 
 /** 
@@ -734,8 +734,8 @@ static UINT UpdateButtonStatesThread(LPVOID lpParam)
                if (msg.message != WM_USER + 2)
                        continue;
 
-               BOOL bButtonEnabled = TRUE;
-               BOOL bInvalid[3] = {FALSE, FALSE, FALSE};
+               bool bButtonEnabled = true;
+               bool bInvalid[3] = {false, false, false};
                int iStatusMsgId = 0;
                int iUnpackerStatusMsgId = 0;
 
@@ -745,20 +745,20 @@ static UINT UpdateButtonStatesThread(LPVOID lpParam)
                delete pParams;
 
                // Check if we have project file as left side path
-               BOOL bProject = FALSE;
+               bool bProject = false;
                String ext;
                paths::SplitFilename(paths[0], NULL, NULL, &ext);
                if (paths[1].empty() && strutils::compare_nocase(ext, ProjectFile::PROJECTFILE_EXT) == 0)
-                       bProject = TRUE;
+                       bProject = true;
 
                if (!bProject)
                {
                        if (paths::DoesPathExist(paths[0], IsArchiveFile) == paths::DOES_NOT_EXIST)
-                               bInvalid[0] = TRUE;
+                               bInvalid[0] = true;
                        if (paths::DoesPathExist(paths[1], IsArchiveFile) == paths::DOES_NOT_EXIST)
-                               bInvalid[1] = TRUE;
+                               bInvalid[1] = true;
                        if (paths.GetSize() > 2 && paths::DoesPathExist(paths[2], IsArchiveFile) == paths::DOES_NOT_EXIST)
-                               bInvalid[2] = TRUE;
+                               bInvalid[2] = true;
                }
 
                // Enable buttons as appropriate
@@ -814,7 +814,7 @@ static UINT UpdateButtonStatesThread(LPVOID lpParam)
                                iUnpackerStatusMsgId = IDS_OPEN_UNPACKERDISABLED;
 
                        if (bProject)
-                               bButtonEnabled = TRUE;
+                               bButtonEnabled = true;
                        else
                                bButtonEnabled = (pathsType != paths::DOES_NOT_EXIST);
                }
@@ -1025,7 +1025,7 @@ void COpenView::OnSelectFilter()
        String filterPrefix = _("[F] ");
        String curFilter;
 
-       const BOOL bUseMask = theApp.m_pGlobalFileFilter->IsUsingMask();
+       const bool bUseMask = theApp.m_pGlobalFileFilter->IsUsingMask();
        GetDlgItemText(IDC_EXT_COMBO, curFilter);
        curFilter = strutils::trim_ws(curFilter);
 
@@ -1071,9 +1071,9 @@ void COpenView::OnDropDownOptions(NMHDR *pNMHDR, LRESULT *pResult)
  * project file are kept in memory and used later when loading paths
  * selected.
  * @param [in] path Path to the project file.
- * @return TRUE if the project file was successfully loaded, FALSE otherwise.
+ * @return `true` if the project file was successfully loaded, `false` otherwise.
  */
-BOOL COpenView::LoadProjectFile(const String &path)
+bool COpenView::LoadProjectFile(const String &path)
 {
        String filterPrefix = _("[F] ");
        ProjectFile prj;
index 1294fdc..22e48c0 100644 (file)
@@ -110,7 +110,7 @@ public:
 protected:
        void SetStatus(UINT msgID);
        void SetUnpackerStatus(UINT msgID);
-       BOOL LoadProjectFile(const String &path);
+       bool LoadProjectFile(const String &path);
        void TerminateThreadIfRunning();
        void TrimPaths();
        void OnButton(int index);
index e3526fc..2f78a39 100644 (file)
@@ -56,11 +56,8 @@ void Load(COptionsMgr *pOptionsMgr, ::SyntaxColors *pSyntaxColors)
                pSyntaxColors->SetColor(i, ref);
        
                valuename = strutils::format(_T("%s/Bold%02u"), DefColorsPath, i);
-               bool bBold = pSyntaxColors->GetBold(i);
-               pOptionsMgr->InitOption(valuename, bBold);
-               int nBold = pOptionsMgr->GetBool(valuename);
-               bBold = nBold ? true : false;
-               pSyntaxColors->SetBold(i, bBold);
+               pOptionsMgr->InitOption(valuename, pSyntaxColors->GetBold(i));
+               pSyntaxColors->SetBold(i, pOptionsMgr->GetBool(valuename));
        }
 }
 
index 8136786..0cfd021 100644 (file)
@@ -152,7 +152,7 @@ void CPatchDlg::OnOK()
                        m_ctlResult.SetWindowText(m_fileResult.c_str());
                        DeleteFile(m_fileResult.c_str());
                }
-               if (paths::IsPathAbsolute(m_fileResult) == FALSE)
+               if (!paths::IsPathAbsolute(m_fileResult))
                {
                        String msg = strutils::format_string1(_("The specified output path is not an absolute path: %1"),
                                m_fileResult);
@@ -270,7 +270,7 @@ void CPatchDlg::OnDiffBrowseFile1()
        String folder;
 
        folder = m_file1;
-       if (SelectFile(GetSafeHwnd(), s, TRUE, folder.c_str()))
+       if (SelectFile(GetSafeHwnd(), s, true, folder.c_str()))
                m_ctlFile1.SetWindowText(s.c_str());
 }
 
@@ -283,7 +283,7 @@ void CPatchDlg::OnDiffBrowseFile2()
        String folder;
 
        folder = m_file2;
-       if (SelectFile(GetSafeHwnd(), s, TRUE, folder.c_str()))
+       if (SelectFile(GetSafeHwnd(), s, true, folder.c_str()))
                m_ctlFile2.SetWindowText(s.c_str());
 }
 
@@ -296,7 +296,7 @@ void CPatchDlg::OnDiffBrowseResult()
        String folder;
 
        folder = m_fileResult;
-       if (SelectFile(GetSafeHwnd(), s, FALSE, folder.c_str()))
+       if (SelectFile(GetSafeHwnd(), s, false, folder.c_str()))
                m_ctlResult.SetWindowText(s.c_str());
 }
 
index 9938ea3..258d755 100644 (file)
@@ -181,7 +181,7 @@ int CPatchTool::CreatePatch()
 
 /** 
  * @brief Show patch options dialog and check options selected.
- * @return TRUE if user wants to create a patch (didn't cancel dialog).
+ * @return `true` if user wants to create a patch (didn't cancel dialog).
  */
 bool CPatchTool::ShowDialog(CPatchDlg *pDlgPatch)
 {
@@ -200,7 +200,7 @@ bool CPatchTool::ShowDialog(CPatchDlg *pDlgPatch)
                patchOptions.nContext = pDlgPatch->m_contextLines;
 
                // Checkbox - can't be wrong
-               patchOptions.bAddCommandline = !!pDlgPatch->m_includeCmdLine;
+               patchOptions.bAddCommandline = pDlgPatch->m_includeCmdLine;
                m_diffWrapper.SetPatchOptions(&patchOptions);
 
                // These are from checkboxes and radiobuttons - can't be wrong
index 4dbfbed..9eba724 100644 (file)
@@ -50,7 +50,7 @@ class PluginInfo
 {
 public:
        PluginInfo()
-               : m_lpDispatch(NULL), m_filters(NULL), m_bAutomatic(FALSE), m_nFreeFunctions(0), m_disabled(false)
+               : m_lpDispatch(NULL), m_filters(NULL), m_bAutomatic(false), m_nFreeFunctions(0), m_disabled(false)
        {       
        }
 
index f8f9575..0acde3a 100644 (file)
@@ -55,7 +55,7 @@ void PropArchive::ReadOptions()
 void PropArchive::WriteOptions()
 {
        GetOptionsMgr()->SaveOption(OPT_ARCHIVE_ENABLE, (int)(m_bEnableSupport ? 1 : 0));
-       GetOptionsMgr()->SaveOption(OPT_ARCHIVE_PROBETYPE, m_bProbeType == TRUE);
+       GetOptionsMgr()->SaveOption(OPT_ARCHIVE_PROBETYPE, m_bProbeType);
 }
 
 /** 
index 34fef8e..8ce8dbe 100644 (file)
@@ -28,7 +28,7 @@ public:
                }
                wnd.Create(_T("heksedit"), NULL, 0, CRect(), pwndParent, 1);
                get_interface()->read_ini_data();
-               get_interface()->get_settings()->bSaveIni = TRUE;
+               get_interface()->get_settings()->bSaveIni = true;
        }
 
        IHexEditorWindow *get_interface()
index b98ed86..c38c279 100644 (file)
@@ -95,8 +95,8 @@ void PropEditor::WriteOptions()
        GetOptionsMgr()->SaveOption(OPT_AUTOMATIC_RESCAN, m_bAutomaticRescan);
        GetOptionsMgr()->SaveOption(OPT_ALLOW_MIXED_EOL, m_bAllowMixedEol);
        GetOptionsMgr()->SaveOption(OPT_SYNTAX_HIGHLIGHT, m_bHiliteSyntax);
-       GetOptionsMgr()->SaveOption(OPT_WORDDIFF_HIGHLIGHT, !!m_bViewLineDifferences);
-       GetOptionsMgr()->SaveOption(OPT_BREAK_ON_WORDS, !!m_bBreakOnWords);
+       GetOptionsMgr()->SaveOption(OPT_WORDDIFF_HIGHLIGHT, m_bViewLineDifferences);
+       GetOptionsMgr()->SaveOption(OPT_BREAK_ON_WORDS, m_bBreakOnWords);
        GetOptionsMgr()->SaveOption(OPT_BREAK_TYPE, m_nBreakType);
        GetOptionsMgr()->SaveOption(OPT_BREAK_SEPARATORS, String(m_breakChars));
 }
@@ -141,10 +141,10 @@ void PropEditor::UpdateLineDiffControls()
 {
        UpdateDataFromWindow();
        // Can only choose char/word level if line differences are enabled
-       EnableDlgItem(IDC_EDITOR_CHARLEVEL, !!m_bViewLineDifferences);
-       EnableDlgItem(IDC_EDITOR_WORDLEVEL, !!m_bViewLineDifferences);
+       EnableDlgItem(IDC_EDITOR_CHARLEVEL, m_bViewLineDifferences);
+       EnableDlgItem(IDC_EDITOR_WORDLEVEL, m_bViewLineDifferences);
        // Can only choose break type if line differences are enabled & we're breaking on words
-       EnableDlgItem(IDC_BREAK_TYPE, !!m_bViewLineDifferences);
+       EnableDlgItem(IDC_BREAK_TYPE, m_bViewLineDifferences);
 }
 
 /** 
index 8346072..5394193 100644 (file)
@@ -80,7 +80,7 @@ void PropRegistry::ReadOptions()
  */
 void PropRegistry::WriteOptions()
 {
-       GetOptionsMgr()->SaveOption(OPT_USE_RECYCLE_BIN, m_bUseRecycleBin == TRUE);
+       GetOptionsMgr()->SaveOption(OPT_USE_RECYCLE_BIN, m_bUseRecycleBin);
 
        String sExtEditor = strutils::trim_ws(m_strEditorPath);
        if (sExtEditor.empty())
@@ -113,7 +113,7 @@ BOOL PropRegistry::OnInitDialog()
 void PropRegistry::OnBrowseEditor()
 {
        String path;
-       if (SelectFile(GetSafeHwnd(), path, TRUE, m_strEditorPath.c_str(), _T(""), _("Programs|*.exe;*.bat;*.cmd|All Files (*.*)|*.*||")))
+       if (SelectFile(GetSafeHwnd(), path, true, m_strEditorPath.c_str(), _T(""), _("Programs|*.exe;*.bat;*.cmd|All Files (*.*)|*.*||")))
        {
                SetDlgItemText(IDC_EXT_EDITOR_PATH, path);
        }
index 4860278..5d12893 100644 (file)
@@ -106,7 +106,7 @@ bool TempFile::Delete()
                success = !!DeleteFile(m_path.c_str());
        if (success)
                m_path = _T("");
-       return !!success;
+       return success;
 }
 /** 
  * @brief Cleanup tempfiles created by WinMerge.
index 911dfad..fff48e5 100644 (file)
@@ -35,7 +35,7 @@ TEST(CodepageTest, UCS2)
                paths::ConcatPath(projectRoot, L"Testing/Data/Unicode/UCS-2BE/DiffItem.h"),\r
                paths::ConcatPath(projectRoot, L"Testing/Data/Unicode/UCS-2LE/DiffItem.h")\r
        };\r
-       EXPECT_TRUE(!!GetMainFrame()->DoFileOpen(&tFiles));\r
+       EXPECT_TRUE(GetMainFrame()->DoFileOpen(&tFiles));\r
        CFrameWnd *pFrame = GetMainFrame()->GetActiveFrame();\r
        CMergeDoc *pDoc = dynamic_cast<CMergeDoc *>(pFrame->GetActiveDocument());\r
        ASSERT_NE(nullptr, pDoc);\r
@@ -53,7 +53,7 @@ TEST(CodepageTest, UTF8)
                paths::ConcatPath(projectRoot, L"Testing/Data/Unicode/UTF-8/DiffItem.h"),\r
                paths::ConcatPath(projectRoot, L"Testing/Data/Unicode/UTF-8-NOBOM/DiffItem.h")\r
        };\r
-       EXPECT_TRUE(!!GetMainFrame()->DoFileOpen(&tFiles));\r
+       EXPECT_TRUE(GetMainFrame()->DoFileOpen(&tFiles));\r
        CFrameWnd *pFrame = GetMainFrame()->GetActiveFrame();\r
        CMergeDoc *pDoc = dynamic_cast<CMergeDoc *>(pFrame->GetActiveDocument());\r
        EXPECT_NE(nullptr, pDoc);\r
@@ -75,7 +75,7 @@ TEST(SyntaxHighlight, Verilog)
        };\r
        CMessageBoxDialog dlg(nullptr, IDS_FILESSAME, 0U, 0U, IDS_FILESSAME);\r
        const int nPrevFormerResult = dlg.SetFormerResult(IDOK);\r
-       EXPECT_TRUE(!!GetMainFrame()->DoFileOpen(&tFiles));\r
+       EXPECT_TRUE(GetMainFrame()->DoFileOpen(&tFiles));\r
        CFrameWnd *pFrame = GetMainFrame()->GetActiveFrame();\r
        CMergeDoc *pDoc = dynamic_cast<CMergeDoc *>(pFrame->GetActiveDocument());\r
        EXPECT_NE(nullptr, pDoc);\r
@@ -119,7 +119,7 @@ TEST(FolderCompare, IgnoreEOL)
        {\r
                GetOptionsMgr()->Set(OPT_CMP_METHOD, 0/* Full Contents*/);\r
                GetOptionsMgr()->Set(OPT_CMP_IGNORE_EOL, true);\r
-               EXPECT_TRUE(!!GetMainFrame()->DoFileOpen(&dirs));\r
+               EXPECT_TRUE(GetMainFrame()->DoFileOpen(&dirs));\r
                CFrameWnd *pFrame = GetMainFrame()->GetActiveFrame();\r
                CDirDoc *pDoc = dynamic_cast<CDirDoc *>(pFrame->GetActiveDocument());\r
                EXPECT_NE(nullptr, pDoc);\r
@@ -263,7 +263,7 @@ TEST(ImageCompareTest, Open)
        };\r
        CMessageBoxDialog dlg(nullptr, IDS_FILESSAME, 0U, 0U, IDS_FILESSAME);\r
        const int nPrevFormerResult = dlg.SetFormerResult(IDOK);\r
-       EXPECT_TRUE(!!GetMainFrame()->DoFileOpen(&tFiles));\r
+       EXPECT_TRUE(GetMainFrame()->DoFileOpen(&tFiles));\r
        CFrameWnd *pFrame = GetMainFrame()->GetActiveFrame();\r
        CImgMergeFrame *pDoc = dynamic_cast<CImgMergeFrame *>(pFrame);\r
        EXPECT_NE(nullptr, pDoc);\r
index 746dd4b..e6a7186 100644 (file)
@@ -28,7 +28,7 @@ IsWinVer_OrGreater(WORD wVersion, WORD wServicePack = 0)
        osvi.dwMinorVersion = LOBYTE(wVersion);
        osvi.wServicePackMajor = wServicePack;
 
-       return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE;
+       return !!VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask);
 }
 
 
index 8013d24..acd0c55 100644 (file)
@@ -32,7 +32,7 @@ DATE:         BY:                                     DESCRIPTION:
 /**
  * @brief Throw DLLPSTUB related exception.
  */
-void DLLPSTUB::Throw(LPCSTR name, HMODULE handle, DWORD dwError, BOOL bFreeLibrary)
+void DLLPSTUB::Throw(LPCSTR name, HMODULE handle, DWORD dwError, bool bFreeLibrary)
 {
        CString strError = name;
        if (handle)
@@ -105,7 +105,7 @@ HMODULE DLLPSTUB::Load()
                                                // Well, that's the most appropriate canned system
                                                // message I came across: If DLL is outdated, it may
                                                // actually lack some interface we need...
-                                               Throw(0, handle, CO_S_NOTALLINTERFACES, TRUE);
+                                               Throw(0, handle, CO_S_NOTALLINTERFACES, true);
                                        }
                                }
                                LPCSTR *pszExport = proxy;
@@ -132,7 +132,7 @@ HMODULE DLLPSTUB::Load()
                                dwError = ERROR_PROC_NOT_FOUND;
                                handle1 = (HMODULE)proxy[2];
                        }
-                       Throw(name, handle1, dwError, FALSE);
+                       Throw(name, handle1, dwError, false);
                }
        }
        return handle;
index 9dfb2cc..deb642f 100644 (file)
@@ -37,6 +37,6 @@ struct DLLPSTUB
        DWORD dwMinorVersion;                                   // Minor version
        DWORD dwBuildNumber;                                    // Build number
        DWORD dwPadding;                                                // Pad to 64 bit boundary
-       static void Throw(LPCSTR name, HMODULE, DWORD dwError, BOOL bFreeLibrary);
+       static void Throw(LPCSTR name, HMODULE, DWORD dwError, bool bFreeLibrary);
        HMODULE Load();
 };
index 33295b2..7d82f7d 100644 (file)
@@ -62,20 +62,18 @@ public:
                int iBytesPerLine; /**< How many bytes in one line in hex view. */\r
                int iAutomaticBPL; /**< Add max amount of bytes that fit to view. */\r
                BYTE_ENDIAN iBinaryMode; /**< Binary mode, little/big endian. */\r
-               int bReadOnly; /**< Is editor in read-only mode? */\r
-               int bSaveIni; /**< Save INI file when required. */\r
+               bool bReadOnly; /**< Is editor in read-only mode? */\r
+               bool bSaveIni; /**< Save INI file when required. */\r
                int iFontSize;\r
                int iCharacterSet; /**< Use OEM or ANSI character set? */\r
                int iMinOffsetLen; /**< Minimum numbers used in offset. */\r
                int iMaxOffsetLen; /**< Maximum numbers used in offset. */\r
-               int bAutoOffsetLen; /**< Determine offset length automatically. */\r
-               int bCenterCaret;\r
                int iFontZoom;\r
        };\r
 \r
        struct Status\r
        {\r
-               int iFileChanged;\r
+               bool bFileChanged;\r
                int const(iEnteringMode);\r
                int const(iCurByte);\r
                int const(iCurNibble);\r