OSDN Git Service

Various refactorings involving NULL, ASSERT, TRUE and FALSE (6)
authorGreyMerlin <greymerlin7@gmail.com>
Fri, 26 Oct 2018 23:50:31 +0000 (16:50 -0700)
committerGreyMerlin <greymerlin7@gmail.com>
Sun, 28 Oct 2018 15:03:37 +0000 (08:03 -0700)
More of the same...

124 files changed:
Externals/crystaledit/editlib/LineInfo.cpp
Externals/crystaledit/editlib/UndoRecord.cpp
Externals/crystaledit/editlib/UndoRecord.h
Externals/crystaledit/editlib/asp.cpp
Externals/crystaledit/editlib/basic.cpp
Externals/crystaledit/editlib/batch.cpp
Externals/crystaledit/editlib/ccrystaleditview.cpp
Externals/crystaledit/editlib/ccrystaltextbuffer.cpp
Externals/crystaledit/editlib/ccrystaltextview.cpp
Externals/crystaledit/editlib/ccrystaltextview2.cpp
Externals/crystaledit/editlib/ceditreplacedlg.cpp
Externals/crystaledit/editlib/chcondlg.cpp
Externals/crystaledit/editlib/cplusplus.cpp
Externals/crystaledit/editlib/cregexp_poco.cpp
Externals/crystaledit/editlib/crystaleditviewex.cpp
Externals/crystaledit/editlib/crystalparser.cpp
Externals/crystaledit/editlib/cs2cs.cpp
Externals/crystaledit/editlib/csharp.cpp
Externals/crystaledit/editlib/css.cpp
Externals/crystaledit/editlib/ctextmarkerdlg.cpp
Externals/crystaledit/editlib/dcl.cpp
Externals/crystaledit/editlib/filesup.cpp
Externals/crystaledit/editlib/fortran.cpp
Externals/crystaledit/editlib/fpattern.cpp
Externals/crystaledit/editlib/go.cpp
Externals/crystaledit/editlib/gotodlg.cpp
Externals/crystaledit/editlib/html.cpp
Externals/crystaledit/editlib/ini.cpp
Externals/crystaledit/editlib/innosetup.cpp
Externals/crystaledit/editlib/is.cpp
Externals/crystaledit/editlib/java.cpp
Externals/crystaledit/editlib/lisp.cpp
Externals/crystaledit/editlib/memcombo.cpp
Externals/crystaledit/editlib/nsis.cpp
Externals/crystaledit/editlib/pascal.cpp
Externals/crystaledit/editlib/perl.cpp
Externals/crystaledit/editlib/php.cpp
Externals/crystaledit/editlib/po.cpp
Externals/crystaledit/editlib/powershell.cpp
Externals/crystaledit/editlib/python.cpp
Externals/crystaledit/editlib/registry.cpp
Externals/crystaledit/editlib/rexx.cpp
Externals/crystaledit/editlib/rsrc.cpp
Externals/crystaledit/editlib/ruby.cpp
Externals/crystaledit/editlib/rust.cpp
Externals/crystaledit/editlib/sgml.cpp
Externals/crystaledit/editlib/sh.cpp
Externals/crystaledit/editlib/siod.cpp
Externals/crystaledit/editlib/sql.cpp
Externals/crystaledit/editlib/statbar.cpp
Externals/crystaledit/editlib/tcl.cpp
Externals/crystaledit/editlib/tex.cpp
Externals/crystaledit/editlib/verilog.cpp
Externals/crystaledit/editlib/vhdl.cpp
Externals/crystaledit/editlib/xml.cpp
Src/7zCommon.cpp
Src/AboutDlg.cpp
Src/ChildFrm.cpp
Src/Common/BCMenu.cpp
Src/Common/CMoveConstraint.cpp
Src/Common/ClipBoard.cpp
Src/Common/ExConverter.cpp
Src/Common/MDITabBar.cpp
Src/Common/MessageBoxDialog.cpp
Src/Common/PreferencesDlg.cpp
Src/Common/PropertyPageHost.cpp
Src/Common/ShellContextMenu.cpp
Src/Common/UniFile.cpp
Src/Common/VersionInfo.cpp
Src/Common/scbarcf.cpp
Src/Common/sizecbar.cpp
Src/Common/unicoder.cpp
Src/ConfigLog.cpp
Src/DiffTextBuffer.cpp
Src/DiffWrapper.cpp
Src/DirActions.cpp
Src/DirCmpReport.cpp
Src/DirColsDlg.cpp
Src/DirCompProgressBar.cpp
Src/DirDoc.cpp
Src/DirFrame.cpp
Src/DirScan.cpp
Src/DirView.cpp
Src/EditorFilepathBar.cpp
Src/FilepathEdit.cpp
Src/FolderCmp.cpp
Src/HexMergeView.cpp
Src/ImgMergeFrm.cpp
Src/ImgMergeFrm.h
Src/LineFiltersDlg.cpp
Src/LineFiltersDlg.h
Src/LoadSaveCodepageDlg.cpp
Src/LoadSaveCodepageDlg.h
Src/MainFrm.cpp
Src/Merge.cpp
Src/Merge.h
Src/Merge7zFormatRegister.h
Src/MergeDoc.cpp
Src/MergeDocEncoding.cpp
Src/MergeEditSplitterView.h
Src/MergeEditView.cpp
Src/MergeStatusBar.cpp
Src/OpenFrm.cpp
Src/OpenView.cpp
Src/PatchDlg.cpp
Src/PatchDlg.h
Src/PluginsListDlg.cpp
Src/PluginsListDlg.h
Src/ProjectFile.cpp
Src/ProjectFile.h
Src/PropCodepage.cpp
Src/PropGeneral.cpp
Src/PropShell.cpp
Src/PropTextColors.cpp
Src/SaveClosingDlg.cpp
Src/SaveClosingDlg.h
Src/SelectUnpackerDlg.cpp
Src/SelectUnpackerDlg.h
Src/SharedFilterDlg.cpp
Src/SharedFilterDlg.h
Src/TrDialogs.h
Src/codepage_detect.cpp
Src/paths.cpp
Src/paths.h

index 1d7e119..cc3fbb1 100644 (file)
@@ -32,10 +32,10 @@ LineInfo::LineInfo()
  */
 void LineInfo::Clear()
 {
-  if (m_pcLine != NULL)
+  if (m_pcLine != nullptr)
     {
       delete[] m_pcLine;
-      m_pcLine = NULL;
+      m_pcLine = nullptr;
       m_nLength = 0;
       m_nMax = 0;
       m_nEolChars = 0;
@@ -50,10 +50,10 @@ void LineInfo::Clear()
  */
 void LineInfo::FreeBuffer()
 {
-  if (m_pcLine != NULL)
+  if (m_pcLine != nullptr)
     {
       delete[] m_pcLine;
-      m_pcLine = NULL;
+      m_pcLine = nullptr;
       m_nLength = 0;
       m_nMax = 0;
       m_nEolChars = 0;
@@ -78,7 +78,7 @@ void LineInfo::Create(LPCTSTR pszLine, size_t nLength)
   m_nMax = ALIGN_BUF_SIZE (m_nLength + 1);
   ASSERT (m_nMax < INT_MAX);
   ASSERT (m_nMax >= m_nLength + 1);
-  if (m_pcLine != NULL)
+  if (m_pcLine != nullptr)
     delete[] m_pcLine;
   m_pcLine = new TCHAR[m_nMax];
   ZeroMemory(m_pcLine, m_nMax * sizeof(TCHAR));
@@ -104,7 +104,7 @@ void LineInfo::CreateEmpty()
   m_nLength = 0;
   m_nEolChars = 0;
   m_nMax = ALIGN_BUF_SIZE (m_nLength + 1);
-  if (m_pcLine != NULL)
+  if (m_pcLine != nullptr)
     delete [] m_pcLine;
   m_pcLine = new TCHAR[m_nMax];
   ZeroMemory(m_pcLine, m_nMax * sizeof(TCHAR));
@@ -163,14 +163,14 @@ bool LineInfo::HasEol() const
 
 /**
  * @brief Get line's EOL bytes.
- * @return EOL bytes, or NULL if no EOL bytes.
+ * @return EOL bytes, or `nullptr` if no EOL bytes.
  */
 LPCTSTR LineInfo::GetEol() const
 {
   if (HasEol())
     return &m_pcLine[Length()];
   else
-    return NULL;
+    return nullptr;
 }
 
 /**
@@ -232,7 +232,7 @@ void LineInfo::Delete(size_t nStartChar, size_t nEndChar)
          m_nEolChars -= static_cast<int>(nDelete);
   }
   ASSERT (m_nLength <= INT_MAX);               // assert "positive int"
-  if (m_pcLine)
+  if (m_pcLine != nullptr)
     m_pcLine[FullLength()] = '\0';
 }
 
@@ -244,7 +244,7 @@ void LineInfo::DeleteEnd(size_t nStartChar)
 {
   m_nLength = nStartChar;
   ASSERT (m_nLength <= INT_MAX);               // assert "positive int"
-  if (m_pcLine)
+  if (m_pcLine != nullptr)
     m_pcLine[nStartChar] = 0;
   m_nEolChars = 0;
 }
@@ -255,7 +255,7 @@ void LineInfo::DeleteEnd(size_t nStartChar)
  */
 void LineInfo::CopyFrom(const LineInfo &li)
 {
-  if (m_pcLine != NULL)
+  if (m_pcLine != nullptr)
     delete [] m_pcLine;
   m_pcLine = new TCHAR[li.m_nMax];
   memcpy(m_pcLine, li.m_pcLine, li.m_nMax * sizeof(TCHAR));
index e030598..da1f16c 100644 (file)
@@ -22,7 +22,7 @@ Clone(const UndoRecord &src)
     m_nAction = src.m_nAction;
     SetText(src.GetText(), src.GetTextLength());
     INT_PTR size = src.m_paSavedRevisionNumbers->GetSize();
-    if (!m_paSavedRevisionNumbers)
+    if (m_paSavedRevisionNumbers == nullptr)
       m_paSavedRevisionNumbers = new CDWordArray();
     m_paSavedRevisionNumbers->SetSize(size);
     INT_PTR i;
@@ -38,7 +38,7 @@ SetText (LPCTSTR pszText, size_t nLength)
     {
          ASSERT (nLength < INT_MAX);
       m_pszText = (TextBuffer *)malloc(sizeof(TextBuffer) + (nLength+2) * sizeof(TCHAR));
-      if (m_pszText)
+      if (m_pszText != nullptr)
         {
           m_pszText->size = nLength;
           memcpy(m_pszText->data, pszText, nLength * sizeof(TCHAR));
@@ -60,5 +60,5 @@ FreeText ()
   // possible char value
   if (((INT_PTR)m_pszText >> 16) != 0)
     free(m_pszText);
-  m_pszText = NULL;
+  m_pszText = nullptr;
 }
index e85e189..fa0813a 100644 (file)
@@ -67,8 +67,8 @@ private:
   virtual ~UndoRecord () // destructor\r
   {\r
     FreeText();\r
-    if (m_paSavedRevisionNumbers)\r
-    delete m_paSavedRevisionNumbers;\r
+    if (m_paSavedRevisionNumbers != nullptr)\r
+               delete m_paSavedRevisionNumbers;\r
   }\r
 \r
   void SetText (LPCTSTR pszText, size_t cchText);\r
index 2947695..45d7ca9 100644 (file)
@@ -566,7 +566,7 @@ IsAspNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -759,7 +759,7 @@ out:
           continue;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index cce4d69..59ff7f3 100644 (file)
@@ -341,7 +341,7 @@ IsBasicNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -456,7 +456,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 00d7e53..79e925c 100644 (file)
@@ -715,7 +715,7 @@ IsBatNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -888,7 +888,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 4b41617..d80aca0 100644 (file)
@@ -105,7 +105,7 @@ private :
     CCrystalEditView * m_pOwner;
 public :
     CEditDropTargetImpl (CCrystalEditView * pOwner)
-      : m_pOwner(pOwner), m_pAlternateDropTarget(NULL)
+      : m_pOwner(pOwner), m_pAlternateDropTarget(nullptr)
     {
     };
 
@@ -261,7 +261,7 @@ void CCrystalEditView::ResetView ()
 bool CCrystalEditView::
 QueryEditable ()
 {
-  if (m_pTextBuffer == NULL)
+  if (m_pTextBuffer == nullptr)
     return false;
   return !m_pTextBuffer->GetReadOnly ();
 }
@@ -512,7 +512,7 @@ Paste ()
 {
   if (!QueryEditable ())
     return;
-  if (m_pTextBuffer == NULL)
+  if (m_pTextBuffer == nullptr)
     return;
 
   CString text;
@@ -570,7 +570,7 @@ Cut ()
 {
   if (!QueryEditable ())
     return;
-  if (m_pTextBuffer == NULL)
+  if (m_pTextBuffer == nullptr)
     return;
   if (!IsSelection ())
     return;
@@ -602,7 +602,7 @@ Cut ()
 void CCrystalEditView::
 OnEditDelete ()
 {
-  if (!QueryEditable () || m_pTextBuffer == NULL)
+  if (!QueryEditable () || m_pTextBuffer == nullptr)
     return;
 
   CPoint ptSelStart, ptSelEnd;
@@ -688,7 +688,7 @@ OnChar (UINT nChar, UINT nRepCnt, UINT nFlags)
       m_pTextBuffer->BeginUndoGroup(m_bMergeUndo);
          m_bMergeUndo = false;
 
-      if (QueryEditable () && m_pTextBuffer != NULL)
+      if (QueryEditable () && m_pTextBuffer != nullptr)
         {
           CPoint ptCursorPos;
           if (IsSelection ())
@@ -732,7 +732,7 @@ OnChar (UINT nChar, UINT nRepCnt, UINT nFlags)
       (nChar != 27 || GetKeyState(VK_ESCAPE) >= 0) &&
       nChar != 9 && nChar != 10 && nChar != 13)
     {
-      if (QueryEditable () && m_pTextBuffer != NULL)
+      if (QueryEditable () && m_pTextBuffer != nullptr)
         {
           m_pTextBuffer->BeginUndoGroup (m_bMergeUndo);
           m_bMergeUndo = true;
@@ -807,7 +807,7 @@ OnEditDeleteBack ()
       return;
     }
 
-  if (!QueryEditable () || m_pTextBuffer == NULL)
+  if (!QueryEditable () || m_pTextBuffer == nullptr)
     return;
 
   CPoint ptCursorPos = GetCursorPos ();
@@ -877,7 +877,7 @@ OnEditDeleteBack ()
 void CCrystalEditView::
 OnEditTab ()
 {
-  if (!QueryEditable () || m_pTextBuffer == NULL)
+  if (!QueryEditable () || m_pTextBuffer == nullptr)
     return;
 
   bool bTabify = false;
@@ -1032,7 +1032,7 @@ OnEditTab ()
 void CCrystalEditView::
 OnEditUntab ()
 {
-  if (!QueryEditable () || m_pTextBuffer == NULL)
+  if (!QueryEditable () || m_pTextBuffer == nullptr)
     return;
 
   bool bTabify = false;
@@ -1157,7 +1157,7 @@ OnUpdateIndicatorOvr (CCmdUI * pCmdUI)
 void CCrystalEditView::
 OnUpdateIndicatorRead (CCmdUI * pCmdUI)
 {
-  if (m_pTextBuffer == NULL)
+  if (m_pTextBuffer == nullptr)
     pCmdUI->Enable (false);
   else
     pCmdUI->Enable (m_pTextBuffer->GetReadOnly ());
@@ -1373,7 +1373,7 @@ DoDropText (COleDataObject * pDataObject, const CPoint & ptClient)
 {
   CLIPFORMAT fmt = GetClipTcharTextFormat();      // CF_TEXT or CF_UNICODETEXT
   HGLOBAL hData = pDataObject->GetGlobalData (fmt);
-  if (hData == NULL)
+  if (hData == nullptr)
     return false;
 
   CPoint ptDropPos = ClientToText (ptClient);
@@ -1389,7 +1389,7 @@ DoDropText (COleDataObject * pDataObject, const CPoint & ptClient)
   UINT cbData = (UINT) ::GlobalSize (hData);
   UINT cchText = cbData / sizeof(TCHAR) - 1;
   LPTSTR pszText = (LPTSTR)::GlobalLock (hData);
-  if (pszText == NULL)
+  if (pszText == nullptr)
     return false;
 
   // Open the undo group
@@ -1440,13 +1440,13 @@ OnCreate (LPCREATESTRUCT lpCreateStruct)
 void CCrystalEditView::
 OnDestroy ()
 {
-  if (m_pDropTarget != NULL)
+  if (m_pDropTarget != nullptr)
     {
       m_pDropTarget->Revoke ();
          if (m_pDropTarget->m_pAlternateDropTarget)
                  m_pDropTarget->m_pAlternateDropTarget->Release();
       delete m_pDropTarget;
-      m_pDropTarget = NULL;
+      m_pDropTarget = nullptr;
     }
 
   CCrystalTextView::OnDestroy ();
@@ -1515,7 +1515,7 @@ UpdateView (CCrystalTextView * pSource, CUpdateContext * pContext, DWORD dwFlags
 {
   CCrystalTextView::UpdateView (pSource, pContext, dwFlags, nLineIndex);
 
-  if (m_bSelectionPushed && pContext != NULL)
+  if (m_bSelectionPushed && pContext != nullptr)
     {
       pContext->RecalcPoint (m_ptSavedSelStart);
       pContext->RecalcPoint (m_ptSavedSelEnd);
@@ -1548,7 +1548,7 @@ OnEditReplace ()
       lastSearch->m_bWholeWord = (m_dwLastReplaceFlags & FIND_WHOLE_WORD) != 0;
       lastSearch->m_bRegExp = (m_dwLastReplaceFlags & FIND_REGEXP) != 0;
       lastSearch->m_bNoWrap = (m_dwLastReplaceFlags & FIND_NO_WRAP) != 0;
-      if (m_pszLastFindWhat != NULL)
+      if (m_pszLastFindWhat != nullptr)
         lastSearch->m_sText = m_pszLastFindWhat;
     }
   else
@@ -1600,7 +1600,7 @@ OnEditReplace ()
 
   //  Save Replace parameters for 'F3' command
   m_bLastReplace = true;
-  if (m_pszLastFindWhat != NULL)
+  if (m_pszLastFindWhat != nullptr)
     free (m_pszLastFindWhat);
   m_pszLastFindWhat = _tcsdup (lastSearch->m_sText);
   m_dwLastReplaceFlags = 0;
@@ -1638,7 +1638,7 @@ ReplaceSelection (LPCTSTR pszNewText, size_t cchNewText, DWORD dwFlags)
 {
   if (!cchNewText)
     return DeleteCurrentSelection();
-  ASSERT(pszNewText != nullptr);
+  ASSERT (pszNewText != nullptr);
 
   m_pTextBuffer->BeginUndoGroup();
 
@@ -1707,11 +1707,11 @@ ReplaceSelection (LPCTSTR pszNewText, size_t cchNewText, DWORD dwFlags)
 void CCrystalEditView::
 OnUpdateEditUndo (CCmdUI * pCmdUI)
 {
-  bool bCanUndo = m_pTextBuffer != NULL && m_pTextBuffer->CanUndo ();
+  bool bCanUndo = m_pTextBuffer != nullptr && m_pTextBuffer->CanUndo ();
   pCmdUI->Enable (bCanUndo);
 
   //  Since we need text only for menus...
-  if (pCmdUI->m_pMenu != NULL)
+  if (pCmdUI->m_pMenu != nullptr)
     {
       //  Tune up 'resource handle'
       HINSTANCE hOldResHandle = AfxGetResourceHandle ();
@@ -1748,7 +1748,7 @@ OnEditUndo ()
 bool CCrystalEditView::
 DoEditUndo ()
 {
-  if (m_pTextBuffer != NULL && m_pTextBuffer->CanUndo ())
+  if (m_pTextBuffer != nullptr && m_pTextBuffer->CanUndo ())
     {
       CPoint ptCursorPos;
       if (m_pTextBuffer->Undo (this, ptCursorPos))
@@ -1780,7 +1780,7 @@ OnEditRedo ()
 bool CCrystalEditView::
 DoEditRedo ()
 {
-  if (m_pTextBuffer != NULL && m_pTextBuffer->CanRedo ())
+  if (m_pTextBuffer != nullptr && m_pTextBuffer->CanRedo ())
     {
       CPoint ptCursorPos;
       if (m_pTextBuffer->Redo (this, ptCursorPos))
@@ -1799,11 +1799,11 @@ DoEditRedo ()
 void CCrystalEditView::
 OnUpdateEditRedo (CCmdUI * pCmdUI)
 {
-  bool bCanRedo = m_pTextBuffer != NULL && m_pTextBuffer->CanRedo ();
+  bool bCanRedo = m_pTextBuffer != nullptr && m_pTextBuffer->CanRedo ();
   pCmdUI->Enable (bCanRedo);
 
   //  Since we need text only for menus...
-  if (pCmdUI->m_pMenu != NULL)
+  if (pCmdUI->m_pMenu != nullptr)
     {
       //  Tune up 'resource handle'
       HINSTANCE hOldResHandle = AfxGetResourceHandle ();
@@ -1934,7 +1934,7 @@ OnEditOperation (int nAction, LPCTSTR pszText, size_t cchText)
 
               // m_pTextBuffer->BeginUndoGroup ();
               int x, y;
-              m_pTextBuffer->InsertText (NULL, ptCursorPos.y, ptCursorPos.x,
+              m_pTextBuffer->InsertText (nullptr, ptCursorPos.y, ptCursorPos.x,
                                          pszInsertStr, nPos, y, x, CE_ACTION_AUTOINDENT);
               CPoint pt (x, y);
               SetCursorPos (pt);
@@ -1968,7 +1968,7 @@ OnEditOperation (int nAction, LPCTSTR pszText, size_t cchText)
 
                   // m_pTextBuffer->BeginUndoGroup ();
                   int x, y;
-                  m_pTextBuffer->InsertText (NULL, ptCursorPos.y, ptCursorPos.x,
+                  m_pTextBuffer->InsertText (nullptr, ptCursorPos.y, ptCursorPos.x,
                                              pszInsertStr, nPos, y, x, CE_ACTION_AUTOINDENT);
                   CPoint pt (x, y);
                   SetCursorPos (pt);
@@ -1991,7 +1991,7 @@ OnEditOperation (int nAction, LPCTSTR pszText, size_t cchText)
               pszInsertStr[1] = _T ('\0');
               // m_pTextBuffer->BeginUndoGroup ();
               int x, y;
-              m_pTextBuffer->InsertText (NULL, ptCursorPos.y, ptCursorPos.x - 1,
+              m_pTextBuffer->InsertText (nullptr, ptCursorPos.y, ptCursorPos.x - 1,
                                          pszInsertStr, 1, y, x, CE_ACTION_AUTOINDENT);
               ptCursorPos.x = x + 1;
               ptCursorPos.y = y;
@@ -2037,7 +2037,7 @@ OnEditOperation (int nAction, LPCTSTR pszText, size_t cchText)
 
               // m_pTextBuffer->BeginUndoGroup ();
               int x, y;
-              m_pTextBuffer->InsertText (NULL, ptCursorPos.y, ptCursorPos.x - 1,
+              m_pTextBuffer->InsertText (nullptr, ptCursorPos.y, ptCursorPos.x - 1,
                                          pszInsertStr, nPos, y, x, CE_ACTION_AUTOINDENT);
               CPoint pt (x + 1, y);
               SetCursorPos (pt);
@@ -2078,7 +2078,7 @@ OnEditOperation (int nAction, LPCTSTR pszText, size_t cchText)
                     }
                 }
               // m_pTextBuffer->BeginUndoGroup ();
-              m_pTextBuffer->DeleteText (NULL, ptCursorPos.y, ptCursorPos.x - nPos - 1,
+              m_pTextBuffer->DeleteText (nullptr, ptCursorPos.y, ptCursorPos.x - nPos - 1,
                 ptCursorPos.y, ptCursorPos.x - 1, CE_ACTION_AUTOINDENT);
               ptCursorPos.x -= nPos;
               SetCursorPos (ptCursorPos);
@@ -2182,7 +2182,7 @@ OnEditAutoExpand ()
           m_pTextBuffer->DeleteText (this, ptCursorPos.y, ptCursorPos.x, ptCursorPos.y, ptCursorPos.x + nLength, CE_ACTION_AUTOEXPAND);
           LPTSTR pszExpand = sExpand.GetBuffer (sExpand.GetLength () + 1);
           LPTSTR pszSlash = _tcschr (pszExpand, _T ('\\'));
-          if (!pszSlash)
+          if (pszSlash == nullptr)
             {
               m_pTextBuffer->InsertText (this, ptCursorPos.y, ptCursorPos.x, pszExpand, _tcslen(pszExpand), y, x, CE_ACTION_AUTOEXPAND);
               ptCursorPos.x = x;
@@ -2206,7 +2206,7 @@ OnEditAutoExpand ()
                   SetAnchor (ptCursorPos);
                   OnEditOperation (CE_ACTION_TYPING, pszExpand, _tcslen(pszExpand));
                   ptCursorPos = GetCursorPos ();
-                  if (!pszSlash)
+                  if (pszSlash == nullptr)
                     break;
                   switch (*pszSlash)
                     {
@@ -2324,7 +2324,7 @@ OnEditAutoExpand ()
                   ptCursorPos = GetCursorPos ();
                   pszExpand = pszSlash + 1;
                   pszSlash = _tcschr (pszExpand, '\\');
-                  if (pszSlash)
+                  if (pszSlash != nullptr)
                     *pszSlash++ = '\0';
                 }
             }
@@ -2725,7 +2725,7 @@ int CCrystalEditView::SpellNotify (int nEvent, struct SpellData_t *pdata)
   return 0;
 }
 
-HMODULE CCrystalEditView::hSpellDll = NULL;
+HMODULE CCrystalEditView::hSpellDll = nullptr;
 TCHAR CCrystalEditView::szWIspellPath[_MAX_PATH];
 SpellData CCrystalEditView::spellData;
 int (*CCrystalEditView::SpellInit) (SpellData*);
@@ -2754,11 +2754,11 @@ bool CCrystalEditView::LoadSpellDll (bool bAlert /*= true*/)
     }
   else
     {
-      SpellInit = SpellCheck = SpellConfig = NULL;
+      SpellInit = SpellCheck = SpellConfig = nullptr;
       if (bAlert)
         ::MessageBox (AfxGetMainWnd ()->GetSafeHwnd (), _T ("Error loading \"wispell.dll\"."), _T ("Error"), MB_OK|MB_ICONEXCLAMATION);
     }
-  return hSpellDll != NULL;
+  return hSpellDll != nullptr;
 }
 
 void CCrystalEditView::
@@ -2778,7 +2778,7 @@ OnToolsSpelling ()
       spellData.hParent = GetSafeHwnd ();
       spellData.nRow = ptCursorPos.y;
       spellData.pUserData = (LPVOID) (LPCVOID) this;
-      spellData.pszBuffer = NULL;
+      spellData.pszBuffer = nullptr;
       m_pTextBuffer->BeginUndoGroup ();
       if (SpellCheck (&spellData) == IDCANCEL)
         {
@@ -2815,12 +2815,12 @@ OnToolsCharCoding ()
       for (int i = 0; i < 13; i++)
         {
           pszEnd = _tcschr (pszEnd, _T ('\n'));
-          if (pszEnd)
+          if (pszEnd != nullptr)
             pszEnd++;
           else
             break;
         }
-      if (pszEnd)
+      if (pszEnd != nullptr)
         *pszEnd = _T ('\0');
       dlg.m_sOriginal.ReleaseBuffer ();
       if (dlg.DoModal () != IDOK)
@@ -2846,7 +2846,7 @@ OnToolsCharCoding ()
 
           m_pTextBuffer->FlushUndoGroup (this);
         }
-      if (pszNew)
+      if (pszNew != nullptr)
         free (pszNew);
     }
 }
index f239ae8..8619bf2 100644 (file)
@@ -319,7 +319,7 @@ InitNew (CRLFSTYLE nCrlfStyle /*= CRLF_STYLE_DOS*/ )
   m_nSyncPosition = m_nUndoPosition = 0;
   m_bUndoGroup = m_bUndoBeginGroup = false;
   ASSERT (m_aUndoBuf.size () == 0);
-  UpdateViews (NULL, NULL, UPDATE_RESET);
+  UpdateViews (nullptr, nullptr, UPDATE_RESET);
   //BEGIN SW
   m_ptLastChange.x = m_ptLastChange.y = -1;
   //END SW
@@ -361,7 +361,7 @@ LoadFromFile (LPCTSTR pszFileName, CRLFSTYLE nCrlfStyle /*= CRLF_STYLE_AUTOMATIC
   ASSERT (!m_bInit);
   ASSERT (m_aLines.size() == 0);
 
-  HANDLE hFile = NULL;
+  HANDLE hFile = nullptr;
   int nCurrentMax = 256;
   TCHAR *pcLineBuf = new TCHAR[nCurrentMax];
 
@@ -380,8 +380,8 @@ LoadFromFile (LPCTSTR pszFileName, CRLFSTYLE nCrlfStyle /*= CRLF_STYLE_AUTOMATIC
       if (dwFileAttributes == (DWORD) - 1)
         __leave;
 
-      hFile =::CreateFile (pszFileName, GENERIC_READ, FILE_SHARE_READ + FILE_SHARE_WRITE, NULL,
-        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
+      hFile =::CreateFile (pszFileName, GENERIC_READ, FILE_SHARE_READ + FILE_SHARE_WRITE, nullptr,
+        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, nullptr);
       if (hFile == INVALID_HANDLE_VALUE)
         __leave;
 
@@ -390,7 +390,7 @@ LoadFromFile (LPCTSTR pszFileName, CRLFSTYLE nCrlfStyle /*= CRLF_STYLE_AUTOMATIC
       const DWORD dwBufSize = 32768;
       LPSTR pcBuf = (LPSTR) _alloca (dwBufSize);
       DWORD dwCurSize;
-      if (!::ReadFile (hFile, pcBuf, dwBufSize, &dwCurSize, NULL))
+      if (!::ReadFile (hFile, pcBuf, dwBufSize, &dwCurSize, nullptr))
         __leave;
 
       if (nCrlfStyle == CRLF_STYLE_AUTOMATIC)
@@ -436,7 +436,7 @@ LoadFromFile (LPCTSTR pszFileName, CRLFSTYLE nCrlfStyle /*= CRLF_STYLE_AUTOMATIC
           dwBufPtr++;
           if (dwBufPtr == dwCurSize && dwCurSize == dwBufSize)
             {
-              if (!::ReadFile (hFile, pcBuf, dwBufSize, &dwCurSize, NULL))
+              if (!::ReadFile (hFile, pcBuf, dwBufSize, &dwCurSize, nullptr))
                 __leave;
               dwBufPtr = 0;
             }
@@ -480,12 +480,12 @@ LoadFromFile (LPCTSTR pszFileName, CRLFSTYLE nCrlfStyle /*= CRLF_STYLE_AUTOMATIC
       bSuccess = true;
 
       RetypeViews (pszFileName);
-      UpdateViews (NULL, NULL, UPDATE_RESET);
+      UpdateViews (nullptr, nullptr, UPDATE_RESET);
     }
   __finally
     {
     }
-  if (hFile != NULL && hFile != INVALID_HANDLE_VALUE)
+  if (hFile != nullptr && hFile != INVALID_HANDLE_VALUE)
     ::CloseHandle (hFile);
   delete [] pcLineBuf;
   //BEGIN SW
@@ -526,8 +526,8 @@ bool CCrystalTextBuffer::SaveToFile(LPCTSTR pszFileName,
     if (::GetTempFileName (szTempFileDir, _T ("CRE"), 0, szTempFileName) == 0)
       __leave;
 
-      hTempFile =::CreateFile (szTempFileName, GENERIC_WRITE, 0, NULL,
-                               CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+      hTempFile =::CreateFile (szTempFileName, GENERIC_WRITE, 0, nullptr,
+                               CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
       if (hTempFile == INVALID_HANDLE_VALUE)
         __leave;
 
@@ -550,7 +550,7 @@ bool CCrystalTextBuffer::SaveToFile(LPCTSTR pszFileName,
                     {
                       LPTSTR pszBuf;
                       iconvert_new (m_aLines[nLine].GetLine(0), &pszBuf, 1, m_nSourceEncoding, m_nSourceEncoding == 15);
-                      if (!::WriteFile (hTempFile, pszBuf, nLength, &dwWrittenBytes, NULL))
+                      if (!::WriteFile (hTempFile, pszBuf, nLength, &dwWrittenBytes, nullptr))
                         {
                           free (pszBuf);
                           __leave;
@@ -558,7 +558,7 @@ bool CCrystalTextBuffer::SaveToFile(LPCTSTR pszFileName,
                       free (pszBuf);
                     }
                   else
-                    if (!::WriteFile (hTempFile, pszLine, nLength, &dwWrittenBytes, NULL))
+                    if (!::WriteFile (hTempFile, pszLine, nLength, &dwWrittenBytes, nullptr))
                       __leave;
                   if (nLength != (int) dwWrittenBytes)
                     __leave;
@@ -566,7 +566,7 @@ bool CCrystalTextBuffer::SaveToFile(LPCTSTR pszFileName,
               if (nLine < nLineCount - 1)     //  Last line must not end with CRLF
 
                 {
-                  if (!::WriteFile (hTempFile, pszCRLF, nCRLFLength, &dwWrittenBytes, NULL))
+                  if (!::WriteFile (hTempFile, pszCRLF, nCRLFLength, &dwWrittenBytes, nullptr))
                     __leave;
                   if (nCRLFLength != (int) dwWrittenBytes)
                     __leave;
@@ -609,7 +609,7 @@ bool CCrystalTextBuffer::SaveToFile(LPCTSTR pszFileName,
     m_dwRevisionNumberOnSave = m_dwCurrentRevisionNumber;
     
     // redraw line revision marks
-    UpdateViews (NULL, NULL, UPDATE_FLAGSONLY);        
+    UpdateViews (nullptr, nullptr, UPDATE_FLAGSONLY);  
   }
   __finally
   {
@@ -837,7 +837,7 @@ SetLineFlag (int nLine, DWORD dwFlag, bool bSet, bool bRemoveFromPreviousLine /*
                   ASSERT ((m_aLines[nPrevLine].m_dwFlags & dwFlag) != 0);
                   m_aLines[nPrevLine].m_dwFlags &= ~dwFlag;
           if (bUpdate)
-          UpdateViews (NULL, NULL, UPDATE_SINGLELINE | UPDATE_FLAGSONLY, nPrevLine);
+          UpdateViews (nullptr, nullptr, UPDATE_SINGLELINE | UPDATE_FLAGSONLY, nPrevLine);
                 }
             }
           else
@@ -848,7 +848,7 @@ SetLineFlag (int nLine, DWORD dwFlag, bool bSet, bool bRemoveFromPreviousLine /*
 
       m_aLines[nLine].m_dwFlags = dwNewFlags;
       if (bUpdate)
-      UpdateViews (NULL, NULL, UPDATE_SINGLELINE | UPDATE_FLAGSONLY, nLine);
+      UpdateViews (nullptr, nullptr, UPDATE_SINGLELINE | UPDATE_FLAGSONLY, nLine);
     }
 }
 
@@ -862,7 +862,7 @@ GetTextWithoutEmptys(int nStartLine, int nStartChar,
                  CString &text, CRLFSTYLE nCrlfStyle /*= CRLF_STYLE_AUTOMATIC */,
                  bool bExcludeInvisibleLines/*= true*/) const
 {
-  GetText(nStartLine, nStartChar, nEndLine, nEndChar, text, (nCrlfStyle == CRLF_STYLE_AUTOMATIC) ? NULL : GetStringEol (nCrlfStyle), bExcludeInvisibleLines);
+  GetText(nStartLine, nStartChar, nEndLine, nEndChar, text, (nCrlfStyle == CRLF_STYLE_AUTOMATIC) ? nullptr : GetStringEol (nCrlfStyle), bExcludeInvisibleLines);
 }
 
 
@@ -953,7 +953,7 @@ void CCrystalTextBuffer::
 RemoveView (CCrystalTextView * pView)
 {
   POSITION pos = m_lpViews.GetHeadPosition ();
-  while (pos != NULL)
+  while (pos != nullptr)
     {
       POSITION thispos = pos;
       CCrystalTextView *pvw = m_lpViews.GetNext (pos);
@@ -972,7 +972,7 @@ RetypeViews (LPCTSTR lpszFileName)
   POSITION pos = m_lpViews.GetHeadPosition ();
   CString sNew = GetExt (lpszFileName);
   CCrystalTextView::TextDefinition *def = CCrystalTextView::GetTextType (sNew);
-  while (pos != NULL)
+  while (pos != nullptr)
     {
       CCrystalTextView *pView = m_lpViews.GetNext (pos);
       pView->SetTextType (def);
@@ -984,7 +984,7 @@ void CCrystalTextBuffer::
 UpdateViews (CCrystalTextView * pSource, CUpdateContext * pContext, DWORD dwUpdateFlags, int nLineIndex /*= -1*/ )
 {
   POSITION pos = m_lpViews.GetHeadPosition ();
-  while (pos != NULL)
+  while (pos != nullptr)
     {
       CCrystalTextView *pView = m_lpViews.GetNext (pos);
       pView->UpdateView (pSource, pContext, dwUpdateFlags, nLineIndex);
@@ -1032,7 +1032,7 @@ InternalDeleteText (CCrystalTextView * pSource, int nStartLine, int nStartChar,
       // delete part of one line
       m_aLines[nStartLine].Delete(nStartChar, nEndChar);
 
-      if (pSource!=NULL)
+      if (pSource!=nullptr)
         UpdateViews (pSource, &context, UPDATE_SINGLELINE | UPDATE_HORZRANGE, nStartLine);
     }
   else
@@ -1058,7 +1058,7 @@ InternalDeleteText (CCrystalTextView * pSource, int nStartLine, int nStartChar,
       if (nStartChar == 0)
         m_aLines[nStartLine].m_dwFlags = dwFlags;
 
-      if (pSource!=NULL)
+      if (pSource!=nullptr)
         UpdateViews (pSource, &context, UPDATE_HORZRANGE | UPDATE_VERTRANGE, nStartLine);
     }
 
@@ -1224,7 +1224,7 @@ InternalInsertText (CCrystalTextView * pSource, int nLine, int nPos,
     }
 
 
-  if (pSource!=NULL)
+  if (pSource!=nullptr)
     {
       if (nInsertedLines > 0)
         UpdateViews (pSource, &context, UPDATE_HORZRANGE | UPDATE_VERTRANGE, nLine);
@@ -1265,7 +1265,7 @@ GetUndoActionCode (int & nAction, POSITION pos /*= nullptr*/ ) const
   ASSERT ((m_aUndoBuf[0].m_dwFlags & UNDO_BEGINGROUP) != 0);
 
   intptr_t nPosition;
-  if (pos == NULL)
+  if (pos == nullptr)
     {
       //  Start from beginning
       nPosition = m_nUndoPosition;
@@ -1330,7 +1330,7 @@ GetRedoActionCode (int & nAction, POSITION pos /*= nullptr*/ ) const
         }
     }
   if (nPosition >= static_cast<intptr_t>(m_aUndoBuf.size ()))
-    return NULL;                //  No more redo actions!
+    return nullptr;                //  No more redo actions!
 
   return (POSITION) nPosition;
 }
@@ -1747,7 +1747,7 @@ GetActionDescription (int nAction, CString & desc) const
 #ifdef CRYSEDIT_RES_HANDLE
   AfxSetResourceHandle (CRYSEDIT_RES_HANDLE);
 #else
-  if (CCrystalTextView::s_hResourceInst != NULL)
+  if (CCrystalTextView::s_hResourceInst != nullptr)
     AfxSetResourceHandle (CCrystalTextView::s_hResourceInst);
 #endif
   bool bSuccess = false;
@@ -1835,7 +1835,7 @@ void CCrystalTextBuffer::
 FlushUndoGroup (CCrystalTextView * pSource)
 {
   ASSERT (m_bUndoGroup);
-  if (pSource != NULL)
+  if (pSource != nullptr)
     {
       ASSERT (static_cast<size_t>(m_nUndoPosition) <= m_aUndoBuf.size());
       if (m_nUndoPosition > 0)
index 0a131ba..8496dbd 100644 (file)
@@ -161,7 +161,7 @@ LOGFONT CCrystalTextView::m_LogFont;
 
 IMPLEMENT_DYNCREATE (CCrystalTextView, CView)
 
-HINSTANCE CCrystalTextView::s_hResourceInst = NULL;
+HINSTANCE CCrystalTextView::s_hResourceInst = nullptr;
 
 static ptrdiff_t FindStringHelper(LPCTSTR pszLineBegin, LPCTSTR pszFindWhere, LPCTSTR pszFindWhat, DWORD dwFlags, int &nLen, RxNode *&rxnode, RxMatchRes *rxmatch);
 
@@ -402,7 +402,7 @@ GetTextType (LPCTSTR pszExt)
   for (int i = 0; i < _countof (CCrystalTextView::m_SourceDefs); i++, def++)
     if (MatchType (def->exts, sExt))
       return def;
-  return NULL;
+  return nullptr;
 }
 
 bool CCrystalTextView::
@@ -565,46 +565,46 @@ CCrystalTextView::~CCrystalTextView ()
       free (m_pszLastFindWhat);
       m_pszLastFindWhat=nullptr;
     }
-  if (m_rxnode)
+  if (m_rxnode != nullptr)
     {
       RxFree (m_rxnode);
       m_rxnode = nullptr;
     }
-  if (m_pszMatched)
+  if (m_pszMatched != nullptr)
     {
       free(m_pszMatched); // Allocated by _tcsdup()
       m_pszMatched = nullptr;
     }
   //BEGIN SW
-  if( m_panSubLines )
+  if( m_panSubLines != nullptr )
     {
       delete m_panSubLines;
-      m_panSubLines = NULL;
+      m_panSubLines = nullptr;
     }
-  if( m_panSubLineIndexCache )
+  if( m_panSubLineIndexCache != nullptr )
     {
       delete m_panSubLineIndexCache;
-      m_panSubLineIndexCache = NULL;
+      m_panSubLineIndexCache = nullptr;
     }
-  if( m_pstrIncrementalSearchString )
+  if( m_pstrIncrementalSearchString != nullptr )
     {
       delete m_pstrIncrementalSearchString;
-      m_pstrIncrementalSearchString = NULL;
+      m_pstrIncrementalSearchString = nullptr;
     }
-  if( m_pstrIncrementalSearchStringOld )
+  if( m_pstrIncrementalSearchStringOld != nullptr )
     {
       delete m_pstrIncrementalSearchStringOld;
-      m_pstrIncrementalSearchStringOld = NULL;
+      m_pstrIncrementalSearchStringOld = nullptr;
     }
   //END SW
   ASSERT(m_ParseCookies != nullptr);
   delete m_ParseCookies;
-  m_ParseCookies = NULL;
+  m_ParseCookies = nullptr;
   ASSERT(m_pnActualLineLength != nullptr);
   delete m_pnActualLineLength;
-  m_pnActualLineLength = NULL;
+  m_pnActualLineLength = nullptr;
   delete m_pIcons;
-  if (m_pMarkers)
+  if (m_pMarkers != nullptr)
       m_pMarkers->DeleteView(this);
 }
 
@@ -612,7 +612,7 @@ BOOL CCrystalTextView::
 PreCreateWindow (CREATESTRUCT & cs)
 {
   CWnd *pParentWnd = CWnd::FromHandlePermanent (cs.hwndParent);
-  if (pParentWnd == NULL || !pParentWnd->IsKindOf (RUNTIME_CLASS (CSplitterWnd)))
+  if (pParentWnd == nullptr || !pParentWnd->IsKindOf (RUNTIME_CLASS (CSplitterWnd)))
     {
       //  View must always create its own scrollbars,
       //  if only it's not used within splitter
@@ -707,7 +707,7 @@ GetFullySelectedLines(int & firstLine, int & lastLine)
 CCrystalTextBuffer *CCrystalTextView::
 LocateTextBuffer ()
 {
-  return NULL;
+  return nullptr;
 }
 
 /**
@@ -1289,7 +1289,7 @@ GetParseCookie (int nLineIndex)
       if (L > 0)
         dwCookie = (*m_ParseCookies)[L - 1];
       ASSERT (dwCookie != - 1);
-      (*m_ParseCookies)[L] = ParseLine (dwCookie, L, NULL, nBlocks);
+      (*m_ParseCookies)[L] = ParseLine (dwCookie, L, nullptr, nBlocks);
       ASSERT ((*m_ParseCookies)[L] != - 1);
       L++;
     }
@@ -1395,10 +1395,10 @@ void CCrystalTextView::InvalidateSubLineIndexCache( int nLineIndex )
  */
 void CCrystalTextView::InvalidateScreenRect(bool bInvalidateView)
 {
-  if (m_pCacheBitmap != NULL)
+  if (m_pCacheBitmap != nullptr)
     {
       delete m_pCacheBitmap;
-      m_pCacheBitmap = NULL;
+      m_pCacheBitmap = nullptr;
     }
   m_nScreenChars = -1;
   m_nScreenLines = -1;
@@ -1660,7 +1660,7 @@ CCrystalTextView::GetMarkerTextBlocks(int nLineIndex) const
       ++nBlocks;
       const TCHAR *pszChars = GetLineChars(nLineIndex);
       int nLineLength = GetLineLength(nLineIndex);
-      if (pszChars)
+      if (pszChars != nullptr)
         {
           for (const TCHAR *p = pszChars; p < pszChars + nLineLength; )
             {
@@ -2054,7 +2054,7 @@ GetHTMLLine (int nLineIndex, LPCTSTR pszTag)
 COLORREF CCrystalTextView::
 GetColor (int nColorIndex)
 {
-  if (m_pColors)
+  if (m_pColors != nullptr)
     {
       nColorIndex &= ~COLORINDEX_APPLYFORCE;
       return m_pColors->GetColor(nColorIndex);
@@ -2066,7 +2066,7 @@ GetColor (int nColorIndex)
 DWORD CCrystalTextView::
 GetLineFlags (int nLineIndex) const
 {
-  if (m_pTextBuffer == NULL)
+  if (m_pTextBuffer == nullptr)
     return 0;
   return m_pTextBuffer->GetLineFlags (nLineIndex);
 }
@@ -2152,7 +2152,7 @@ DrawMargin (CDC * pdc, const CRect & rect, int nLineIndex, int nLineNumber)
             }
         }
     }
-  if (m_pIcons == NULL)
+  if (m_pIcons == nullptr)
     {
       m_pIcons = new CImageList;
       VERIFY (m_pIcons->Create(MARGIN_ICON_WIDTH, MARGIN_ICON_HEIGHT,
@@ -2172,7 +2172,7 @@ DrawMargin (CDC * pdc, const CRect & rect, int nLineIndex, int nLineNumber)
   if (nLineNumber > 0)
     {
       int nBreaks = 0;
-      WrapLineCached( nLineIndex, GetScreenChars(), NULL, nBreaks );
+      WrapLineCached( nLineIndex, GetScreenChars(), nullptr, nBreaks );
       for (int i = 0; i < nBreaks; i++)
         {
           CPoint pt(rect.right - MARGIN_ICON_WIDTH, rect.top + (GetLineHeight()
@@ -2269,7 +2269,7 @@ OnDraw (CDC * pdc)
   CRect rcClient;
   GetClientRect (rcClient);
 
-  if (!m_pTextBuffer)
+  if (m_pTextBuffer == nullptr)
     {
       pdc->FillSolidRect(&rcClient, GetSysColor(COLOR_WINDOW));
       return;
@@ -2288,7 +2288,7 @@ OnDraw (CDC * pdc)
 
   CDC cacheDC;
   VERIFY (cacheDC.CreateCompatibleDC (pdc));
-  if (m_pCacheBitmap == NULL)
+  if (m_pCacheBitmap == nullptr)
     {
       m_pCacheBitmap = new CBitmap;
       VERIFY(m_pCacheBitmap->CreateCompatibleBitmap(pdc, rcClient.Width(), rcClient.Height()));
@@ -2379,17 +2379,17 @@ ResetView ()
   m_nIdealCharPos = -1;
   m_ptAnchor.x = 0;
   m_ptAnchor.y = 0;
-  if (m_pIcons != NULL)
+  if (m_pIcons != nullptr)
     {
       delete m_pIcons;
-      m_pIcons = NULL;
+      m_pIcons = nullptr;
     }
   for (int I = 0; I < 4; I++)
     {
-      if (m_apFonts[I] != NULL)
+      if (m_apFonts[I] != nullptr)
         {
           delete m_apFonts[I];
-          m_apFonts[I] = NULL;
+          m_apFonts[I] = nullptr;
         }
     }
   InvalidateLineCache( 0, -1 );
@@ -2448,7 +2448,7 @@ OnUpdateCaret()
 int CCrystalTextView::
 GetCRLFMode ()
 {
-  if (m_pTextBuffer)
+  if (m_pTextBuffer != nullptr)
     {
       return m_pTextBuffer->GetCRLFMode ();
     }
@@ -2458,7 +2458,7 @@ GetCRLFMode ()
 void CCrystalTextView::
 SetCRLFMode (CRLFSTYLE nCRLFMode)
 {
-  if (m_pTextBuffer)
+  if (m_pTextBuffer != nullptr)
     {
       m_pTextBuffer->SetCRLFMode (nCRLFMode);
     }
@@ -2467,7 +2467,7 @@ SetCRLFMode (CRLFSTYLE nCRLFMode)
 int CCrystalTextView::
 GetTabSize ()
 {
-  if (m_pTextBuffer == NULL)
+  if (m_pTextBuffer == nullptr)
     return 4;
 
   return m_pTextBuffer->GetTabSize();
@@ -2478,7 +2478,7 @@ void CCrystalTextView::
 SetTabSize (int nTabSize)
 {
   ASSERT (nTabSize >= 0 && nTabSize <= 64);
-  if (m_pTextBuffer == NULL)
+  if (m_pTextBuffer == nullptr)
     return;
 
   if (m_pTextBuffer->GetTabSize() != nTabSize)
@@ -2501,7 +2501,7 @@ GetFont (bool bItalic /*= false*/ , bool bBold /*= false*/ )
   if (bItalic)
     nIndex |= 2;
 
-  if (m_apFonts[nIndex] == NULL)
+  if (m_apFonts[nIndex] == nullptr)
     {
       m_apFonts[nIndex] = new CFont;
       if (!m_lfBaseFont.lfHeight)
@@ -2514,7 +2514,7 @@ GetFont (bool bItalic /*= false*/ , bool bBold /*= false*/ )
       if (!m_apFonts[nIndex]->CreateFontIndirect (&m_lfBaseFont))
         {
           delete m_apFonts[nIndex];
-          m_apFonts[nIndex] = NULL;
+          m_apFonts[nIndex] = nullptr;
           return CView::GetFont ();
         }
     }
@@ -2556,7 +2556,7 @@ int CCrystalTextView::GetSubLines( int nLineIndex )
 {
   // get a number of lines this wrapped lines contains
   int nBreaks = 0;
-  WrapLineCached( nLineIndex, GetScreenChars(), NULL, nBreaks );
+  WrapLineCached( nLineIndex, GetScreenChars(), nullptr, nBreaks );
 
   return GetEmptySubLines(nLineIndex) + nBreaks + 1;
 }
@@ -2782,12 +2782,12 @@ CCrystalTextView *CCrystalTextView::
 GetSiblingView (int nRow, int nCol)
 {
   CSplitterWnd *pSplitter = GetParentSplitter (this, false);
-  if (pSplitter == NULL)
-    return NULL;
+  if (pSplitter == nullptr)
+    return nullptr;
   CWnd *pWnd = CWnd::FromHandlePermanent (
                  ::GetDlgItem (pSplitter->m_hWnd, pSplitter->IdFromRowCol (nRow, nCol)));
-  if (pWnd == NULL || !pWnd->IsKindOf (RUNTIME_CLASS (CCrystalTextView)))
-    return NULL;
+  if (pWnd == nullptr || !pWnd->IsKindOf (RUNTIME_CLASS (CCrystalTextView)))
+    return nullptr;
   return (CCrystalTextView *) pWnd;
 }
 
@@ -2837,10 +2837,10 @@ OnInitialUpdate ()
   CView::OnInitialUpdate ();
   CString sDoc = GetDocument ()->GetPathName (), sExt = GetExt (sDoc);
   SetTextType (sExt);
-  AttachToBuffer (NULL);
+  AttachToBuffer (nullptr);
 
   CSplitterWnd *pSplitter = GetParentSplitter (this, false);
-  if (pSplitter != NULL)
+  if (pSplitter != nullptr)
     {
       //  See CSplitterWnd::IdFromRowCol() implementation
       int nRow = (GetDlgCtrlID () - AFX_IDW_PANE_FIRST) / 16;
@@ -2851,7 +2851,7 @@ OnInitialUpdate ()
       if (nRow > 0)
         {
           CCrystalTextView *pSiblingView = GetSiblingView (0, nCol);
-          if (pSiblingView != NULL && pSiblingView != this)
+          if (pSiblingView != nullptr && pSiblingView != this)
             {
               m_nOffsetChar = pSiblingView->m_nOffsetChar;
               ASSERT (m_nOffsetChar >= 0 && m_nOffsetChar <= GetMaxLineLength (m_nTopLine, GetScreenLines()));
@@ -2861,7 +2861,7 @@ OnInitialUpdate ()
       if (nCol > 0)
         {
           CCrystalTextView *pSiblingView = GetSiblingView (nRow, 0);
-          if (pSiblingView != NULL && pSiblingView != this)
+          if (pSiblingView != nullptr && pSiblingView != this)
             {
               m_nTopLine = pSiblingView->m_nTopLine;
               ASSERT (m_nTopLine >= 0 && m_nTopLine < GetLineCount ());
@@ -3034,7 +3034,7 @@ OnBeginPrinting (CDC * pdc, CPrintInfo * pInfo)
   if (!m_pPrintFont->CreateFontIndirect (&lf))
     {
       delete m_pPrintFont;
-      m_pPrintFont = NULL;
+      m_pPrintFont = nullptr;
       return;
     }
 
@@ -3049,10 +3049,10 @@ OnBeginPrinting (CDC * pdc, CPrintInfo * pInfo)
 void CCrystalTextView::
 OnEndPrinting (CDC * pdc, CPrintInfo * pInfo)
 {
-  if (m_pPrintFont != NULL)
+  if (m_pPrintFont != nullptr)
     {
       delete m_pPrintFont;
-      m_pPrintFont = NULL;
+      m_pPrintFont = nullptr;
       SetFont(m_lfSavedBaseFont);
     }
   m_nPrintPages = 0;
@@ -3153,7 +3153,7 @@ OnPrint (CDC * pdc, CPrintInfo * pInfo)
       rcMargin.top = rcLine.bottom;
     }
 
-  pdc->SelectClipRgn (NULL);
+  pdc->SelectClipRgn (nullptr);
 }
 
 
@@ -3163,7 +3163,7 @@ OnPrint (CDC * pdc, CPrintInfo * pInfo)
 int CCrystalTextView::
 GetLineCount ()
 {
-  if (m_pTextBuffer == NULL)
+  if (m_pTextBuffer == nullptr)
     return 1;                   //  Single empty line
 
   int nLineCount = m_pTextBuffer->GetLineCount ();
@@ -3271,7 +3271,7 @@ void CCrystalTextView::GetLineBySubLine(int nSubLineIndex, int &nLine, int &nSub
 int CCrystalTextView::
 GetLineLength (int nLineIndex) const
 {
-  if (m_pTextBuffer == NULL)
+  if (m_pTextBuffer == nullptr)
     return 0;
   return m_pTextBuffer->GetLineLength (nLineIndex);
 }
@@ -3279,7 +3279,7 @@ GetLineLength (int nLineIndex) const
 int CCrystalTextView::
 GetFullLineLength (int nLineIndex) const
 {
-  if (m_pTextBuffer == NULL)
+  if (m_pTextBuffer == nullptr)
     return 0;
   return m_pTextBuffer->GetFullLineLength (nLineIndex);
 }
@@ -3370,10 +3370,10 @@ AttachToBuffer (CCrystalTextBuffer * pBuf /*= nullptr*/ )
 void CCrystalTextView::
 DetachFromBuffer ()
 {
-  if (m_pTextBuffer != NULL)
+  if (m_pTextBuffer != nullptr)
     {
       m_pTextBuffer->RemoveView (this);
-      m_pTextBuffer = NULL;
+      m_pTextBuffer = nullptr;
       // don't reset CCrystalEditView options
       CCrystalTextView::ResetView ();
     }
@@ -3405,7 +3405,7 @@ GetItalic (int nColorIndex)
 bool CCrystalTextView::
 GetBold (int nColorIndex)
 {
-  if (m_pColors)
+  if (m_pColors  != nullptr)
     {
       nColorIndex &= ~COLORINDEX_APPLYFORCE;
       return m_pColors->GetBold(nColorIndex);
@@ -3431,22 +3431,22 @@ OnDestroy ()
 {
   GetFont ()->GetLogFont (&m_lfBaseFont);
   DetachFromBuffer ();
-  m_hAccel = NULL;
+  m_hAccel = nullptr;
 
   CView::OnDestroy ();
 
   for (int I = 0; I < 4; I++)
     {
-      if (m_apFonts[I] != NULL)
+      if (m_apFonts[I] != nullptr)
         {
           delete m_apFonts[I];
-          m_apFonts[I] = NULL;
+          m_apFonts[I] = nullptr;
         }
     }
-  if (m_pCacheBitmap != NULL)
+  if (m_pCacheBitmap != nullptr)
     {
       delete m_pCacheBitmap;
-      m_pCacheBitmap = NULL;
+      m_pCacheBitmap = nullptr;
     }
 }
 
@@ -3491,7 +3491,7 @@ void CCrystalTextView::
 UpdateSiblingScrollPos (bool bHorz)
 {
   CSplitterWnd *pSplitterWnd = GetParentSplitter (this, false);
-  if (pSplitterWnd != NULL)
+  if (pSplitterWnd != nullptr)
     {
       //  See CSplitterWnd::IdFromRowCol() implementation for details
       int nCurrentRow = (GetDlgCtrlID () - AFX_IDW_PANE_FIRST) / 16;
@@ -3507,7 +3507,7 @@ UpdateSiblingScrollPos (bool bHorz)
               if (nCol != nCurrentCol)  //  We don't need to update ourselves
                 {
                   CCrystalTextView *pSiblingView = GetSiblingView (nCurrentRow, nCol);
-                  if (pSiblingView != NULL)
+                  if (pSiblingView != nullptr)
                     pSiblingView->OnUpdateSibling (this, false);
                 }
             }
@@ -3520,7 +3520,7 @@ UpdateSiblingScrollPos (bool bHorz)
               if (nRow != nCurrentRow)  //  We don't need to update ourselves
                 {
                   CCrystalTextView *pSiblingView = GetSiblingView (nRow, nCurrentCol);
-                  if (pSiblingView != NULL)
+                  if (pSiblingView != nullptr)
                     pSiblingView->OnUpdateSibling (this, false);
                 }
             }
@@ -3782,11 +3782,11 @@ OnSetCursor (CWnd * pWnd, UINT nHitTest, UINT message)
               //  [JRT]:  Support For Disabling Drag and Drop...
               if (!m_bDisableDragAndDrop)   // If Drag And Drop Not Disabled
 
-                ::SetCursor (::LoadCursor (NULL, IDC_ARROW));     // Set To Arrow Cursor
+                ::SetCursor (::LoadCursor (nullptr, IDC_ARROW));     // Set To Arrow Cursor
 
             }
           else
-            ::SetCursor (::LoadCursor (NULL, IDC_IBEAM));
+            ::SetCursor (::LoadCursor (nullptr, IDC_IBEAM));
         }
       return true;
     }
@@ -3820,7 +3820,7 @@ ClientToText (const CPoint & point)
   GetLineBySubLine( pt.y, nLine, nSubLineOffset );
   pt.y = nLine;
 
-  LPCTSTR pszLine = NULL;
+  LPCTSTR pszLine = nullptr;
   int nLength = 0;
   vector<int> anBreaks(1);
   int nBreaks = 0;
@@ -4268,7 +4268,7 @@ OnSysColorChange ()
 void CCrystalTextView::
 GetText (const CPoint & ptStart, const CPoint & ptEnd, CString & text, bool bExcludeInvisibleLines /*= true*/)
 {
-  if (m_pTextBuffer != NULL)
+  if (m_pTextBuffer != nullptr)
     m_pTextBuffer->GetText (ptStart.y, ptStart.x, ptEnd.y, ptEnd.x, text);
   else
     text = _T ("");
@@ -4277,7 +4277,7 @@ GetText (const CPoint & ptStart, const CPoint & ptEnd, CString & text, bool bExc
 void CCrystalTextView::
 GetTextInColumnSelection (CString & text, bool bExcludeInvisibleLines /*= true*/)
 {
-  if (m_pTextBuffer == NULL)
+  if (m_pTextBuffer == nullptr)
     {
       text = _T ("");
       return;
@@ -4400,7 +4400,7 @@ UpdateView (CCrystalTextView * pSource, CUpdateContext * pContext,
     }
 
   //  All those points must be recalculated and validated
-  if (pContext != NULL)
+  if (pContext != nullptr)
     {
       pContext->RecalcPoint (m_ptCursorPos);
       pContext->RecalcPoint (m_ptSelStart);
@@ -4445,7 +4445,7 @@ GetResourceHandle ()
 #ifdef CRYSEDIT_RES_HANDLE
   return CRYSEDIT_RES_HANDLE;
 #else
-  if (s_hResourceInst != NULL)
+  if (s_hResourceInst != nullptr)
     return s_hResourceInst;
   return AfxGetResourceHandle ();
 #endif
@@ -4494,7 +4494,7 @@ PreTranslateMessage (MSG * pMsg)
 {
   if (pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST)
     {
-      if (m_hAccel != NULL)
+      if (m_hAccel != nullptr)
         {
           if (::TranslateAccelerator (m_hWnd, m_hAccel, pMsg))
             return true;
@@ -4590,10 +4590,10 @@ SetFont (const LOGFONT & lf)
   m_nLineHeight = -1;
   for (int I = 0; I < 4; I++)
     {
-      if (m_apFonts[I] != NULL)
+      if (m_apFonts[I] != nullptr)
         {
           delete m_apFonts[I];
-          m_apFonts[I] = NULL;
+          m_apFonts[I] = nullptr;
         }
     }
   if (::IsWindow (m_hWnd))
@@ -4626,7 +4626,7 @@ OnUpdateIndicatorPosition (CCmdUI * pCmdUI)
 void CCrystalTextView::
 OnUpdateIndicatorCRLF (CCmdUI * pCmdUI)
 {
-  if (m_pTextBuffer != NULL)
+  if (m_pTextBuffer != nullptr)
     {
       std::basic_string<TCHAR> eol;
       CRLFSTYLE crlfMode = m_pTextBuffer->GetCRLFMode ();
@@ -4653,13 +4653,13 @@ OnUpdateIndicatorCRLF (CCmdUI * pCmdUI)
           pCmdUI->Enable (true);
           break;
         default:
-          pCmdUI->SetText (NULL);
+          pCmdUI->SetText (nullptr);
           pCmdUI->Enable (false);
         }
     }
   else
     {
-      pCmdUI->SetText (NULL);
+      pCmdUI->SetText (nullptr);
       pCmdUI->Enable (false);
     }
 }
@@ -4669,7 +4669,7 @@ OnToggleBookmark (UINT nCmdID)
 {
   int nBookmarkID = nCmdID - ID_EDIT_TOGGLE_BOOKMARK0;
   ASSERT (nBookmarkID >= 0 && nBookmarkID <= 9);
-  if (m_pTextBuffer != NULL)
+  if (m_pTextBuffer != nullptr)
     {
       DWORD dwFlags = GetLineFlags (m_ptCursorPos.y);
       DWORD dwMask = LF_BOOKMARK (nBookmarkID);
@@ -4682,7 +4682,7 @@ OnGoBookmark (UINT nCmdID)
 {
   int nBookmarkID = nCmdID - ID_EDIT_GO_BOOKMARK0;
   ASSERT (nBookmarkID >= 0 && nBookmarkID <= 9);
-  if (m_pTextBuffer != NULL)
+  if (m_pTextBuffer != nullptr)
     {
       int nLine = m_pTextBuffer->GetLineWithFlag (LF_BOOKMARK (nBookmarkID));
       if (nLine >= 0)
@@ -4700,7 +4700,7 @@ OnGoBookmark (UINT nCmdID)
 void CCrystalTextView::
 OnClearBookmarks ()
 {
-  if (m_pTextBuffer != NULL)
+  if (m_pTextBuffer != nullptr)
     {
       for (int nBookmarkID = 0; nBookmarkID <= 9; nBookmarkID++)
         {
@@ -4745,19 +4745,19 @@ PrepareDragData ()
 {
   PrepareSelBounds ();
   if (m_ptDrawSelStart == m_ptDrawSelEnd)
-    return NULL;
+    return nullptr;
 
   CString text;
   GetText (m_ptDrawSelStart, m_ptDrawSelEnd, text);
   int cchText = text.GetLength();
   SIZE_T cbData = (cchText + 1) * sizeof(TCHAR);
   HGLOBAL hData =::GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, cbData);
-  if (hData == NULL)
-    return NULL;
+  if (hData == nullptr)
+    return nullptr;
 
   LPTSTR pszData = (LPTSTR)::GlobalLock (hData);
-  if (!pszData)
-    return NULL;
+  if (pszData == nullptr)
+    return nullptr;
 
   memcpy (pszData, text, cbData);
   ::GlobalUnlock (hData);
@@ -4803,7 +4803,7 @@ FindStringHelper (LPCTSTR pszLineBegin, LPCTSTR pszFindWhere, LPCTSTR pszFindWha
                          pszPos = _tcsstr(pszFindWhere, pszFindWhat);
                  else
                          pszPos = StrStrI(pszFindWhere, pszFindWhat);
-          if (pszPos == NULL)
+          if (pszPos == nullptr)
             return -1;
           if ((dwFlags & FIND_WHOLE_WORD) == 0)
             return nCur + (int) (pszPos - pszFindWhere);
@@ -4877,7 +4877,7 @@ bool CCrystalTextView::
 FindText (LPCTSTR pszText, const CPoint & ptStartPos, DWORD dwFlags,
           bool bWrapSearch, CPoint * pptFoundPos)
 {
-  if (m_pMarkers)
+  if (m_pMarkers != nullptr)
     {
       m_pMarkers->SetMarker(_T("EDITOR_MARKER"), pszText, dwFlags, COLORINDEX_MARKERBKGND0, false);
       if (m_pMarkers->GetEnabled())
@@ -4894,7 +4894,7 @@ int HowManyStr (LPCTSTR s, LPCTSTR m)
   LPCTSTR p = s;
   int n = 0;
   const int l = (int) _tcslen (m);
-  while ((p = _tcsstr (p, m)) != NULL)
+  while ((p = _tcsstr (p, m)) != nullptr)
     {
       n++;
       p += l;
@@ -4906,7 +4906,7 @@ int HowManyStr (LPCTSTR s, TCHAR c)
 {
   LPCTSTR p = s;
   int n = 0;
-  while ((p = _tcschr (p, c)) != NULL)
+  while ((p = _tcschr (p, c)) != nullptr)
     {
       n++;
       p++;
@@ -5093,7 +5093,7 @@ FindTextInBlock (LPCTSTR pszText, const CPoint & ptStartPosition,
               size_t nPos = ::FindStringHelper (line, static_cast<LPCTSTR>(line) + ptCurrentPos.x, what, dwFlags, m_nLastFindWhatLen, m_rxnode, &m_rxmatch);
               if (nPos != -1)
                 {
-                  if (m_pszMatched)
+                  if (m_pszMatched != nullptr)
                     free(m_pszMatched);
                   m_pszMatched = _tcsdup (line);
                   if (nEolns)
@@ -5130,9 +5130,9 @@ FindTextInBlock (LPCTSTR pszText, const CPoint & ptStartPosition,
                 }
               else
                 {
-                  if (m_pszMatched)
+                  if (m_pszMatched != nullptr)
                     free(m_pszMatched);
-                  m_pszMatched = NULL;
+                  m_pszMatched = nullptr;
                 }
 
               //  Go further, text was not found
@@ -5197,7 +5197,7 @@ FindText (const LastSearchInfos * lastSearch)
 
   //  Save search parameters for 'F3' command
   m_bLastSearch = true;
-  if (m_pszLastFindWhat != NULL)
+  if (m_pszLastFindWhat != nullptr)
     free (m_pszLastFindWhat);
   m_pszLastFindWhat = _tcsdup (lastSearch->m_sText);
   m_dwLastSearchFlags = dwSearchFlags;
@@ -5214,7 +5214,7 @@ OnEditFind ()
   CWinApp *pApp = AfxGetApp ();
   ASSERT (pApp != nullptr);
 
-  if (!m_pFindTextDlg)
+  if (m_pFindTextDlg == nullptr)
     m_pFindTextDlg = new CFindTextDlg (this);
 
   LastSearchInfos * lastSearch = m_pFindTextDlg->GetLastSearchInfos();
@@ -5223,7 +5223,7 @@ OnEditFind ()
     {
       //  Get the latest search parameters
       ConvertSearchFlagsToLastSearchInfos(lastSearch, m_dwLastSearchFlags);
-      if (m_pszLastFindWhat != NULL)
+      if (m_pszLastFindWhat != nullptr)
         lastSearch->m_sText = m_pszLastFindWhat;
     }
   else
@@ -5266,7 +5266,7 @@ OnEditRepeat ()
 {
   bool bEnable = m_bLastSearch;
   // Show dialog if no last find text
-  if (m_pszLastFindWhat == NULL || _tcslen(m_pszLastFindWhat) == 0)
+  if (m_pszLastFindWhat == nullptr || _tcslen(m_pszLastFindWhat) == 0)
     bEnable = false;
   CString sText;
   if (bEnable)
@@ -5425,7 +5425,7 @@ OnFilePageSetup ()
 void CCrystalTextView::ToggleBookmark(int nLine)
 {
   ASSERT(nLine >= 0 && nLine < GetLineCount());
-  if (m_pTextBuffer != NULL)
+  if (m_pTextBuffer != nullptr)
     {
       DWORD dwFlags = GetLineFlags (nLine);
       DWORD dwMask = LF_BOOKMARKS;
@@ -5449,7 +5449,7 @@ OnToggleBookmark ()
 void CCrystalTextView::
 OnNextBookmark ()
 {
-  if (m_pTextBuffer != NULL)
+  if (m_pTextBuffer != nullptr)
     {
       int nLine = m_pTextBuffer->FindNextBookmarkLine (m_ptCursorPos.y);
       if (nLine >= 0)
@@ -5467,7 +5467,7 @@ OnNextBookmark ()
 void CCrystalTextView::
 OnPrevBookmark ()
 {
-  if (m_pTextBuffer != NULL)
+  if (m_pTextBuffer != nullptr)
     {
       int nLine = m_pTextBuffer->FindPrevBookmarkLine (m_ptCursorPos.y);
       if (nLine >= 0)
@@ -5485,7 +5485,7 @@ OnPrevBookmark ()
 void CCrystalTextView::
 OnClearAllBookmarks ()
 {
-  if (m_pTextBuffer != NULL)
+  if (m_pTextBuffer != nullptr)
     {
       int nLineCount = GetLineCount ();
       for (int I = 0; I < nLineCount; I++)
@@ -6037,7 +6037,7 @@ void CCrystalTextView::
 OnForceRedraw ()
 {
   //Invalidate ();
-  RedrawWindow (NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ERASENOW);
+  RedrawWindow (nullptr, nullptr, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ERASENOW);
 }
 
 void CCrystalTextView::
@@ -6295,7 +6295,7 @@ void CCrystalTextView::OnEditFindIncrementalBackward()
 
 void CCrystalTextView::OnUpdateEditFindIncrementalForward(CCmdUI* pCmdUI)
 {
-  if (m_pTextBuffer)
+  if (m_pTextBuffer != nullptr)
     {
       int nLines = m_pTextBuffer->GetLineCount ();
       int nChars = m_pTextBuffer->GetLineLength (m_ptCursorPos.y);
@@ -6307,7 +6307,7 @@ void CCrystalTextView::OnUpdateEditFindIncrementalForward(CCmdUI* pCmdUI)
 
 void CCrystalTextView::OnUpdateEditFindIncrementalBackward(CCmdUI* pCmdUI)
 {
-  if (m_pTextBuffer)
+  if (m_pTextBuffer != nullptr)
     {
       pCmdUI->Enable(m_ptCursorPos.y > 0 || m_ptCursorPos.x > 0);
       return;
@@ -6522,7 +6522,7 @@ void CCrystalTextView::EnsureVisible (CPoint ptStart, CPoint ptEnd)
 bool CCrystalTextView::
 SetTextTypeByContent (LPCTSTR pszContent)
 {
-  RxNode *rxnode = NULL;
+  RxNode *rxnode = nullptr;
   RxMatchRes rxmatch;
   int nLen;
   if (::FindStringHelper(pszContent, pszContent, _T("^\\s*\\<\\?xml\\s+.+?\\?\\>\\s*$"),
index beb4871..28422fd 100644 (file)
@@ -632,7 +632,7 @@ OnLButtonDown (UINT nFlags, CPoint point)
           SetSelection (ptStart, ptEnd);
 
           SetCapture ();
-          m_nDragSelTimer = SetTimer (CRYSTAL_TIMER_DRAGSEL, 100, NULL);
+          m_nDragSelTimer = SetTimer (CRYSTAL_TIMER_DRAGSEL, 100, nullptr);
           ASSERT (m_nDragSelTimer != 0);
           m_bColumnSelection = false;
           m_bWordSelection = false;
@@ -684,7 +684,7 @@ OnLButtonDown (UINT nFlags, CPoint point)
           SetSelection (ptStart, ptEnd);
 
           SetCapture ();
-          m_nDragSelTimer = SetTimer (CRYSTAL_TIMER_DRAGSEL, 100, NULL);
+          m_nDragSelTimer = SetTimer (CRYSTAL_TIMER_DRAGSEL, 100, nullptr);
           ASSERT (m_nDragSelTimer != 0);
           m_bColumnSelection = bAlt;
           m_bWordSelection = bControl;
@@ -765,7 +765,7 @@ OnMouseMove (UINT nFlags, CPoint point)
             }
 
           //  Moving to normal selection mode
-          ::SetCursor (::LoadCursor (NULL, IDC_IBEAM));
+          ::SetCursor (::LoadCursor (nullptr, IDC_IBEAM));
           m_bLineSelection = m_bWordSelection = false;
         }
 
@@ -1056,7 +1056,7 @@ OnLButtonDblClk (UINT nFlags, CPoint point)
       EnsureVisible (m_ptCursorPos);
       SetSelection (ptStart, ptEnd);
       SetCapture ();
-      m_nDragSelTimer = SetTimer (CRYSTAL_TIMER_DRAGSEL, 100, NULL);
+      m_nDragSelTimer = SetTimer (CRYSTAL_TIMER_DRAGSEL, 100, nullptr);
       ASSERT (m_nDragSelTimer != 0);
       m_bColumnSelection = false;
       m_bWordSelection = true;
@@ -1139,7 +1139,7 @@ TextInClipboard ()
 bool CCrystalTextView::
 PutToClipboard (LPCTSTR pszText, int cchText, bool bColumnSelection)
 {
-  if (pszText == NULL || cchText == 0)
+  if (pszText == nullptr || cchText == 0)
     return false;
 
   CWaitCursor wc;
@@ -1153,7 +1153,7 @@ PutToClipboard (LPCTSTR pszText, int cchText, bool bColumnSelection)
         {
           SIZE_T dwSize = GlobalSize(hData);
           LPTSTR pszData = (LPTSTR)::GlobalLock (hData);
-          if (pszData)
+          if (pszData != nullptr)
             {
               memcpy (pszData, pszText, cbData);
               if (dwSize > cbData)
index edd722b..e6207c0 100644 (file)
@@ -52,7 +52,7 @@
 
 
 CEditReplaceDlg::CEditReplaceDlg (CCrystalEditView * pBuddy)
-: CDialog (CEditReplaceDlg::IDD, NULL)
+: CDialog (CEditReplaceDlg::IDD, nullptr)
 , m_pBuddy(pBuddy)
 , m_bMatchCase(false)
 , m_bWholeWord(false)
index f67b706..907e1c5 100644 (file)
@@ -40,7 +40,7 @@ EDITPADC_CLASS LPCTSTR pszCodeNames[] =
     _T ("Apple Macintosh"),
     _T ("Apple Macintosh for Central Europe"),
     _T ("Corky"),
-    NULL
+    nullptr
   };
 
 EDITPADC_CLASS int nCodeNames = sizeof (pszCodeNames) / sizeof (pszCodeNames[0]) - 1;
@@ -56,7 +56,7 @@ EDITPADC_CLASS void FillComboBox (CComboBox &Control, LPCTSTR *pszItems)
 /////////////////////////////////////////////////////////////////////////////
 // CCharConvDlg dialog
 
-CCharConvDlg::CCharConvDlg () : CDialog (CCharConvDlg::IDD, NULL)
+CCharConvDlg::CCharConvDlg () : CDialog (CCharConvDlg::IDD, nullptr)
 {
     //{{AFX_DATA_INIT(CCharConvDlg)
        m_nSource = 1;
@@ -121,6 +121,6 @@ void CCharConvDlg::OnPreview()
       m_sPreview = pszNew;
       UpdateData (false);
     }
-  if (pszNew)
+  if (pszNew != nullptr)
     free (pszNew);
 }
index 8bd4228..0c225fc 100644 (file)
@@ -291,7 +291,7 @@ IsCppNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -469,7 +469,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index c1b8d16..ea4b50b 100644 (file)
@@ -39,7 +39,7 @@ RxNode *RxCompile(LPCTSTR Regexp, unsigned int RxOpt) {
     n = new RxNode();
     if (n == nullptr) return nullptr;
 
-       const char * errormsg = NULL;
+       const char * errormsg = nullptr;
        int erroroffset = 0;
        int pcre_opts = 0;
        std::string regexString;
@@ -128,7 +128,7 @@ static int add(size_t *len, LPTSTR *s, LPCTSTR a, size_t alen, int &flag) {
 
     if (*s) {
         LPTSTR p = (LPTSTR) realloc(*s, NewLen * sizeof(TCHAR));
-               if (!p)
+               if (p == nullptr)
                        return 0;
                *s = p;
                assert(*s != 0);
index 45f7515..64f8884 100644 (file)
@@ -37,7 +37,7 @@ DWORD CCrystalEditViewEx::ParseLine( DWORD dwCookie, int nLineIndex,
        if( m_pSyntaxParser != nullptr )
        {
                CCrystalTextBlock       *pTextBlock = 
-                       pBuf? new CCrystalTextBlock( (CCrystalTextBlock::TEXTBLOCK*)pBuf, nActualItems ) : NULL;
+                       pBuf? new CCrystalTextBlock( (CCrystalTextBlock::TEXTBLOCK*)pBuf, nActualItems ) : nullptr;
                dwCookie = m_pSyntaxParser->ParseLine( dwCookie, nLineIndex, pTextBlock );
                
                if( pTextBlock )
index 707a2a7..ff76a31 100644 (file)
@@ -25,7 +25,7 @@ IMPLEMENT_DYNAMIC( CCrystalParser, CObject )
 
 CCrystalParser::CCrystalParser()
 {
-       m_pTextView = NULL;
+       m_pTextView = nullptr;
 }
 
 
index 7b78586..0fad213 100644 (file)
@@ -181,7 +181,7 @@ int
 iconvert (LPTSTR string, int source_coding, int destination_coding, bool alphabet_only)
   {
     ptrdiff_t posit = -2;
-    LPCTSTR source_chars, destination_chars, cod_pos = NULL;
+    LPCTSTR source_chars, destination_chars, cod_pos = nullptr;
     TCHAR ch;
     LPTSTR s = string;
   
index 952f820..76f2900 100644 (file)
@@ -151,7 +151,7 @@ IsCppNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -331,7 +331,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 4938581..85605d4 100644 (file)
@@ -80,7 +80,7 @@ static LPTSTR s_apszCss1KeywordList[] =
     _T ("white-space"),
     _T ("width"),
     _T ("word-spacing"),
-    NULL
+    nullptr
   };
 
 static LPTSTR s_apszCss2KeywordList[] =
@@ -175,13 +175,13 @@ static LPTSTR s_apszCss2KeywordList[] =
     _T ("widths"),
     _T ("x-height"),
     _T ("z-index"),
-    NULL
+    nullptr
   };
 
 static bool
 IsXKeyword (LPTSTR apszKeywords[], LPCTSTR pszChars, int nLength)
 {
-  for (int L = 0; apszKeywords[L] != NULL; L++)
+  for (int L = 0; apszKeywords[L] != nullptr; L++)
     {
       if (_tcsnicmp (apszKeywords[L], pszChars, nLength) == 0
             && apszKeywords[L][nLength] == 0)
@@ -204,7 +204,7 @@ IsCss2Keyword (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -337,7 +337,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 7bf3ac9..1386a7c 100644 (file)
@@ -22,7 +22,7 @@
 \r
 \r
 CTextMarkerDlg::CTextMarkerDlg (CCrystalTextMarkers & markers, const CString& sText, DWORD dwFlags)\r
-: CDialog (CTextMarkerDlg::IDD, NULL)\r
+: CDialog (CTextMarkerDlg::IDD, nullptr)\r
 , m_markers(markers)\r
 , m_nCurItemIndex(0)\r
 , m_tempMarkers(markers)\r
index 0c91ea7..0d880be 100644 (file)
@@ -151,7 +151,7 @@ IsDclNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -310,7 +310,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index c7a5913..4b5da88 100644 (file)
@@ -27,7 +27,7 @@ bool FileExist(LPCTSTR lpszPath)
 
 int GetExtPosition (LPCTSTR pszString)
 {
-  if (!pszString || !*pszString)
+  if (pszString == nullptr || !*pszString)
     return 0;
   const CString sString = pszString;
   int len = sString.GetLength (), posit = len;
@@ -70,7 +70,7 @@ CString GetNameExt (const CString & sString)
 
 int GetNamePosition (LPCTSTR pszString)
 {
-  if (!pszString || !*pszString)
+  if (pszString == nullptr || !*pszString)
     return 0;
   const CString sString = pszString;
   int posit = sString.GetLength ();
index fd94748..c7d71e9 100644 (file)
@@ -268,7 +268,7 @@ IsFortranNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -404,7 +404,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index b962227..2518858 100644 (file)
@@ -60,7 +60,7 @@ fpattern_isvalid (LPCTSTR pat)
   int len;
 
   /* Check args */
-  if (pat == NULL)
+  if (pat == nullptr)
     return (false);
 
   /* Verify that the pattern is valid */
@@ -334,15 +334,15 @@ fpattern_match (LPCTSTR pat, LPCTSTR fname)
   int rc;
 
   /* Check args */
-  if (fname == NULL)
-    return (false);
+  if (fname == nullptr)
+    return (0);
 
-  if (pat == NULL)
-    return (false);
+  if (pat == nullptr)
+    return (0);
 
   /* Verify that the pattern is valid, and get its length */
   if (!fpattern_isvalid (pat))
-    return (false);
+    return (0);
 
   /* Attempt to match pattern against filename */
   if (fname[0] == _T('\0'))
@@ -387,10 +387,10 @@ fpattern_matchn (LPCTSTR pat, LPCTSTR fname)
   int rc;
 
   /* Check args */
-  if (fname == NULL)
+  if (fname == nullptr)
     return (false);
 
-  if (pat == NULL)
+  if (pat == nullptr)
     return (false);
 
   /* Assume that pattern is well-formed */
index 4ae6a2d..179b259 100644 (file)
@@ -137,7 +137,7 @@ IsGoNumber (LPCTSTR pszChars, int nLength)
 \r
 #define DEFINE_BLOCK(pos, colorindex)   \\r
 ASSERT((pos) >= 0 && (pos) <= nLength);\\r
-if (pBuf != NULL)\\r
+if (pBuf != nullptr)\\r
   {\\r
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\\r
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\\r
@@ -304,7 +304,7 @@ out:
           continue;\r
         }\r
 \r
-      if (pBuf == NULL)\r
+      if (pBuf == nullptr)\r
         continue;               //  We don't need to extract keywords,\r
       //  for faster parsing skip the rest of loop\r
 \r
index 6c1c86e..aaac541 100644 (file)
@@ -25,7 +25,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // CGotoDlg dialog
 
-CGotoDlg::CGotoDlg (CCrystalTextView * pBuddy):CDialog (CGotoDlg::IDD, NULL)
+CGotoDlg::CGotoDlg (CCrystalTextView * pBuddy):CDialog (CGotoDlg::IDD, nullptr)
 {
   m_pBuddy = pBuddy;
   //{{AFX_DATA_INIT(CGotoDlg)
@@ -56,7 +56,7 @@ void CGotoDlg::OnOK ()
 {
   CDialog::OnOK ();
   ASSERT (m_pBuddy != nullptr);
-  m_pBuddy->GoToLine (_ttoi (m_sNumber), _tcschr (_T ("+-"), *(LPCTSTR)m_sNumber) != NULL);
+  m_pBuddy->GoToLine (_ttoi (m_sNumber), _tcschr (_T ("+-"), *(LPCTSTR)m_sNumber) != nullptr);
 }
 
 void CGotoDlg::
index e665e3d..381a6a4 100644 (file)
@@ -397,7 +397,7 @@ IsHtmlNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -568,7 +568,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 3ea26a7..8889cfc 100644 (file)
@@ -53,7 +53,7 @@ IsIniNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -231,7 +231,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index cf1b3a6..4bc74d3 100644 (file)
@@ -353,7 +353,7 @@ IsInnoSetupNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -564,7 +564,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index bc25180..c141e53 100644 (file)
@@ -458,7 +458,7 @@ IsISNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -638,7 +638,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 38efc9f..a22e569 100644 (file)
@@ -113,7 +113,7 @@ IsJavaNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -293,7 +293,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index d0e1859..92a08be 100644 (file)
@@ -288,7 +288,7 @@ IsLispNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -449,7 +449,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 1ae4945..c2199d5 100644 (file)
@@ -60,10 +60,10 @@ void SetComboBoxHeight(CComboBox &Control)
   nHeight = rc.Height() * nHeight + 16;
   if(rc.top + nHeight > nMax)
     nHeight = nMax - rc.top;
-  Control.SetWindowPos(NULL, 0, 0, rc.Width(), nHeight, SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREDRAW);
+  Control.SetWindowPos(nullptr, 0, 0, rc.Width(), nHeight, SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREDRAW);
 }
 
-void SetComboBoxWidth(CComboBox &Control, LPCTSTR lpszText = NULL)
+void SetComboBoxWidth(CComboBox &Control, LPCTSTR lpszText = nullptr)
 {
   int          cnt = Control.GetCount();
 
index b6b77fc..61cddce 100644 (file)
@@ -463,7 +463,7 @@ IsNsisNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -644,7 +644,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 7d14461..966a133 100644 (file)
@@ -141,7 +141,7 @@ IsPascalNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -314,7 +314,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 8c1e300..dbc5533 100644 (file)
@@ -285,7 +285,7 @@ IsPerlNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -421,7 +421,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index bcaed71..db33dc2 100644 (file)
@@ -483,7 +483,7 @@ IsPhpNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -705,7 +705,7 @@ out:
           continue;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 070852f..14dada1 100644 (file)
@@ -32,13 +32,13 @@ static LPTSTR s_apszPoKeywordList[] =
     _T ("msgid"),
     _T ("msgid_plural"),
     _T ("msgstr"),
-    NULL
+    nullptr
   };
 
 static bool
 IsXKeyword (LPTSTR apszKeywords[], LPCTSTR pszChars, int nLength)
 {
-  for (int L = 0; apszKeywords[L] != NULL; L++)
+  for (int L = 0; apszKeywords[L] != nullptr; L++)
     {
       if (_tcsnicmp (apszKeywords[L], pszChars, nLength) == 0
             && apszKeywords[L][nLength] == 0)
@@ -63,7 +63,7 @@ IsPoNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -199,7 +199,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 4252e59..4b1fe27 100644 (file)
@@ -370,7 +370,7 @@ IsPowerShellNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -533,7 +533,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 89957fd..b19b5f2 100644 (file)
@@ -346,7 +346,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 83ed148..ab46963 100644 (file)
@@ -157,7 +157,7 @@ RegValGetStringArr (const RegVal *pValData, LPTSTR pszStrings[], DWORD dwCount)
               dwLength = (DWORD) _tcslen (pszString1) + 1;
               LPTSTR pszNewString = (LPTSTR) malloc (dwLength);
               *pszDstString = pszNewString;
-              if (pszNewString)
+              if (pszNewString != nullptr)
                 {
                   while ((*pszNewString = (BYTE) *pszString1) != _T ('\0'))
                     {
@@ -194,7 +194,7 @@ RegValGetNewStringArr (const RegVal *pValData, LPTSTR **pszStrings, DWORD *pdwCo
           dwRealCount++;
         }
       LPTSTR *pszNewStrings = (LPTSTR *) malloc (dwRealCount *sizeof (LPTSTR));
-      if (pszNewStrings)
+      if (pszNewStrings != nullptr)
         {
           *pszStrings = pszNewStrings;
           *pdwCount = dwRealCount;
@@ -203,7 +203,7 @@ RegValGetNewStringArr (const RegVal *pValData, LPTSTR **pszStrings, DWORD *pdwCo
               dwLength = (DWORD) _tcslen (pszString) + 1;
               LPTSTR pszNewString = (LPTSTR) malloc (dwLength);
               *pszNewStrings = pszNewString;
-              if (pszNewString)
+              if (pszNewString != nullptr)
                 {
                   while ((*pszNewString = (BYTE) *pszString) != _T ('\0'))
                     {
@@ -408,7 +408,7 @@ RegConnect (HKEY hKey, LPCTSTR pszRemote)
     {
       return hSubKey;
     }
-  return NULL;
+  return nullptr;
 }
 
 /* open computer registry */
@@ -420,7 +420,7 @@ RegOpen (HKEY hKey, LPCTSTR pszSubKey, DWORD dwRights)
     {
       return hSubKey;
     }
-  return NULL;
+  return nullptr;
 }
 
 /* create computer registry */
@@ -429,12 +429,12 @@ RegCreate (HKEY hKey, LPCTSTR pszSubKey, DWORD dwRights)
 {
   HKEY hSubKey;
   DWORD dwDisposition;
-  if (RegCreateKeyEx (hKey, pszSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, dwRights,
-                        NULL, &hSubKey, &dwDisposition) == ERROR_SUCCESS)
+  if (RegCreateKeyEx (hKey, pszSubKey, 0, nullptr, REG_OPTION_NON_VOLATILE, dwRights,
+                        nullptr, &hSubKey, &dwDisposition) == ERROR_SUCCESS)
     {
       return hSubKey;
     }
-  return NULL;
+  return nullptr;
 }
 
 /* close computer registry */
@@ -454,13 +454,13 @@ RegLoadVal (HKEY hKey, LPCTSTR pszSubKey, LPCTSTR pszValName, RegVal *pValData)
   if (hSubKey != nullptr)
     {
       DWORD dwType, dwSize;
-      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, NULL, &dwSize) == ERROR_SUCCESS)
+      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, nullptr, &dwSize) == ERROR_SUCCESS)
         {
           if (dwType == REG_DWORD)
             {
               ASSERT (dwSize == sizeof (DWORD));
               DWORD dwNumber;
-              if (RegQueryValueEx (hSubKey, pszValName, 0, NULL, (LPBYTE) &dwNumber, &dwSize) == ERROR_SUCCESS)
+              if (RegQueryValueEx (hSubKey, pszValName, 0, nullptr, (LPBYTE) &dwNumber, &dwSize) == ERROR_SUCCESS)
                 {
                   ASSERT (dwSize == sizeof (DWORD));
                   RegValFree (pValData);
@@ -477,7 +477,7 @@ RegLoadVal (HKEY hKey, LPCTSTR pszSubKey, LPCTSTR pszValName, RegVal *pValData)
               LPBYTE pbyteData = (LPBYTE) malloc (dwSize);
               if (pbyteData != nullptr)
                 {
-                  if (RegQueryValueEx (hSubKey, pszValName, 0, NULL, pbyteData, &dwSize) == ERROR_SUCCESS)
+                  if (RegQueryValueEx (hSubKey, pszValName, 0, nullptr, pbyteData, &dwSize) == ERROR_SUCCESS)
                     {
                       RegValFree (pValData);
                       pValData->dwType = dwType;
@@ -506,12 +506,12 @@ RegLoadNumber (HKEY hKey, LPCTSTR pszSubKey, LPCTSTR pszValName, DWORD *pdwNumbe
   if (hSubKey != nullptr)
     {
       DWORD dwType, dwSize;
-      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, NULL, &dwSize) == ERROR_SUCCESS)
+      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, nullptr, &dwSize) == ERROR_SUCCESS)
         {
           if (dwType == REG_DWORD)
             {
               ASSERT (dwSize == sizeof (DWORD));
-              if (RegQueryValueEx (hSubKey, pszValName, 0, NULL, (LPBYTE) pdwNumber, &dwSize) == ERROR_SUCCESS)
+              if (RegQueryValueEx (hSubKey, pszValName, 0, nullptr, (LPBYTE) pdwNumber, &dwSize) == ERROR_SUCCESS)
                 {
                   ASSERT (dwSize == sizeof (DWORD));
                   if (hSubKey != hKey)
@@ -535,11 +535,11 @@ RegLoadBinary (HKEY hKey, LPCTSTR pszSubKey, LPCTSTR pszValName, LPBYTE pbyteDat
   if (hSubKey != nullptr)
     {
       DWORD dwType, dwRealSize;
-      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, NULL, &dwRealSize) == ERROR_SUCCESS)
+      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, nullptr, &dwRealSize) == ERROR_SUCCESS)
         {
           if (dwType == REG_BINARY &&dwSize >= dwRealSize)
             {
-              if (RegQueryValueEx (hSubKey, pszValName, 0, NULL, pbyteData, &dwRealSize) == ERROR_SUCCESS)
+              if (RegQueryValueEx (hSubKey, pszValName, 0, nullptr, pbyteData, &dwRealSize) == ERROR_SUCCESS)
                 {
                   if (hSubKey != hKey)
                     RegClose (hSubKey);
@@ -562,14 +562,14 @@ RegLoadNewBinary (HKEY hKey, LPCTSTR pszSubKey, LPCTSTR pszValName, LPBYTE *pbyt
   if (hSubKey != nullptr)
     {
       DWORD dwType, dwRealSize;
-      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, NULL, &dwRealSize) == ERROR_SUCCESS)
+      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, nullptr, &dwRealSize) == ERROR_SUCCESS)
         {
           if (dwType == REG_BINARY)
             {
               LPBYTE pbyteNewData = (LPBYTE) malloc (dwRealSize);
-              if (pbyteNewData)
+              if (pbyteNewData != nullptr)
                 {
-                  if (RegQueryValueEx (hSubKey, pszValName, 0, NULL, pbyteNewData, &dwRealSize) == ERROR_SUCCESS)
+                  if (RegQueryValueEx (hSubKey, pszValName, 0, nullptr, pbyteNewData, &dwRealSize) == ERROR_SUCCESS)
                     {
                       *pbyteData = pbyteNewData;
                       *pdwSize = dwRealSize;
@@ -596,12 +596,12 @@ RegLoadString (HKEY hKey, LPCTSTR pszSubKey, LPCTSTR pszValName, LPTSTR pszStrin
   if (hSubKey != nullptr)
     {
       DWORD dwType, dwRealLength;
-      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, NULL, &dwRealLength) == ERROR_SUCCESS)
+      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, nullptr, &dwRealLength) == ERROR_SUCCESS)
         {
           if ((dwType == REG_SZ || dwType == REG_EXPAND_SZ || dwType == REG_LINK
                  || dwType == REG_MULTI_SZ) &&dwLength >= dwRealLength)
             {
-              if (RegQueryValueEx (hSubKey, pszValName, 0, NULL, (LPBYTE) pszString, &dwRealLength) == ERROR_SUCCESS)
+              if (RegQueryValueEx (hSubKey, pszValName, 0, nullptr, (LPBYTE) pszString, &dwRealLength) == ERROR_SUCCESS)
                 {
                   if (hSubKey != hKey)
                     RegClose (hSubKey);
@@ -624,18 +624,18 @@ RegLoadNewString (HKEY hKey, LPCTSTR pszSubKey, LPCTSTR pszValName, LPTSTR *pszS
   if (hSubKey != nullptr)
     {
       DWORD dwType, dwRealLength;
-      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, NULL, &dwRealLength) == ERROR_SUCCESS)
+      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, nullptr, &dwRealLength) == ERROR_SUCCESS)
         {
           if (dwType == REG_SZ || dwType == REG_EXPAND_SZ || dwType == REG_LINK
                 || dwType == REG_MULTI_SZ)
             {
               LPTSTR pszNewString = (LPTSTR) malloc (dwRealLength);
-              if (pszNewString)
+              if (pszNewString != nullptr)
                 {
-                  if (RegQueryValueEx (hSubKey, pszValName, 0, NULL, (LPBYTE) pszNewString, &dwRealLength) == ERROR_SUCCESS)
+                  if (RegQueryValueEx (hSubKey, pszValName, 0, nullptr, (LPBYTE) pszNewString, &dwRealLength) == ERROR_SUCCESS)
                     {
                       *pszString = pszNewString;
-                      if (pdwLength)
+                      if (pdwLength != nullptr)
                         {
                           *pdwLength = dwRealLength;
                         }
@@ -697,13 +697,13 @@ RegLoadString (HKEY hKey, LPCTSTR pszSubKey, LPCTSTR pszValName, CString &sStrin
   if (hSubKey)
     {
       DWORD dwType, dwRealLength;
-      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, NULL, &dwRealLength) == ERROR_SUCCESS)
+      if (RegQueryValueEx (hSubKey, pszValName, 0, &dwType, nullptr, &dwRealLength) == ERROR_SUCCESS)
         {
           if (dwType == REG_SZ || dwType == REG_EXPAND_SZ || dwType == REG_LINK
                 || dwType == REG_MULTI_SZ)
             {
               LPTSTR pszString = sString.GetBuffer (dwRealLength);
-              if (RegQueryValueEx (hSubKey, pszValName, 0, NULL, (LPBYTE) pszString, &dwRealLength) == ERROR_SUCCESS)
+              if (RegQueryValueEx (hSubKey, pszValName, 0, nullptr, (LPBYTE) pszString, &dwRealLength) == ERROR_SUCCESS)
                 {
                   sString.ReleaseBuffer (dwRealLength);
                   if (hSubKey != hKey)
@@ -873,13 +873,13 @@ bool
 RegDeleteSubKeys (HKEY hKey)
 {
   DWORD dwSubKeyCnt, dwMaxSubKey;
-  if (RegQueryInfoKey (hKey, NULL, NULL, 0, &dwSubKeyCnt, &dwMaxSubKey,
-                         NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
+  if (RegQueryInfoKey (hKey, nullptr, nullptr, 0, &dwSubKeyCnt, &dwMaxSubKey,
+                         nullptr, nullptr, nullptr, nullptr, nullptr, nullptr) == ERROR_SUCCESS)
     {
       if (dwSubKeyCnt)
         {
           LPTSTR pszKeyName = (LPTSTR) malloc (dwMaxSubKey += 1);
-          if (pszKeyName)
+          if (pszKeyName != nullptr)
             {
               do
                 {
@@ -936,7 +936,7 @@ RegDeleteKey (HKEY hKey, LPCTSTR pszSubKey, LPCTSTR pszValName)
   HKEY hSubKey = pszSubKey ? RegOpen (hKey, pszSubKey, KEY_READ | KEY_WRITE) : hKey;
   if (hSubKey)
     {
-      if (pszValName)
+      if (pszValName != nullptr)
         {
           if (RegDeleteValue (hSubKey, pszValName) == ERROR_SUCCESS)
             {
@@ -967,7 +967,7 @@ RegHasEntries (HKEY hKey, LPCTSTR pszSubKey, DWORD *pdwSubKeyCount, DWORD *pdwVa
   HKEY hSubKey = pszSubKey ? RegOpen (hKey, pszSubKey, KEY_READ) : hKey;
   if (hSubKey)
     {
-      if (RegQueryInfoKey (hSubKey, NULL, NULL, 0, pdwSubKeyCount, NULL, NULL, pdwValueCount, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
+      if (RegQueryInfoKey (hSubKey, nullptr, nullptr, 0, pdwSubKeyCount, nullptr, nullptr, pdwValueCount, nullptr, nullptr, nullptr, nullptr) == ERROR_SUCCESS)
         {
           if (hSubKey != hKey)
             RegClose (hSubKey);
@@ -980,7 +980,7 @@ RegHasEntries (HKEY hKey, LPCTSTR pszSubKey, DWORD *pdwSubKeyCount, DWORD *pdwVa
   return false;
 }
 
-static LPTSTR g_pszValue = NULL;
+static LPTSTR g_pszValue = nullptr;
 static DWORD g_dwValueCnt, g_dwValue, g_dwValueMax;
 
 bool RegFindFirstValue (HKEY hKey, LPCTSTR *ppszValue, RegVal *pValData);
@@ -989,25 +989,25 @@ bool RegFindFirstValue (HKEY hKey, LPCTSTR *ppszValue, RegVal *pValData);
 bool
 RegFindFirstValue (HKEY hKey, LPCTSTR *ppszValue, RegVal *pValData)
 {
-  if (RegQueryInfoKey (hKey, NULL, NULL, 0, NULL, NULL, NULL,
-    &g_dwValueCnt, &g_dwValueMax, NULL, NULL, NULL) == ERROR_SUCCESS)
+  if (RegQueryInfoKey (hKey, nullptr, nullptr, 0, nullptr, nullptr, nullptr,
+    &g_dwValueCnt, &g_dwValueMax, nullptr, nullptr, nullptr) == ERROR_SUCCESS)
     {
       if (g_dwValueCnt)
         {
-          if (g_pszValue)
+          if (g_pszValue != nullptr)
             {
               free (g_pszValue);
-              g_pszValue = NULL;
+              g_pszValue = nullptr;
             }
           g_pszValue = (LPTSTR) malloc (g_dwValueMax += 1);
           if (g_pszValue)
             {
               DWORD dwMaxValue = g_dwValueMax;
               g_dwValue = 0;
-              if (RegEnumValue (hKey, g_dwValue++, g_pszValue, &dwMaxValue, 0, NULL, NULL, NULL) == ERROR_SUCCESS)
+              if (RegEnumValue (hKey, g_dwValue++, g_pszValue, &dwMaxValue, 0, nullptr, nullptr, nullptr) == ERROR_SUCCESS)
                 {
                   *ppszValue = g_pszValue;
-                  return RegLoadVal (hKey, NULL, g_pszValue, pValData);
+                  return RegLoadVal (hKey, nullptr, g_pszValue, pValData);
                 }
             }
         }
@@ -1019,10 +1019,10 @@ RegFindFirstValue (HKEY hKey, LPCTSTR *ppszValue, RegVal *pValData)
 bool RegFindNextValue (HKEY hKey, LPCTSTR *ppszValue, RegVal *pValData)
 {
   DWORD dwMaxValue = g_dwValueMax;
-  if (g_dwValue < g_dwValueCnt && RegEnumValue (hKey, g_dwValue++, g_pszValue, &dwMaxValue, 0, NULL, NULL, NULL) == ERROR_SUCCESS)
+  if (g_dwValue < g_dwValueCnt && RegEnumValue (hKey, g_dwValue++, g_pszValue, &dwMaxValue, 0, nullptr, nullptr, nullptr) == ERROR_SUCCESS)
     {
       *ppszValue = g_pszValue;
-      return RegLoadVal (hKey, NULL, g_pszValue, pValData);
+      return RegLoadVal (hKey, nullptr, g_pszValue, pValData);
     }
   return false;
 }
@@ -1030,10 +1030,10 @@ bool RegFindNextValue (HKEY hKey, LPCTSTR *ppszValue, RegVal *pValData)
 /* closes registry walking */
 void RegFindClose ()
 {
-  if (g_pszValue)
+  if (g_pszValue != nullptr)
     {
       free (g_pszValue);
-      g_pszValue = NULL;
+      g_pszValue = nullptr;
     }
 }
 
@@ -1208,7 +1208,7 @@ HKEY CReg::Create (HKEY hNewKey, LPCTSTR pszSubKey, DWORD dwRights)
 /* load data of any type */
 bool CReg::LoadVal (LPCTSTR pszValName, RegVal *pValData)
 {
-  return RegLoadVal (hKey, NULL, pszValName, pValData);
+  return RegLoadVal (hKey, nullptr, pszValName, pValData);
 }
 
 /* load data of any type from subkey */
@@ -1220,7 +1220,7 @@ bool CReg::LoadVal (LPCTSTR pszSubKey, LPCTSTR pszValName, RegVal *pValData)
 /* load a number */
 bool CReg::LoadNumber (LPCTSTR pszValName, DWORD *pdwNumber)
 {
-  return RegLoadNumber (hKey, NULL, pszValName, pdwNumber);
+  return RegLoadNumber (hKey, nullptr, pszValName, pdwNumber);
 }
 
 /* load a number from subkey */
@@ -1232,7 +1232,7 @@ bool CReg::LoadNumber (LPCTSTR pszSubKey, LPCTSTR pszValName, DWORD *pdwNumber)
 /* load binary data */
 bool CReg::LoadBinary (LPCTSTR pszValName, LPBYTE pbyteData, DWORD dwSize)
 {
-  return RegLoadBinary (hKey, NULL, pszValName, pbyteData, dwSize);
+  return RegLoadBinary (hKey, nullptr, pszValName, pbyteData, dwSize);
 }
 
 /* load binary data from subkey */
@@ -1244,7 +1244,7 @@ bool CReg::LoadBinary (LPCTSTR pszSubKey, LPCTSTR pszValName, LPBYTE pbyteData,
 /* load new binary data */
 bool CReg::LoadNewBinary (LPCTSTR pszValName, LPBYTE *pbyteData, DWORD *pdwSize)
 {
-  return RegLoadNewBinary (hKey, NULL, pszValName, pbyteData, pdwSize);
+  return RegLoadNewBinary (hKey, nullptr, pszValName, pbyteData, pdwSize);
 }
 
 /* load new binary data from subkey */
@@ -1256,7 +1256,7 @@ bool CReg::LoadNewBinary (LPCTSTR pszSubKey, LPCTSTR pszValName, LPBYTE *pbyteDa
 /* load a string */
 bool CReg::LoadString (LPCTSTR pszValName, LPTSTR pszString, DWORD dwLength)
 {
-  return RegLoadString (hKey, NULL, pszValName, pszString, dwLength);
+  return RegLoadString (hKey, nullptr, pszValName, pszString, dwLength);
 }
 
 /* load a string from subkey */
@@ -1268,7 +1268,7 @@ bool CReg::LoadString (LPCTSTR pszSubKey, LPCTSTR pszValName, LPTSTR pszString,
 /* load a new string */
 bool CReg::LoadNewString (LPCTSTR pszValName, LPTSTR *pszString, DWORD *pdwLength)
 {
-  return RegLoadNewString (hKey, NULL, pszValName, pszString, pdwLength);
+  return RegLoadNewString (hKey, nullptr, pszValName, pszString, pdwLength);
 }
 
 /* load a new string from subkey */
@@ -1280,7 +1280,7 @@ bool CReg::LoadNewString (LPCTSTR pszSubKey, LPCTSTR pszValName, LPTSTR *pszStri
 /* load an array of strings */
 bool CReg::LoadStringArr (LPCTSTR pszValName, LPTSTR pszStrings[], DWORD dwCount)
 {
-  return RegLoadStringArr (hKey, NULL, pszValName, pszStrings, dwCount);
+  return RegLoadStringArr (hKey, nullptr, pszValName, pszStrings, dwCount);
 }
 
 /* load an array of strings from subkey */
@@ -1292,7 +1292,7 @@ bool CReg::LoadStringArr (LPCTSTR pszSubKey, LPCTSTR pszValName, LPTSTR pszStrin
 /* load a new array of strings */
 bool CReg::LoadNewStringArr (LPCTSTR pszValName, LPTSTR **pszStrings, DWORD *pdwCount)
 {
-  return RegLoadNewStringArr (hKey, NULL, pszValName, pszStrings, pdwCount);
+  return RegLoadNewStringArr (hKey, nullptr, pszValName, pszStrings, pdwCount);
 }
 
 /* load a new array of strings from subkey */
@@ -1306,7 +1306,7 @@ bool CReg::LoadNewStringArr (LPCTSTR pszSubKey, LPCTSTR pszValName, LPTSTR **psz
 /* load a string */
 bool CReg::LoadString (LPCTSTR pszValName, CString &sString)
 {
-  return RegLoadString (hKey, NULL, pszValName, sString);
+  return RegLoadString (hKey, nullptr, pszValName, sString);
 }
 
 /* load a string from subkey */
@@ -1318,7 +1318,7 @@ bool CReg::LoadString (LPCTSTR pszSubKey, LPCTSTR pszValName, CString &sString)
 /* load an array of strings */
 bool CReg::LoadStringArr (LPCTSTR pszValName, CStringArray &arrString)
 {
-  return RegLoadStringArr (hKey, NULL, pszValName, arrString);
+  return RegLoadStringArr (hKey, nullptr, pszValName, arrString);
 }
 
 /* load an array of strings from subkey */
@@ -1332,7 +1332,7 @@ bool CReg::LoadStringArr (LPCTSTR pszSubKey, LPCTSTR pszValName, CStringArray &a
 /* store data of any type */
 bool CReg::SaveVal (LPCTSTR pszValName, const RegVal *pValData)
 {
-  return RegSaveVal (hKey, NULL, pszValName, pValData);
+  return RegSaveVal (hKey, nullptr, pszValName, pValData);
 }
 
 /* store data of any type to subkey */
@@ -1344,7 +1344,7 @@ bool CReg::SaveVal (LPCTSTR pszSubKey, LPCTSTR pszValName, const RegVal *pValDat
 /* store a number */
 bool CReg::SaveNumber (LPCTSTR pszValName, DWORD dwNumber)
 {
-  return RegSaveNumber (hKey, NULL, pszValName, dwNumber);
+  return RegSaveNumber (hKey, nullptr, pszValName, dwNumber);
 }
 
 /* store a number to subkey */
@@ -1356,7 +1356,7 @@ bool CReg::SaveNumber (LPCTSTR pszSubKey, LPCTSTR pszValName, DWORD dwNumber)
 /* store binary data */
 bool CReg::SaveBinary (LPCTSTR pszValName, const LPBYTE pbyteData, DWORD dwSize)
 {
-  return RegSaveBinary (hKey, NULL, pszValName, pbyteData, dwSize);
+  return RegSaveBinary (hKey, nullptr, pszValName, pbyteData, dwSize);
 }
 
 /* store binary data to subkey */
@@ -1368,7 +1368,7 @@ bool CReg::SaveBinary (LPCTSTR pszSubKey, LPCTSTR pszValName, const LPBYTE pbyte
 /* store a string */
 bool CReg::SaveString (LPCTSTR pszValName, LPCTSTR pszString)
 {
-  return RegSaveString (hKey, NULL, pszValName, pszString);
+  return RegSaveString (hKey, nullptr, pszValName, pszString);
 }
 
 /* store a string to subkey */
@@ -1380,7 +1380,7 @@ bool CReg::SaveString (LPCTSTR pszSubKey, LPCTSTR pszValName, LPCTSTR pszString)
 /* store an array of strings */
 bool CReg::SaveStringArr (LPCTSTR pszValName, const LPCTSTR pszStrings[], DWORD dwCount)
 {
-  return RegSaveStringArr (hKey, NULL, pszValName, pszStrings, dwCount);
+  return RegSaveStringArr (hKey, nullptr, pszValName, pszStrings, dwCount);
 }
 
 /* store an array of strings to subkey */
@@ -1394,7 +1394,7 @@ bool CReg::SaveStringArr (LPCTSTR pszSubKey, LPCTSTR pszValName, const LPCTSTR p
 /* store an array of strings */
 bool CReg::SaveStringArr (LPCTSTR pszValName, const CStringArray &arrString)
 {
-  return RegSaveStringArr (hKey, NULL, pszValName, arrString);
+  return RegSaveStringArr (hKey, nullptr, pszValName, arrString);
 }
 
 /* store an array of strings to subkey */
@@ -1408,7 +1408,7 @@ bool CReg::SaveStringArr (LPCTSTR pszSubKey, LPCTSTR pszValName, const CStringAr
 /* delete the given value or key in the registry with all of its subkeys */
 bool CReg::DeleteKey (LPCTSTR pszValName)
 {
-  return RegDeleteKey (hKey, NULL, pszValName);
+  return RegDeleteKey (hKey, nullptr, pszValName);
 }
 
 /* delete the given value or key in the registry with all of its subkeys in subkey */
@@ -1426,7 +1426,7 @@ bool CReg::DeleteSubKeys ()
 /* check wether the given key has other subkeys and/or values */
 bool CReg::HasEntries (DWORD *pdwSubKeyCount, DWORD *pdwValueCount)
 {
-  return RegHasEntries (hKey, NULL, pdwSubKeyCount, pdwValueCount);
+  return RegHasEntries (hKey, nullptr, pdwSubKeyCount, pdwValueCount);
 }
 
 /* check wether the given key has other subkeys and/or values in subkey */
index 715d477..4056886 100644 (file)
@@ -140,7 +140,7 @@ IsRexxNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -299,7 +299,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 07dbeb7..1bf7fa4 100644 (file)
@@ -204,7 +204,7 @@ IsRsrcNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -384,7 +384,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 334d440..ab4ad0b 100644 (file)
@@ -112,7 +112,7 @@ static LPCTSTR s_apszRubyConstantsList[] =
 static bool
 IsXKeyword (LPTSTR apszKeywords[], LPCTSTR pszChars, int nLength)
 {
-  for (int L = 0; apszKeywords[L] != NULL; L++)
+  for (int L = 0; apszKeywords[L] != nullptr; L++)
     {
       if (_tcsnicmp (apszKeywords[L], pszChars, nLength) == 0
             && apszKeywords[L][nLength] == 0)
@@ -171,7 +171,7 @@ IsRubyNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -332,7 +332,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 4273553..afa45ef 100644 (file)
@@ -167,7 +167,7 @@ IsRustNumber (LPCTSTR pszChars, int nLength)
 \r
 #define DEFINE_BLOCK(pos, colorindex)   \\r
 ASSERT((pos) >= 0 && (pos) <= nLength);\\r
-if (pBuf != NULL)\\r
+if (pBuf != nullptr)\\r
   {\\r
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\\r
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\\r
@@ -348,7 +348,7 @@ out:
           continue;\r
         }\r
 \r
-      if (pBuf == NULL)\r
+      if (pBuf == nullptr)\r
         continue;               //  We don't need to extract keywords,\r
       //  for faster parsing skip the rest of loop\r
 \r
index 1a4fc10..b2c8cb5 100644 (file)
@@ -241,7 +241,7 @@ IsSgmlNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -406,7 +406,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 2ece346..acfe81f 100644 (file)
@@ -109,7 +109,7 @@ IsShNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -245,7 +245,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index e6296f7..62bd1c2 100644 (file)
@@ -364,7 +364,7 @@ IsSiodNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -525,7 +525,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index f4997ed..b8b2897 100644 (file)
@@ -100,7 +100,7 @@ IsSqlNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -259,7 +259,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 82c41d8..4da4633 100644 (file)
@@ -105,7 +105,7 @@ int CEditStatusBar::OnCreate (LPCREATESTRUCT lpCreateStruct)
   if (CStatusBar::OnCreate (lpCreateStruct) == -1)
     return -1;
   SetFont (CFont::FromHandle ((HFONT) GetStockObject (DEFAULT_GUI_FONT)));
-  SetTimer (ID_INDICATOR_TIME, 1000, NULL);
+  SetTimer (ID_INDICATOR_TIME, 1000, nullptr);
   return 0;
 }
 
index b92fdd6..09a0b89 100644 (file)
@@ -77,7 +77,7 @@ IsTclNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -213,7 +213,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index d8d10a1..79e9e4a 100644 (file)
@@ -884,7 +884,7 @@ IsTexNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -1020,7 +1020,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 0ecbb4d..72e7c92 100644 (file)
@@ -333,7 +333,7 @@ IsVerilogNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -492,7 +492,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index c770b6b..8ec28e2 100644 (file)
@@ -338,7 +338,7 @@ IsVhdlChar (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -457,7 +457,7 @@ out:
       //     continue;
       //   }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 948b98c..dae9aa4 100644 (file)
@@ -210,7 +210,7 @@ IsXmlNumber (LPCTSTR pszChars, int nLength)
 
 #define DEFINE_BLOCK(pos, colorindex)   \
 ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != NULL)\
+if (pBuf != nullptr)\
   {\
     if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
         if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
@@ -375,7 +375,7 @@ out:
             bFirstChar = false;
         }
 
-      if (pBuf == NULL)
+      if (pBuf == nullptr)
         continue;               //  We don't need to extract keywords,
       //  for faster parsing skip the rest of loop
 
index 002333d..b326c64 100644 (file)
@@ -121,7 +121,7 @@ static __declspec(thread) Merge7z::Proxy m_Merge7z =
        { 0, 0, DllBuild_Merge7z, },\r
        "Merge7z\\Merge7z%u%02u" DECORATE_U ".dll",\r
        "Merge7z",\r
-       NULL\r
+       nullptr\r
 };\r
 \r
 std::vector<Merge7z::Format *(*)(const String& path)> Merge7zFormatRegister::optionalFormats;\r
@@ -139,7 +139,7 @@ bool IsArchiveFile(const String& pszFile)
 {\r
        try {\r
                Merge7z::Format *piHandler = ArchiveGuessFormat(pszFile);\r
-               if (piHandler)\r
+               if (piHandler != nullptr)\r
                        return true;\r
                else\r
                        return false;\r
@@ -159,21 +159,21 @@ bool IsArchiveFile(const String& pszFile)
 Merge7z::Format *ArchiveGuessFormat(const String& path)\r
 {\r
        if (GetOptionsMgr()->GetInt(OPT_ARCHIVE_ENABLE) == 0)\r
-               return NULL;\r
+               return nullptr;\r
        if (paths::IsDirectory(path))\r
-               return NULL;\r
+               return nullptr;\r
        String path2(path);\r
        // Map extensions through ExternalArchiveFormat.ini\r
        static TCHAR null[] = _T("");\r
        static const TCHAR section[] = _T("extensions");\r
        String entry = paths::FindExtension(path);\r
        TCHAR value[20];\r
-       static LPCTSTR filename = NULL;\r
-       if (filename == NULL)\r
+       static LPCTSTR filename = nullptr;\r
+       if (filename == nullptr)\r
        {\r
                TCHAR cPath[INTERNET_MAX_PATH_LENGTH];\r
-               DWORD cchPath = SearchPath(NULL, _T("ExternalArchiveFormat.ini"), NULL,\r
-                       INTERNET_MAX_PATH_LENGTH, cPath, NULL);\r
+               DWORD cchPath = SearchPath(nullptr, _T("ExternalArchiveFormat.ini"), nullptr,\r
+                       INTERNET_MAX_PATH_LENGTH, cPath, nullptr);\r
                filename = cchPath && cchPath < INTERNET_MAX_PATH_LENGTH ? _tcsdup(cPath) : null;\r
        }\r
        if (*filename &&\r
@@ -204,14 +204,14 @@ Merge7z::Format *ArchiveGuessFormat(const String& path)
        try\r
        {\r
                Merge7z::Format *pFormat = m_Merge7z->GuessFormat(path2.c_str());\r
-               if (!pFormat)\r
+               if (pFormat == nullptr)\r
                        pFormat = Merge7zFormatRegister::GuessFormat(path2);\r
                return pFormat;\r
        }\r
        catch (...)\r
        {\r
                Merge7z::Format *pFormat = Merge7zFormatRegister::GuessFormat(path2);\r
-               if (pFormat)\r
+               if (pFormat != nullptr)\r
                        return pFormat;\r
                throw;\r
        }\r
@@ -277,7 +277,7 @@ interface Merge7z *Merge7z::Proxy::operator->()
        // As long as the Merge7z*.DLL has not yet been loaded, Merge7z\r
        // [0] points to the name of the DLL (with placeholders for 7-\r
        // Zip major and minor version numbers). Once the DLL has been\r
-       // loaded successfully, Merge7z[0] is set to NULL, causing the\r
+       // loaded successfully, Merge7z[0] is set to nullptr, causing the\r
        // if to fail on subsequent calls.\r
 \r
        if (const char *format = Merge7z[0])\r
@@ -438,7 +438,7 @@ const DIFFITEM &DirItemEnumerator::Next()
  * storage, along with the Envelope itself. The Envelope pointer is passed to\r
  * Merge7z as the return value of the function. It is not meant to be a success\r
  * indicator, so if no temporary storage is required, it is perfectly alright\r
- * to return NULL.\r
+ * to return `nullptr`.\r
  */\r
 Merge7z::Envelope *DirItemEnumerator::Enum(Item &item)\r
 {\r
@@ -511,7 +511,7 @@ bool DirItemEnumerator::MultiStepCompressArchive(LPCTSTR path)
 {\r
        DeleteFile(path);\r
        Merge7z::Format *piHandler = ArchiveGuessFormat(path);\r
-       if (piHandler)\r
+       if (piHandler != nullptr)\r
        {\r
                HWND hwndOwner = CWnd::GetSafeOwner()->GetSafeHwnd();\r
                CString pathIntermediate;\r
@@ -541,7 +541,7 @@ bool DirItemEnumerator::MultiStepCompressArchive(LPCTSTR path)
 void DirItemEnumerator::CompressArchive(LPCTSTR path)\r
 {\r
        String strPath;\r
-       if (path == 0)\r
+       if (path == nullptr)\r
        {\r
                // No path given, so prompt for path!\r
                static const TCHAR _T_Merge7z[] = _T("Merge7z");\r
@@ -615,7 +615,7 @@ void DirItemEnumerator::CompressArchive(LPCTSTR path)
 \r
 DecompressResult DecompressArchive(HWND hWnd, const PathContext& files)\r
 {\r
-       DecompressResult res(files, NULL, paths::IS_EXISTING_DIR);\r
+       DecompressResult res(files, nullptr, paths::IS_EXISTING_DIR);\r
        try\r
        {\r
                String path;\r
@@ -623,7 +623,7 @@ DecompressResult DecompressArchive(HWND hWnd, const PathContext& files)
                // Handle archives using 7-zip\r
                Merge7z::Format *piHandler;\r
                piHandler = ArchiveGuessFormat(res.files[0]);\r
-               if (piHandler)\r
+               if (piHandler  != nullptr)\r
                {\r
                        res.pTempPathContext = new CTempPathContext;\r
                        path = env::GetTempChildPath();\r
@@ -650,7 +650,7 @@ DecompressResult DecompressArchive(HWND hWnd, const PathContext& files)
                }\r
                piHandler = res.files[1].empty() ? nullptr\r
                                                                                 : ArchiveGuessFormat(res.files[1]);\r
-               if (piHandler)\r
+               if (piHandler != nullptr)\r
                {\r
                        if (!res.pTempPathContext)\r
                        {\r
@@ -677,7 +677,7 @@ DecompressResult DecompressArchive(HWND hWnd, const PathContext& files)
                        res.files[1] = path;\r
                }\r
                piHandler = (res.files.GetSize() <= 2) ? nullptr : ArchiveGuessFormat(res.files[2]);\r
-               if (piHandler)\r
+               if (piHandler != nullptr)\r
                {\r
                        if (!res.pTempPathContext)\r
                        {\r
index efd6116..6b009fb 100644 (file)
@@ -36,7 +36,7 @@
 class CAboutDlg::Impl : public CTrDialog
 {
 public:
-       Impl(CAboutDlg *p, CWnd* pParent = NULL);
+       Impl(CAboutDlg *p, CWnd* pParent = nullptr);
 
 // Dialog Data
        //{{AFX_DATA(CAboutDlg::Impl)
@@ -76,7 +76,7 @@ BEGIN_MESSAGE_MAP(CAboutDlg::Impl, CTrDialog)
        ON_NOTIFY(NM_CLICK, IDC_WWW, OnBnClickedWWW)
 END_MESSAGE_MAP()
 
-CAboutDlg::Impl::Impl(CAboutDlg *p, CWnd* pParent /*=NULL*/)
+CAboutDlg::Impl::Impl(CAboutDlg *p, CWnd* pParent /*= nullptr*/)
        : CTrDialog(CAboutDlg::Impl::IDD)
        , m_p(p)
 {
@@ -146,7 +146,7 @@ void CAboutDlg::Impl::OnBnClickedOpenContributors()
 void CAboutDlg::Impl::OnBnClickedWWW(NMHDR *pNMHDR, LRESULT *pResult)
 {
        PNMLINK pNMLink = (PNMLINK)pNMHDR;
-       ShellExecute(NULL, _T("open"), pNMLink->item.szUrl, NULL, NULL, SW_SHOWNORMAL);
+       ShellExecute(nullptr, _T("open"), pNMLink->item.szUrl, nullptr, nullptr, SW_SHOWNORMAL);
 }
 
 CAboutDlg::CAboutDlg() : m_pimpl(new CAboutDlg::Impl(this)) {}
index c4a3180..90047d5 100644 (file)
@@ -108,7 +108,7 @@ BOOL CChildFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
 
        CLocationView *pLocationView = new CLocationView;
        DWORD dwStyle = AFX_WS_DEFAULT_VIEW & ~WS_BORDER;
-       pLocationView->Create(NULL, NULL, dwStyle, CRect(0,0,40,100), &m_wndLocationBar, 152, pContext);
+       pLocationView->Create(nullptr, nullptr, dwStyle, CRect(0,0,40,100), &m_wndLocationBar, 152, pContext);
 
        // Merge frame has also a dockable bar at the very bottom
        // This is not the client area, but we create it now because we want
@@ -122,7 +122,7 @@ BOOL CChildFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
 
        m_pwndDetailMergeEditSplitterView = new CMergeEditSplitterView();
        m_pwndDetailMergeEditSplitterView->m_bDetailView = true;
-       m_pwndDetailMergeEditSplitterView->Create(NULL, NULL, dwStyle, CRect(0,0,1,1), &m_wndDetailBar, ID_VIEW_DETAIL_BAR+1, pContext);
+       m_pwndDetailMergeEditSplitterView->Create(nullptr, nullptr, dwStyle, CRect(0,0,1,1), &m_wndDetailBar, ID_VIEW_DETAIL_BAR+1, pContext);
 
        // tell merge doc about these views
        m_pMergeDoc = dynamic_cast<CMergeDoc *>(pContext->m_pCurrentDoc);
@@ -306,7 +306,7 @@ static bool MyLockWindowUpdate(HWND hwnd)
 }
 
 /**
- * @brief Alternative LockWindowUpdate(NULL) API.
+ * @brief Alternative LockWindowUpdate(nullptr) API.
  * See the comment near the code that calls this function.
  */
 static bool MyUnlockWindowUpdate(HWND hwnd)
@@ -330,7 +330,7 @@ void CChildFrame::ActivateFrame(int nCmdShow)
                m_bActivated = true;
 
                // get the active child frame, and a flag whether it is maximized
-               if (oldActiveFrame == NULL)
+               if (oldActiveFrame == nullptr)
                        // for the first frame, get the restored/maximized state from the registry
                        bMaximized = theApp.GetProfileInt(_T("Settings"), _T("ActiveFrameMax"), TRUE);
                if (bMaximized)
@@ -417,7 +417,7 @@ void CChildFrame::SavePosition()
        m_wndDetailBar.SaveState(_T("Settings"));
 
        int iRow, iCol;
-       m_wndSplitter.GetActivePane(&iRow, NULL);
+       m_wndSplitter.GetActivePane(&iRow, nullptr);
        if (iRow >= 0)
        {
                auto& splitterWnd = static_cast<CMergeEditSplitterView *>(m_wndSplitter.GetPane(iRow, 0))->m_wndSplitter;
@@ -617,7 +617,7 @@ void CChildFrame::UpdateResources()
 LRESULT CChildFrame::OnStorePaneSizes(WPARAM wParam, LPARAM lParam)
 {
        KillTimer(IDT_SAVEPOSITION);
-       SetTimer(IDT_SAVEPOSITION, 300, NULL);
+       SetTimer(IDT_SAVEPOSITION, 300, nullptr);
        return 0;
 }
 
index 19786a5..054db1e 100644 (file)
@@ -1217,7 +1217,7 @@ BCMenuData *BCMenu::FindMenuItem(UINT_PTR nID)
        if (pData == nullptr){
                UINT loc;
                BCMenu *pMenu = FindMenuOption(static_cast<int>(nID), loc);
-               ASSERT(pMenu != this);
+               ASSERT (pMenu != this);
                if (loc != -1){
                        return pMenu->FindMenuItem(nID);
                }
@@ -2155,7 +2155,7 @@ BCMenu* BCMenu::GetSubBCMenu(wchar_t* lpszSubMenuName)
        if(mdata != nullptr){
                HMENU bchmenu=(HMENU)mdata->nID;
                CMenu *ptr=FromHandle(bchmenu);
-               if(ptr!=nullptr){
+               if(ptr != nullptr){
                        bool flag = !!ptr->IsKindOf(RUNTIME_CLASS( BCMenu ));
                        if(flag)
                                return static_cast<BCMenu *>(ptr);
index 6d7676d..f490960 100644 (file)
@@ -76,7 +76,7 @@ CMoveConstraint::Constraint::Init()
 CMoveConstraint::CMoveConstraint()
 {
        m_bSubclassed = false;
-       m_oldWndProc = NULL;
+       m_oldWndProc = nullptr;
        m_sRegistryValueName = _T("UnnamedWindow");
        m_sRegistrySubkey = _T("LastWindowPos");
        ClearMostData();
@@ -236,7 +236,7 @@ CMoveConstraint::ClearMostData()
        // clears everything but m_bSubclassed
        // this is called from constructor, OnDestroy, and destructor
        // so it can't assume any numerical variables have sane values
-       m_hwndDlg=NULL;
+       m_hwndDlg=nullptr;
        // m_rectDlgOriginal
        m_nOrigX=0;
        m_nOrigY=0;
@@ -301,7 +301,7 @@ DoConstrain(CWnd * pWnd, HWND hwndChild, double fLeftX, double fExpandX, double
        }
        else
        {
-               if (!pWnd) // only CWnds can be deferred
+               if (pWnd == nullptr) // only CWnds can be deferred
                        return false;
                m_nDelayed++;
        }
@@ -364,7 +364,7 @@ CMoveConstraint::UnSubclassWnd()
                return false;
        SetWindowLongPtr(m_hwndDlg, GWLP_WNDPROC, (__int3264)(LONG_PTR)(m_oldWndProc));
        RemoveProp(m_hwndDlg, _T("CMoveConstraintData"));
-       m_oldWndProc = NULL;
+       m_oldWndProc = nullptr;
        m_bSubclassed = false;
        return true;
 }
@@ -466,7 +466,7 @@ CMoveConstraint::Resize(HWND hWnd, UINT nType)
                m_pFormView->SetScrollSizes(MM_TEXT, size);
        }
 
-       InvalidateRect(m_hwndDlg, NULL, TRUE);
+       InvalidateRect(m_hwndDlg, nullptr, TRUE);
        UpdateWindow(m_hwndDlg);
 }
 
@@ -605,7 +605,7 @@ CMoveConstraint::OnTtnNeedText(TOOLTIPTEXT * pTTT, LRESULT * plresult)
                {
                        pTTT->lpszText = (LPTSTR)(LPCTSTR)ti.m_sText;
                }
-               *plresult = TRUE; // return TRUE from original window proc
+               *plresult = true; // return `true` from original window proc
                return true; // stop processing this message
        }
        return false;
@@ -714,7 +714,7 @@ CMoveConstraint::Persist(bool saving, bool position)
                        if (m_nMaxY && m_nMaxY < height) height = m_nMaxY;
                        wprc.right = wprc.left + width;
                        wprc.bottom = wprc.top + height;
-                       SetWindowPos(m_hwndDlg, NULL
+                       SetWindowPos(m_hwndDlg, nullptr
                                wprc.left, wprc.top, wprc.right - wprc.left, wprc.bottom - wprc.top,
                                SWP_NOZORDER | SWP_NOACTIVATE);
                }
index f86f5b4..38b6747 100644 (file)
@@ -23,7 +23,7 @@ bool PutToClipboard(const String & text, HWND currentWindowHandle)
                EmptyClipboard();
                const size_t dataSiz = text.length() + 1;
                HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, dataSiz * sizeof(TCHAR));
-               if (hData != NULL)
+               if (hData != nullptr)
                {
                        if (LPTSTR pszData = static_cast<LPTSTR>(::GlobalLock(hData)))
                        {
@@ -31,7 +31,7 @@ bool PutToClipboard(const String & text, HWND currentWindowHandle)
                                GlobalUnlock(hData);
                        }
                        CLIPFORMAT fmt = GetClipTcharTextFormat();
-                       bOK = SetClipboardData(fmt, hData) != NULL;
+                       bOK = SetClipboardData(fmt, hData) != nullptr;
                }
                CloseClipboard();
        }
@@ -51,10 +51,10 @@ bool GetFromClipboard(String & text, HWND currentWindowHandle)
        {
                CLIPFORMAT fmt = GetClipTcharTextFormat();
                HGLOBAL hData = GetClipboardData(fmt);
-               if (hData != NULL)
+               if (hData != nullptr)
                {
                        LPTSTR pszData = (LPTSTR) GlobalLock(hData);
-                       if (pszData != NULL)
+                       if (pszData != nullptr)
                        {
                                text = pszData;
                                GlobalUnlock(hData);
index 69c9228..cac8f58 100644 (file)
@@ -45,7 +45,7 @@ public:
 
        ~CExconverterMLang()
        {
-               if (m_pmlang)
+               if (m_pmlang != nullptr)
                        m_pmlang->Release();
                if (m_hLibMLang)
                        FreeLibrary(m_hLibMLang);
@@ -53,19 +53,19 @@ public:
 
        bool initialize()
        {
-               DllGetClassObjectFunc pfnDllGetClassObject = NULL;
-               IClassFactory *pClassFactory = NULL;
+               DllGetClassObjectFunc pfnDllGetClassObject = nullptr;
+               IClassFactory *pClassFactory = nullptr;
 
                m_hLibMLang = LoadLibrary(_T("mlang.dll"));
-               if (m_hLibMLang)
+               if (m_hLibMLang != nullptr)
                {
                        pfnDllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(m_hLibMLang, "DllGetClassObject");
-                       if (pfnDllGetClassObject)
+                       if (pfnDllGetClassObject != nullptr)
                        {
                                HRESULT hr = pfnDllGetClassObject(CLSID_CMultiLanguage, IID_IClassFactory, (void**)&pClassFactory);
-                               if (pClassFactory)
+                               if (pClassFactory != nullptr)
                                {
-                                       hr = pClassFactory->CreateInstance(NULL, IID_IMultiLanguage2, (void**)&m_pmlang);
+                                       hr = pClassFactory->CreateInstance(nullptr, IID_IMultiLanguage2, (void**)&m_pmlang);
                                        if (SUCCEEDED(hr))
                                        {
                                                pClassFactory->Release();
@@ -74,12 +74,12 @@ public:
                                }
                        }
                }
-               if (pClassFactory)
+               if (pClassFactory != nullptr)
                        pClassFactory->Release();
-               if (m_hLibMLang)
+               if (m_hLibMLang != nullptr)
                {
                        FreeLibrary(m_hLibMLang);
-                       m_hLibMLang = NULL;
+                       m_hLibMLang = nullptr;
                }
                return false;
        }
@@ -222,7 +222,7 @@ public:
        std::vector<CodePageInfo> enumCodePages()
        {
                std::vector<CodePageInfo> cpinfo;
-               IEnumCodePage *pEnumCodePage = NULL;
+               IEnumCodePage *pEnumCodePage = nullptr;
                ULONG ccpInfo;
                HRESULT hr = m_pmlang->EnumCodePages(MIMECONTF_SAVABLE_BROWSER | MIMECONTF_VALID | MIMECONTF_VALID_NLS, 0, &pEnumCodePage);
                if (FAILED(hr))
@@ -284,9 +284,9 @@ public:
 };
 
 #ifdef _MSC_VER
-__declspec(thread) static IExconverter *m_pexconv = NULL;
+__declspec(thread) static IExconverter *m_pexconv = nullptr;
 #else
-static __thread IExconverter *m_pexconv = NULL;
+static __thread IExconverter *m_pexconv = nullptr;
 #endif
 static std::list<std::unique_ptr<IExconverter> > m_exconv_list;
 static Poco::FastMutex m_mutex;
@@ -302,7 +302,7 @@ IExconverter *Exconverter::getInstance()
        if (!pexconv->initialize())
        {
                delete pexconv;
-               return NULL;
+               return nullptr;
        }
        m_pexconv = pexconv;
        Poco::FastMutex::ScopedLock lock(m_mutex);
index 34fd526..57b8b66 100644 (file)
@@ -52,7 +52,7 @@ BOOL CMDITabBar::Create(CMDIFrameWnd* pMainFrame)
        m_pMainFrame = pMainFrame;
        m_dwStyle = CBRS_TOP;
 
-       if (!CWnd::Create(WC_TABCONTROL, NULL, WS_CHILD | WS_VISIBLE | TCS_OWNERDRAWFIXED, CRect(0, 0, 0, 0), pMainFrame, AFX_IDW_CONTROLBAR_FIRST+30))
+       if (!CWnd::Create(WC_TABCONTROL, nullptr, WS_CHILD | WS_VISIBLE | TCS_OWNERDRAWFIXED, CRect(0, 0, 0, 0), pMainFrame, AFX_IDW_CONTROLBAR_FIRST+30))
                return FALSE;
 
        TabCtrl_SetPadding(m_hWnd, determineIconSize(), 4);
@@ -156,7 +156,7 @@ void CMDITabBar::OnContextMenu(CWnd *pWnd, CPoint point)
        CWnd* pMDIChild = FromHandle((HWND)tci.lParam);
        m_pMainFrame->MDIActivate(pMDIChild);
        CMenu* pPopup = pMDIChild->GetSystemMenu(FALSE);
-       if (!pPopup) return;
+       if (pPopup == nullptr) return;
        MENUITEMINFO mii = { sizeof MENUITEMINFO };
        if (!pPopup->GetMenuItemInfo(ID_CLOSE_OTHER_TABS, &mii, FALSE))
        {
@@ -359,7 +359,7 @@ void CMDITabBar::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
                if (!hIcon)
                        hIcon = (HICON)GetClassLongPtr(hwndFrame, GCLP_HICONSM);
                if (hIcon)
-                       DrawIconEx(lpDraw->hDC, rc.left - iconsize.cx - 2, rc.top + (rc.bottom - rc.top - iconsize.cy) / 2, hIcon, iconsize.cx, iconsize.cy, 0, NULL, DI_NORMAL);
+                       DrawIconEx(lpDraw->hDC, rc.left - iconsize.cx - 2, rc.top + (rc.bottom - rc.top - iconsize.cy) / 2, hIcon, iconsize.cx, iconsize.cy, 0, nullptr, DI_NORMAL);
        }
        DrawText(lpDraw->hDC, szBuf, -1, &rc, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
 
index 743af96..237891f 100644 (file)
@@ -113,8 +113,8 @@ IMPLEMENT_DYNAMIC(CMessageBoxDialog, CDialog)
        m_font.CreateFontIndirect(&ncm.lfMessageFont);
 
        LOGFONT lf = { 0 };
-       HTHEME hTheme = OpenThemeData(NULL, _T("TEXTSTYLE"));
-       if (hTheme && SUCCEEDED(GetThemeFont(hTheme, NULL, TEXT_MAININSTRUCTION, 0, TMT_FONT, &lf)))
+       HTHEME hTheme = OpenThemeData(nullptr, _T("TEXTSTYLE"));
+       if (hTheme && SUCCEEDED(GetThemeFont(hTheme, nullptr, TEXT_MAININSTRUCTION, 0, TMT_FONT, &lf)))
        {
                m_fontMainInstruction.CreateFontIndirect(&lf);
                GetThemeColor(hTheme, TEXT_MAININSTRUCTION, 0, TMT_TEXTCOLOR, &m_clrMainInstructionFont);
@@ -366,7 +366,7 @@ static UINT ModelessMesssageBoxThread(LPVOID lpParam)
        struct ModelessMesssageBoxParam *p = (struct ModelessMesssageBoxParam *)lpParam;
        
        // Create the message box dialog.
-       CMessageBoxDialog dlgMessage(NULL, p->strMessage, _T(""), p->nType);
+       CMessageBoxDialog dlgMessage(nullptr, p->strMessage, _T(""), p->nType);
        
        delete p;
 
@@ -467,7 +467,7 @@ void CMessageBoxDialog::EndDialog ( int nResult )
        CWnd* pCheckboxWnd = GetDlgItem(IDCHECKBOX);
 
        // Check whether the control can be accessed.
-       if ( pCheckboxWnd != NULL )
+       if ( pCheckboxWnd != nullptr )
        {
                // Check whether the checkbox is checked.
                bDontDisplayAgain = 
@@ -581,7 +581,7 @@ BOOL CMessageBoxDialog::OnInitDialog ( )
                        CWnd* pCheckboxWnd = GetDlgItem(IDCHECKBOX);
 
                        // Check whether the checkbox handle was retrieved.
-                       if ( pCheckboxWnd != NULL )
+                       if ( pCheckboxWnd != nullptr )
                        {
                                // Disable the checkbox.
                                pCheckboxWnd->EnableWindow(FALSE);
@@ -589,7 +589,7 @@ BOOL CMessageBoxDialog::OnInitDialog ( )
                }
 
                // Install a timer.
-               m_nTimeoutTimer = SetTimer(MESSAGE_BOX_TIMER, 1000, NULL);
+               m_nTimeoutTimer = SetTimer(MESSAGE_BOX_TIMER, 1000, nullptr);
        }
 
        // Check whether a default button was defined.
@@ -675,7 +675,7 @@ BOOL CMessageBoxDialog::PreTranslateMessage ( MSG* pMsg )
                        CWnd* pFocusWnd = GetFocus();
 
                        // Check whether a handle was retrieved.
-                       if ( pFocusWnd != NULL )
+                       if ( pFocusWnd != nullptr )
                        {
                                // Try to determine the ID of the element.
                                int nID = pFocusWnd->GetDlgCtrlID();
@@ -764,7 +764,7 @@ void CMessageBoxDialog::OnTimer ( UINT_PTR nIDEvent )
                                CWnd* pCheckboxWnd = GetDlgItem(IDCHECKBOX);
 
                                // Check whether the checkbox was found.
-                               if ( pCheckboxWnd != NULL )
+                               if ( pCheckboxWnd != nullptr )
                                {
                                        // Enable the checkbox.
                                        pCheckboxWnd->EnableWindow(TRUE);
@@ -1000,15 +1000,15 @@ void CMessageBoxDialog::ParseStyle ( )
                case MB_OKCANCEL:
 
                        // Add two buttons: "Ok" and "Cancel".
-                       AddButton(IDOK, IDS_MESSAGEBOX_OK, TRUE);
-                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, FALSE, TRUE);
+                       AddButton(IDOK, IDS_MESSAGEBOX_OK, true);
+                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, false, true);
 
                        break;
 
                case MB_ABORTRETRYIGNORE:
 
                        // Add three buttons: "Abort", "Retry" and "Ignore".
-                       AddButton(IDABORT, IDS_MESSAGEBOX_ABORT, TRUE);
+                       AddButton(IDABORT, IDS_MESSAGEBOX_ABORT, true);
                        AddButton(IDRETRY, IDS_MESSAGEBOX_RETRY);
                        AddButton(IDIGNORE, IDS_MESSAGEBOX_IGNORE);
 
@@ -1017,7 +1017,7 @@ void CMessageBoxDialog::ParseStyle ( )
                case MB_YESNOCANCEL:
 
                        // Add three buttons: "Yes", "No" and "Cancel".
-                       AddButton(IDYES, IDS_MESSAGEBOX_YES, TRUE);
+                       AddButton(IDYES, IDS_MESSAGEBOX_YES, true);
 
                        // Check whether to add a "Yes to all" button.
                        if ( m_nStyle & MB_YES_TO_ALL )
@@ -1035,14 +1035,14 @@ void CMessageBoxDialog::ParseStyle ( )
                                AddButton(IDNOTOALL, IDS_MESSAGEBOX_NO_TO_ALL);
                        }
 
-                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, FALSE, TRUE);
+                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, false, true);
 
                        break;
 
                case MB_YESNO:
                        
                        // Add two buttons: "Yes" and "No".
-                       AddButton(IDYES, IDS_MESSAGEBOX_YES, TRUE);
+                       AddButton(IDYES, IDS_MESSAGEBOX_YES, true);
 
                        // Check whether to add a "Yes to all" button.
                        if ( m_nStyle & MB_YES_TO_ALL )
@@ -1065,15 +1065,15 @@ void CMessageBoxDialog::ParseStyle ( )
                case MB_RETRYCANCEL:
 
                        // Add two buttons: "Retry" and "Cancel".
-                       AddButton(IDRETRY, IDS_MESSAGEBOX_RETRY, TRUE);
-                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, FALSE, TRUE);
+                       AddButton(IDRETRY, IDS_MESSAGEBOX_RETRY, true);
+                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, false, true);
 
                        break;
 
                case MB_CANCELTRYCONTINUE:
 
                        // Add three buttons: "Cancel", "Try again" and "Continue".
-                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, TRUE, TRUE);
+                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, true, true);
                        AddButton(IDTRYAGAIN, IDS_MESSAGEBOX_RETRY);
                        AddButton(IDCONTINUE, IDS_MESSAGEBOX_CONTINUE);
 
@@ -1082,7 +1082,7 @@ void CMessageBoxDialog::ParseStyle ( )
                case MB_CONTINUEABORT:
 
                        // Add two buttons: "Continue" and "Abort".
-                       AddButton(IDCONTINUE, IDS_MESSAGEBOX_CONTINUE, TRUE);
+                       AddButton(IDCONTINUE, IDS_MESSAGEBOX_CONTINUE, true);
                        AddButton(IDABORT, IDS_MESSAGEBOX_ABORT);
 
                        break;
@@ -1090,18 +1090,18 @@ void CMessageBoxDialog::ParseStyle ( )
                case MB_SKIPSKIPALLCANCEL:
 
                        // Add three buttons: "Skip", "Skip all" and "Cancel".
-                       AddButton(IDSKIP, IDS_MESSAGEBOX_SKIP, TRUE);
+                       AddButton(IDSKIP, IDS_MESSAGEBOX_SKIP, true);
                        AddButton(IDSKIPALL, IDS_MESSAGEBOX_SKIPALL);
-                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, FALSE, TRUE);
+                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, false, true);
 
                        break;
 
                case MB_IGNOREIGNOREALLCANCEL:
 
                        // Add three buttons: "Ignore", "Ignore all" and "Cancel".
-                       AddButton(IDIGNORE, IDS_MESSAGEBOX_IGNORE, TRUE);
+                       AddButton(IDIGNORE, IDS_MESSAGEBOX_IGNORE, true);
                        AddButton(IDIGNOREALL, IDS_MESSAGEBOX_IGNOREALL);
-                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, FALSE, TRUE);
+                       AddButton(IDCANCEL, IDS_MESSAGEBOX_CANCEL, false, true);
 
                        break;
 
@@ -1109,7 +1109,7 @@ void CMessageBoxDialog::ParseStyle ( )
                case MB_OK:
 
                        // Add just one button: "Ok".
-                       AddButton(IDOK, IDS_MESSAGEBOX_OK, TRUE, TRUE);
+                       AddButton(IDOK, IDS_MESSAGEBOX_OK, true, true);
 
                        break;
 
@@ -1185,7 +1185,7 @@ void CMessageBoxDialog::ParseStyle ( )
        }
 
        // Check whether an icon was specified.
-       if ( ( m_nStyle & MB_ICONMASK ) && ( m_hIcon == NULL ) )
+       if ( ( m_nStyle & MB_ICONMASK ) && ( m_hIcon == nullptr ) )
        {
                // Switch the icon.
                switch ( m_nStyle & MB_ICONMASK )
@@ -1232,7 +1232,7 @@ void CMessageBoxDialog::ParseStyle ( )
 void CMessageBoxDialog::CreateIconControl ( )
 {
        // Check whether an icon was defined.
-       if ( m_hIcon != NULL )
+       if ( m_hIcon != nullptr )
        {
                // Create a structure to read information about the icon.
                ICONINFO iiIconInfo;
@@ -1256,7 +1256,7 @@ void CMessageBoxDialog::CreateIconControl ( )
                CRect rcDummy;
 
                // Create the control for the icon.
-               m_stcIcon.Create(NULL, WS_CHILD | WS_VISIBLE | WS_DISABLED | SS_ICON,
+               m_stcIcon.Create(nullptr, WS_CHILD | WS_VISIBLE | WS_DISABLED | SS_ICON,
                        rcDummy, this, (UINT)IDC_STATIC);
 
                // Set the icon of the control.
@@ -1277,7 +1277,7 @@ void CMessageBoxDialog::CreateMessageControl ( )
 
        // Create a DC for accessing the display driver.
        CDC dcDisplay;
-       dcDisplay.CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
+       dcDisplay.CreateDC(_T("DISPLAY"), nullptr, nullptr, nullptr);
 
        // Select the new font and store the old one.
        CFont* pOldFont = dcDisplay.SelectObject(&m_fontMainInstruction);
@@ -1286,7 +1286,7 @@ void CMessageBoxDialog::CreateMessageControl ( )
        int nMaxWidth = ( GetSystemMetrics(SM_CXSCREEN) / 2 ) + 100;
 
        // Check whether an icon is displayed.
-       if ( m_hIcon != NULL )
+       if ( m_hIcon != nullptr )
        {
                // Decrease the maximum width.
                nMaxWidth -= m_sIcon.cx + 2 * XDialogUnitToPixel(CX_BORDER);
@@ -1500,7 +1500,7 @@ void CMessageBoxDialog::DefineLayout ( )
        int nYPosition = YDialogUnitToPixel(CY_BORDER) * 2;
 
        // Check whether an icon is defined.
-       if ( m_hIcon != NULL )
+       if ( m_hIcon != nullptr )
        {
                // Move the icon control.
                m_stcIcon.MoveWindow(XDialogUnitToPixel(CX_BORDER) * 2, 
index c8ef461..1f3ff51 100644 (file)
@@ -229,7 +229,7 @@ void CPreferencesDlg::SetActivePage(int nPage)
 
        // synchronize tree
        CPropertyPage* pPage = m_pphost.GetActivePage();
-       HTREEITEM hti = NULL;
+       HTREEITEM hti = nullptr;
 
        if (m_mapPP2HTI.Lookup(pPage, (void*&)hti) && hti)
                m_tcPages.SelectItem(hti);
@@ -251,7 +251,7 @@ CString CPreferencesDlg::GetItemPath(HTREEITEM hti)
 
 /**
  * @brief Read options from storage to UI controls.
- * @param [in] bUpdate If TRUE UpdateData() is called
+ * @param [in] bUpdate If `true` UpdateData() is called
  */
 void CPreferencesDlg::ReadOptions(bool bUpdate)
 {
@@ -324,7 +324,7 @@ 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, nullptr, _("Select file for import"), _("Options files (*.ini)|*.ini|All Files (*.*)|*.*||")))
        {
                if (m_pOptionsMgr->ImportOptions(s) == COption::OPT_OK)
                {
@@ -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, nullptr, _("Select file for export"),
                _("Options files (*.ini)|*.ini|All Files (*.*)|*.*||")))
        {
                // Add settings file extension if it is missing
@@ -372,6 +372,6 @@ void CPreferencesDlg::OnExportButton()
  */
 void CPreferencesDlg::SafeUpdatePage(CPropertyPage* pPage, bool bSaveAndValidate)
 {
-       if (pPage->GetSafeHwnd() != NULL)
+       if (pPage->GetSafeHwnd() != nullptr)
                pPage->UpdateData(bSaveAndValidate);
 }
index 4c3cd98..ab78ed2 100644 (file)
@@ -50,14 +50,14 @@ BOOL CPropertyPageHost::Create(UINT nRefCtrlID, CWnd* pParent, UINT uCtrlID)
 {
        ASSERT_VALID(pParent);
 
-       if (!pParent || !::IsWindow(*pParent))
+       if (pParent == nullptr || !::IsWindow(*pParent))
                return FALSE;
 
        CWnd* pRefCtrl = pParent->GetDlgItem(nRefCtrlID);
 
        ASSERT_VALID(pRefCtrl);
 
-       if (!pRefCtrl || !::IsWindow(*pRefCtrl))
+       if (pRefCtrl == nullptr || !::IsWindow(*pRefCtrl))
                return FALSE;
 
        CRect rHost;
@@ -78,13 +78,13 @@ BOOL CPropertyPageHost::Create(LPRECT lpRect, CWnd* pParent, UINT uCtrlID)
 {
        ASSERT_VALID(pParent);
 
-       if (!pParent || !::IsWindow(*pParent))
+       if (pParent == nullptr || !::IsWindow(*pParent))
                return FALSE;
 
        if (!m_aPages.GetSize())
                return FALSE;
 
-       if (!CWnd::Create(NULL, NULL, WS_CHILD | WS_VISIBLE, *lpRect, pParent, uCtrlID))
+       if (!CWnd::Create(nullptr, nullptr, WS_CHILD | WS_VISIBLE, *lpRect, pParent, uCtrlID))
                return FALSE;
 
        // create the first page
@@ -99,12 +99,12 @@ int CPropertyPageHost::GetActiveIndex()
 CPropertyPage* CPropertyPageHost::GetActivePage()
 {
        if (m_nSelIndex < 0)
-               return NULL;
+               return nullptr;
 
        CPropertyPage* pPage = m_aPages[m_nSelIndex].pPage;
 
-       if (!pPage || !pPage->GetSafeHwnd())
-               return NULL;
+       if (pPage == nullptr || !pPage->GetSafeHwnd())
+               return nullptr;
 
        return pPage;
 }
@@ -119,17 +119,17 @@ LRESULT CPropertyPageHost::OnGetCurrentPageHwnd(WPARAM wParam, LPARAM lParam)
 bool CPropertyPageHost::SetActivePage(int nIndex, bool bAndFocus /*= true*/)
 {
        if (nIndex < 0 || nIndex >= m_aPages.GetSize())
-               return FALSE;
+               return false;
 
        CPropertyPage* pPage = m_aPages[nIndex].pPage;
 
-       if (!pPage)
-               return FALSE;
+       if (pPage == nullptr)
+               return false;
 
        CWnd* pFocus = GetFocus();
 
        if (!pPage->GetSafeHwnd() && !pPage->Create(pPage->m_psp.pszTemplate, this))
-               return FALSE;
+               return false;
 
        // make sure we can into/out of the page
        pPage->ModifyStyleEx(0, WS_EX_CONTROLPARENT | DS_CONTROL);
@@ -188,22 +188,22 @@ bool CPropertyPageHost::SetActivePage(CPropertyPage* pPage, bool bAndFocus /*= t
 
 bool CPropertyPageHost::AddPage(CPropertyPage* pPage, LPCTSTR szTitle /*= nullptr*/, DWORD dwItemData /*= 0*/)
 {
-       if (!pPage || !pPage->IsKindOf(RUNTIME_CLASS(CPropertyPage)))
-               return FALSE;
+       if (pPage == nullptr || !pPage->IsKindOf(RUNTIME_CLASS(CPropertyPage)))
+               return false;
 
        if (FindPage(pPage) == -1)
        {
                PAGEITEM pi(pPage, szTitle, dwItemData);
                int nPage = (int) m_aPages.Add(pi);
 
-               if (szTitle)
+               if (szTitle != nullptr)
                {
                        pPage->m_psp.pszTitle = m_aPages[nPage].sTitle; // the final string address
                        pPage->m_psp.dwFlags |= PSP_USETITLE;
                }
        }
 
-       return TRUE;
+       return true;
 }
 
 int CPropertyPageHost::FindPage(CPropertyPage* pPage)
@@ -250,15 +250,15 @@ BOOL COccManager::IsDialogMessage(CWnd* pWndDlg, LPMSG lpMsg)
                CWnd* pWndCtrl = pWndFocus;
 
                // Walk up the parent chain, until we find an OLE control.
-               while ((pWndCtrl != NULL) && (pWndCtrl->m_pCtrlSite == NULL) &&
+               while ((pWndCtrl != nullptr) && (pWndCtrl->m_pCtrlSite == nullptr) &&
                        (pWndCtrl->GetParent() != pWndDlg))
                {
                        pWndCtrl = pWndCtrl->GetParent();
                }
 
                // let the control attempt to translate the message
-               if (pWndCtrl != NULL && pWndCtrl->m_pCtrlSite != NULL &&
-                       pWndCtrl->m_pCtrlSite->m_pActiveObject != NULL &&
+               if (pWndCtrl != nullptr && pWndCtrl->m_pCtrlSite != nullptr &&
+                       pWndCtrl->m_pCtrlSite->m_pActiveObject != nullptr &&
                        pWndCtrl->m_pCtrlSite->m_pActiveObject->TranslateAccelerator(lpMsg) == S_OK)
                {
                        return TRUE;
@@ -266,7 +266,7 @@ BOOL COccManager::IsDialogMessage(CWnd* pWndDlg, LPMSG lpMsg)
 
                // handle CTRLINFO_EATS_RETURN and CTRLINFO_EATS_ESCAPE flags
                if ((uMsg == WM_KEYUP || uMsg == WM_KEYDOWN || uMsg == WM_CHAR) &&
-                       pWndCtrl != NULL && pWndCtrl->m_pCtrlSite != NULL &&
+                       pWndCtrl != nullptr && pWndCtrl->m_pCtrlSite != nullptr &&
                        ((LOWORD(lpMsg->wParam) == VK_RETURN &&
                         (pWndCtrl->m_pCtrlSite->m_ctlInfo.dwFlags & CTRLINFO_EATS_RETURN)) ||
                        (LOWORD(lpMsg->wParam) == VK_ESCAPE &&
@@ -370,7 +370,7 @@ DWORD CPropertyPageHost::GetPageItemData(int nIndex)
 CPropertyPage* CPropertyPageHost::GetPage(int nIndex)
 {
        if (nIndex < 0 || nIndex > m_aPages.GetSize())
-               return NULL;
+               return nullptr;
 
        return m_aPages[nIndex].pPage;
 }
@@ -385,5 +385,5 @@ CPropertyPage* CPropertyPageHost::FindPage(DWORD dwItemData)
                        return m_aPages[nPage].pPage;
        }
 
-       return NULL;
+       return nullptr;
 }
index 7e852d6..9baced6 100644 (file)
@@ -72,7 +72,7 @@ void CShellContextMenu::AddItem(const String& path,
 
 HMENU CShellContextMenu::GetHMENU() const
 {
-       return ::IsMenu(m_hShellContextMenu) ? m_hShellContextMenu : NULL;
+       return ::IsMenu(m_hShellContextMenu) ? m_hShellContextMenu : nullptr;
 }
 
 bool CShellContextMenu::HandleMenuMessage(UINT message, WPARAM wParam, LPARAM lParam, LRESULT& retval)
@@ -83,7 +83,7 @@ bool CShellContextMenu::HandleMenuMessage(UINT message, WPARAM wParam, LPARAM lP
        case WM_DRAWITEM:
        case WM_INITMENUPOPUP:
        case WM_MEASUREITEM:
-               if (m_pShellContextMenu3)
+               if (m_pShellContextMenu3 != nullptr)
                {
                        if (FAILED(/*hr = */m_pShellContextMenu3->HandleMenuMsg(message, wParam, lParam/*, &retval*/)))
                        {
@@ -97,7 +97,7 @@ bool CShellContextMenu::HandleMenuMessage(UINT message, WPARAM wParam, LPARAM lP
                                //assert(false);
                        }
                }
-               else if (m_pShellContextMenu2)
+               else if (m_pShellContextMenu2 != nullptr)
                {
                        if (FAILED(/*hr = */m_pShellContextMenu2->HandleMenuMsg(message, wParam, lParam)))
                        {
@@ -109,7 +109,7 @@ bool CShellContextMenu::HandleMenuMessage(UINT message, WPARAM wParam, LPARAM lP
                retval = (message == WM_INITMENUPOPUP) ? 0 : TRUE;
                return true;
        case WM_MENUCHAR:
-               if (m_pShellContextMenu3)
+               if (m_pShellContextMenu3 != nullptr)
                {
                        retval = 0;
                        if (FAILED(/*hr = */m_pShellContextMenu3->HandleMenuMsg2(message, wParam, lParam, &retval)))
@@ -145,20 +145,20 @@ bool CShellContextMenu::QueryShellContextMenu()
                        parentDir = currentDir;
 
                        LPITEMIDLIST dirPidl;
-                       if (FAILED(/*hr = */pDesktop->ParseDisplayName(NULL,                                       // hwnd
-                                                                                                          NULL,                                           // pbc
+                       if (FAILED(/*hr = */pDesktop->ParseDisplayName(nullptr,                            // hwnd
+                                                                                                          nullptr,                                        // pbc
                                                                                                           CT2OLE(currentDir.c_str()), // pszDisplayName
-                                                                                                          NULL,                                           // pchEaten
+                                                                                                          nullptr,                                        // pchEaten
                                                                                                           &dirPidl,                               // ppidl
-                                                                                                          NULL                                            // pdwAttributes
+                                                                                                          nullptr                                         // pdwAttributes
                                                                                                           )))
                        {
                                return false;
                        }
 
                        if (FAILED(/*hr = */pDesktop->BindToObject(dirPidl,                      // pidl
-                                                                                                  NULL,                         // pbc
-                                                                                                  IID_IShellFolder, // riid
+                                                                                                  nullptr,                              // pbc
+                                                                                                  IID_IShellFolder,     // riid
                                                                                                   reinterpret_cast<void**>(&pCurrFolder))))
                        {
                                return false;
@@ -170,12 +170,12 @@ bool CShellContextMenu::QueryShellContextMenu()
                }
 
                LPITEMIDLIST pidl;
-               if (FAILED(/*hr = */pCurrFolder->ParseDisplayName(NULL,
-                                                                                                         NULL,
+               if (FAILED(/*hr = */pCurrFolder->ParseDisplayName(nullptr,
+                                                                                                         nullptr,
                                                                                                          CT2OLE(file.filename.c_str()), 
-                                                                                                         NULL,
+                                                                                                         nullptr,
                                                                                                          &pidl,
-                                                                                                         NULL)))
+                                                                                                         nullptr)))
                {
                        return false;
                }
@@ -189,7 +189,7 @@ bool CShellContextMenu::QueryShellContextMenu()
        }
 
        IContextMenuPtr pCMenu1;
-       if (FAILED(/*hr = */pCurrFolder->GetUIObjectOf(NULL,
+       if (FAILED(/*hr = */pCurrFolder->GetUIObjectOf(nullptr,
                                                                                           static_cast<unsigned>(pidls.Size()),
                                                                                           pidls.GetList(),
                                                                                           IID_IContextMenu,
@@ -264,7 +264,7 @@ bool CShellContextMenu::RequeryShellContextMenu()
 
 void CShellContextMenu::ReleaseShellContextMenu()
 {
-       m_pShellContextMenu2 = NULL;
-       m_pShellContextMenu3 = NULL;
-       m_pPreferredMenu = NULL;
+       m_pShellContextMenu2 = nullptr;
+       m_pShellContextMenu3 = nullptr;
+       m_pPreferredMenu = nullptr;
 }
index 6809793..689058c 100644 (file)
@@ -269,7 +269,7 @@ bool UniMemFile::DoOpen(const String& filename, AccessMode mode)
        catch (Exception& e)
        {
                LastErrorCustom(ucr::toTString(e.displayText()));
-               m_hMapping = NULL;
+               m_hMapping = nullptr;
                return false;
        }
 
@@ -427,7 +427,7 @@ static void RecordZero(UniFile::txtstats & txstats, size_t offset)
  * @brief Read one (DOS or UNIX or Mac) line.
  * @param [out] line Line read.
  * @param [out] eol EOL bytes read (if any).
- * @param [out] lossy TRUE if there were lossy encoding.
+ * @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, String & eol, bool * lossy)
index f15e11e..05d83aa 100644 (file)
@@ -27,7 +27,7 @@ struct LANGUAGEANDCODEPAGE
  * @brief Constructor for asking only numeric version info.
  * This constructor creates instance that only reads version numbers,
  * not several strings there are. This saves some time.
- * @param [in] bVersionOnly If TRUE only version numbers are read.
+ * @param [in] bVersionOnly If `true` only version numbers are read.
  */
 CVersionInfo::CVersionInfo(bool bVersionOnly)
 : m_wLanguage(0)
@@ -57,7 +57,7 @@ CVersionInfo::CVersionInfo(WORD wLanguage)
 /** 
  * @brief Constructor.
  * @param [in] szFileToVersion Filename to read version from.
- * @param [in] bDllVersion If TRUE queries DLL version.
+ * @param [in] bDllVersion If `true` queries DLL version.
  */
 CVersionInfo::CVersionInfo(LPCTSTR szFileToVersion, 
                                                   bool bDllVersion)
@@ -291,7 +291,7 @@ void CVersionInfo::GetVersionInfo()
 
        if (m_strFileName.empty())
        {
-               ::GetModuleFileName(NULL, szFileName, MAX_PATH);
+               ::GetModuleFileName(nullptr, szFileName, MAX_PATH);
                m_strFileName = szFileName;
        }
        else
index e7df95f..d75b7ad 100644 (file)
@@ -202,7 +202,7 @@ void CSizingControlBarCF::NcPaintGripper(CDC* pDC, CRect rcClient)
             CPoint(rcGrip.left + pointToPixel(2.25), rcGrip.top - pointToPixel(0.75));
 
         pDC->ExtTextOut(ptOrg.x, ptOrg.y,
-            ETO_CLIPPED, rcGrip, sTitle, NULL);
+            ETO_CLIPPED, rcGrip, sTitle, nullptr);
 
         pDC->SelectObject(pOldFont);
         pDC->SetBkMode(nOldBkMode);
index 4e2c409..7da94b4 100644 (file)
@@ -131,7 +131,7 @@ BOOL CSizingControlBar::Create(LPCTSTR lpszWindowName,
 
     // register and create the window - skip CControlBar::Create()
     CString wndclass = ::AfxRegisterWndClass(CS_DBLCLKS,
-        ::LoadCursor(NULL, IDC_ARROW),
+        ::LoadCursor(nullptr, IDC_ARROW),
         ::GetSysColorBrush(COLOR_BTNFACE), 0);
 
     dwStyle &= ~CBRS_ALL; // keep only the generic window styles
@@ -246,11 +246,11 @@ CSize CSizingControlBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
     GetRowSizingBars(arrSCBars);
     AFX_SIZEPARENTPARAMS layout;
     layout.hDWP = pDockBar->m_bLayoutQuery ?
-        NULL : ::BeginDeferWindowPos(static_cast<int>(arrSCBars.GetSize()));
+        nullptr : ::BeginDeferWindowPos(static_cast<int>(arrSCBars.GetSize()));
     for (int i = 0; i < arrSCBars.GetSize(); i++)
         if (arrSCBars[i]->m_nStateFlags & (delayHide|delayShow))
             arrSCBars[i]->RecalcDelayShow(&layout);
-    if (layout.hDWP != NULL)
+    if (layout.hDWP != nullptr)
         ::EndDeferWindowPos(layout.hDWP);
 
     // get available length
@@ -449,7 +449,7 @@ void CSizingControlBar::OnNcCalcSize(BOOL bCalcValidRects,
     m_dwSCBStyle &= ~SCBS_EDGEALL;
 
     // add resizing edges between bars on the same row
-    if (!IsFloating() && m_pDockBar != NULL)
+    if (!IsFloating() && m_pDockBar != nullptr)
     {
         CSCBArray arrSCBars;
         int nThis;
@@ -615,7 +615,7 @@ void CSizingControlBar::StartTracking(UINT nHitTest, CPoint point)
 
     // make sure no updates are pending
     if (!m_bDragShowContent)
-        RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW);
+        RedrawWindow(nullptr, nullptr, RDW_ALLCHILDREN | RDW_UPDATENOW);
 
     m_htEdge = nHitTest;
     m_bTracking = true;
@@ -650,7 +650,7 @@ void CSizingControlBar::StartTracking(UINT nHitTest, CPoint point)
         // remaining client area of the mainframe
         CRect rcT;
         m_pDockSite->RepositionBars(0, 0xFFFF, AFX_IDW_PANE_FIRST,
-            reposQuery, &rcT, NULL, TRUE);
+            reposQuery, &rcT, nullptr, TRUE);
         int nMaxWidth = bHorz ? rcT.Height() - 2 : rcT.Width() - 2;
 
         bool bTopOrLeft = m_htEdge == HTTOP || m_htEdge == HTLEFT;
@@ -798,7 +798,7 @@ void CSizingControlBar::OnTrackInvertTracker()
     rc.OffsetRect(bHorzTracking ? nOfs : 0, bHorzTracking ? 0 : nOfs);
     rc.OffsetRect(-rcFrame.TopLeft());
 
-    CDC *pDC = m_pDockSite->GetDCEx(NULL,
+    CDC *pDC = m_pDockSite->GetDCEx(nullptr,
         DCX_WINDOW | DCX_CACHE | DCX_LOCKWINDOWUPDATE);
     CBrush* pBrush = CDC::GetHalftoneBrush();
     CBrush* pBrushOld = pDC->SelectObject(pBrush);
@@ -870,10 +870,10 @@ void CSizingControlBar::GetRowInfo(int& nFirst, int& nLast, int& nThis)
 
     // find the first and the last bar in row
     for (nFirst = -1, i = nThis - 1; i >= 0 && nFirst == -1; i--)
-        if (m_pDockBar->m_arrBars[i] == NULL)
+        if (m_pDockBar->m_arrBars[i] == nullptr)
             nFirst = i + 1;
     for (nLast = -1, i = nThis + 1; i < nBars && nLast == -1; i++)
-        if (m_pDockBar->m_arrBars[i] == NULL)
+        if (m_pDockBar->m_arrBars[i] == nullptr)
             nLast = i - 1;
 
     ASSERT((nLast != -1) && (nFirst != -1));
@@ -949,7 +949,7 @@ bool CSizingControlBar::NegotiateSpace(int nLengthTotal, bool bHorz)
             if (i < nThis)
             {
                 m_pDockBar->m_arrBars.InsertAt(i + 1,
-                    (CControlBar*) NULL);
+                    (CControlBar*) nullptr);
                 return false;
             }
             
@@ -965,7 +965,7 @@ bool CSizingControlBar::NegotiateSpace(int nLengthTotal, bool bHorz)
             }
 
             // we have enough bars - go negotiate with them
-            m_pDockBar->m_arrBars.InsertAt(i, (CControlBar*) NULL);
+            m_pDockBar->m_arrBars.InsertAt(i, (CControlBar*) nullptr);
             nLast = i - 1;
             break;
         }
@@ -1289,7 +1289,7 @@ BOOL CSCBMiniDockFrameWnd::Create(CWnd* pParent, DWORD dwBarStyle)
 #endif
 
     if (!CMiniFrameWnd::CreateEx(dwExStyle,
-        NULL, &afxChNil, dwStyle, rectDefault, pParent))
+        nullptr, &afxChNil, dwStyle, rectDefault, pParent))
     {
         m_bInRecalcLayout = FALSE;
         return FALSE;
@@ -1329,7 +1329,7 @@ void CSCBMiniDockFrameWnd::OnNcLButtonDown(UINT nHitTest, CPoint point)
         return;
     }
 
-    if (GetSizingControlBar() != NULL)
+    if (GetSizingControlBar() != nullptr)
         CMiniFrameWnd::OnNcLButtonDown(nHitTest, point);
     else
         baseCSCBMiniDockFrameWnd::OnNcLButtonDown(nHitTest, point);
@@ -1338,15 +1338,15 @@ void CSCBMiniDockFrameWnd::OnNcLButtonDown(UINT nHitTest, CPoint point)
 CSizingControlBar* CSCBMiniDockFrameWnd::GetSizingControlBar()
 {
     CWnd* pWnd = GetWindow(GW_CHILD); // get the dockbar
-    if (pWnd == NULL)
-        return NULL;
+    if (pWnd == nullptr)
+        return nullptr;
     
     pWnd = pWnd->GetWindow(GW_CHILD); // get the controlbar
-    if (pWnd == NULL)
-        return NULL;
+    if (pWnd == nullptr)
+        return nullptr;
 
     if (!pWnd->IsKindOf(RUNTIME_CLASS(CSizingControlBar)))
-        return NULL;
+        return nullptr;
 
     return static_cast<CSizingControlBar*>(pWnd);
 }
@@ -1354,7 +1354,7 @@ CSizingControlBar* CSCBMiniDockFrameWnd::GetSizingControlBar()
 void CSCBMiniDockFrameWnd::OnSize(UINT nType, int cx, int cy) 
 {
     CSizingControlBar* pBar = GetSizingControlBar();
-    if ((pBar != NULL) && (GetStyle() & MFS_4THICKFRAME) == 0
+    if ((pBar != nullptr) && (GetStyle() & MFS_4THICKFRAME) == 0
         && pBar->IsVisible() &&
         cx + 4 >= pBar->m_szMinFloat.cx &&
         cy + 4 >= pBar->m_szMinFloat.cy)
@@ -1368,7 +1368,7 @@ void CSCBMiniDockFrameWnd::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
     baseCSCBMiniDockFrameWnd::OnGetMinMaxInfo(lpMMI);
 
     CSizingControlBar* pBar = GetSizingControlBar();
-    if (pBar != NULL)
+    if (pBar != nullptr)
     {
         CRect r(CPoint(0, 0), pBar->m_szMinFloat - CSize(4, 4));
 #ifndef _SCB_MINIFRAME_CAPTION
@@ -1386,7 +1386,7 @@ void CSCBMiniDockFrameWnd::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)
     if ((GetStyle() & MFS_4THICKFRAME) != 0)
     {
         CSizingControlBar* pBar = GetSizingControlBar();
-        if (pBar != NULL)
+        if (pBar != nullptr)
         {
             lpwndpos->flags |= SWP_NOSIZE; // don't size this time
             // prevents flicker
index 170bce0..460dece 100644 (file)
@@ -308,7 +308,7 @@ void maketchar(String & ch, unsigned unich, bool & lossy, unsigned codepage)
                char outch[3] = {0};
                BOOL defaulted = FALSE;
                DWORD flags = WC_NO_BEST_FIT_CHARS;
-               if (WideCharToMultiByte(codepage, flags, &wch, 1, outch, sizeof(outch), NULL, &defaulted)
+               if (WideCharToMultiByte(codepage, flags, &wch, 1, outch, sizeof(outch), nullptr, &defaulted)
                                && !defaulted)
                {
                        ch = outch;
@@ -319,7 +319,7 @@ void maketchar(String & ch, unsigned unich, bool & lossy, unsigned codepage)
        // already lossy, so make our best shot
        DWORD flags = WC_COMPOSITECHECK + WC_DISCARDNS + WC_SEPCHARS + WC_DEFAULTCHAR;
        TCHAR outbuff[16];
-       int n = WideCharToMultiByte(codepage, flags, &wch, 1, outbuff, sizeof(outbuff) - 1, NULL, NULL);
+       int n = WideCharToMultiByte(codepage, flags, &wch, 1, outbuff, sizeof(outbuff) - 1, nullptr, nullptr);
        if (n > 0)
        {
                outbuff[n] = 0;
@@ -733,7 +733,7 @@ int CrossConvert(const char* src, unsigned srclen, char* dest, unsigned destsize
        if (cpout == CP_UTF8)
        {
                flags = 0;
-               pdefaulted = NULL;
+               pdefaulted = nullptr;
        }
        if (cpout == CP_UCS2LE)
        {
@@ -751,7 +751,7 @@ int CrossConvert(const char* src, unsigned srclen, char* dest, unsigned destsize
        }
        else
        {
-               n = WideCharToMultiByte(cpout, flags, wbuff.get(), n, dest, destsize - 1, NULL, pdefaulted);
+               n = WideCharToMultiByte(cpout, flags, wbuff.get(), n, dest, destsize - 1, nullptr, pdefaulted);
                if (!n)
                {
                        int nsyserr = ::GetLastError();
@@ -997,16 +997,16 @@ bool convert(UNICODESET unicoding1, int codepage1, const unsigned char * src, si
        {
                // From UCS-2LE to 8-bit (or UTF-8)
 
-               // WideCharToMultiByte: lpDefaultChar & lpUsedDefaultChar must be NULL when using UTF-8
+               // WideCharToMultiByte: lpDefaultChar & lpUsedDefaultChar must be `nullptr` when using UTF-8
 
                int destcp = (unicoding2 == UTF8 ? CP_UTF8 : codepage2);
                if (destcp == CP_ACP || IsValidCodePage(destcp))
                {
                        DWORD flags = 0;
-                       int bytes = WideCharToMultiByte(destcp, flags, (LPCWSTR)src, static_cast<int>(srcbytes/2), 0, 0, NULL, NULL);
+                       int bytes = WideCharToMultiByte(destcp, flags, (LPCWSTR)src, static_cast<int>(srcbytes/2), 0, 0, nullptr, nullptr);
                        dest->resize(bytes + 2);
                        int losses = 0;
-                       bytes = WideCharToMultiByte(destcp, flags, (LPCWSTR)src, static_cast<int>(srcbytes/2), (char *)dest->ptr, static_cast<int>(dest->capacity), NULL, NULL);
+                       bytes = WideCharToMultiByte(destcp, flags, (LPCWSTR)src, static_cast<int>(srcbytes/2), (char *)dest->ptr, static_cast<int>(dest->capacity), nullptr, nullptr);
                        dest->ptr[bytes] = 0;
                        dest->ptr[bytes+1] = 0;
                        dest->size = bytes;
@@ -1077,7 +1077,7 @@ static void convert(const std::wstring& from, unsigned codepage, std::string& to
        if (len)
        {
                to.resize(len);
-               WideCharToMultiByte(codepage, 0, from.c_str(), static_cast<int>(from.length()), &to[0], static_cast<int>(len), NULL, NULL);
+               WideCharToMultiByte(codepage, 0, from.c_str(), static_cast<int>(from.length()), &to[0], static_cast<int>(len), nullptr, nullptr);
        }
        else
        {
index df31999..9c83fb2 100644 (file)
@@ -219,7 +219,7 @@ void CConfigLog::WriteVersionOf1(int indent, const String& path)
                path2 = String(pf+2);
        }
        String name = paths::FindFileName(path2);
-       CVersionInfo vi(path2.c_str(), TRUE);
+       CVersionInfo vi(path2.c_str(), true);
        String sModifiedTime = _T("");
        if (name != path)
        {
index e52ef51..3bfffc2 100644 (file)
@@ -313,7 +313,7 @@ int CDiffTextBuffer::LoadFromFile(LPCTSTR pszFileNameInit,
        DWORD nRetVal = FileLoadResult::FRESULT_OK;
 
        // Set encoding based on extension, if we know one
-       paths::SplitFilename(pszFileName, NULL, NULL, &sExt);
+       paths::SplitFilename(pszFileName, nullptr, nullptr, &sExt);
        CCrystalTextView::TextDefinition *def = 
                CCrystalTextView::GetTextType(sExt.c_str());
        if (def && def->encoding != -1)
@@ -520,7 +520,7 @@ int CDiffTextBuffer::SaveToFile (const String& pszFileName,
        else
        {
                sIntermediateFilename = env::GetTemporaryFileName(m_strTempPath,
-                       _T("MRG_"), NULL);
+                       _T("MRG_"), nullptr);
                if (sIntermediateFilename.empty())
                        return SAVE_FAILED;  //Nothing to do if even tempfile name fails
                bOpenSuccess = !!file.OpenCreate(sIntermediateFilename);
@@ -654,7 +654,7 @@ int CDiffTextBuffer::SaveToFile (const String& pszFileName,
                        m_dwRevisionNumberOnSave = m_dwCurrentRevisionNumber;
 
                        // redraw line revision marks
-                       UpdateViews (NULL, NULL, UPDATE_FLAGSONLY);     
+                       UpdateViews (nullptr, nullptr, UPDATE_FLAGSONLY);       
                }
                catch (Exception& e)
                {
index b5ed1d8..1445cdc 100644 (file)
@@ -237,7 +237,7 @@ void CDiffWrapper::SetDetectMovedBlocks(bool bDetectMovedBlocks)
 {
        if (bDetectMovedBlocks)
        {
-               if (m_pMovedLines[0] == NULL)
+               if (m_pMovedLines[0] == nullptr)
                {
                        m_pMovedLines[0].reset(new MovedLines);
                        m_pMovedLines[1].reset(new MovedLines);
@@ -320,7 +320,7 @@ bool CDiffWrapper::IsTrivialLine(const std::string &Line,
  * @brief Find comment marker in string, excluding portions enclosed in quotation marks or apostrophes
  * @param [in] target                          - string to search
  * @param [in] marker                          - marker to search for
- * @return Returns position of marker, or NULL if none is present
+ * @return Returns position of marker, or `nullptr` if none is present
  */
 static const char *FindCommentMarker(const char *target, const char *marker)
 {
@@ -340,7 +340,7 @@ static const char *FindCommentMarker(const char *target, const char *marker)
                prev = c;
                ++target;
        }
-       return NULL;
+       return nullptr;
 }
 
 /**
@@ -1078,7 +1078,7 @@ void CDiffWrapper::SetAppendFiles(bool bAppendFiles)
  * @param [in] diffData files to compare.
  * @param [out] bin_status used to return binary status from compare.
  * @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
+    So if first file is binary, first bit is set etc. Can be `nullptr` 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.
@@ -1094,12 +1094,12 @@ bool CDiffWrapper::Diff2Files(struct change ** diffs, DiffFileData *diffData,
        {
                // Diff files. depth is zero because we are not comparing dirs
                *diffs = diff_2_files (diffData->m_inf, 0, bin_status,
-                               (m_pMovedLines[0] != NULL), bin_file);
+                               (m_pMovedLines[0] != nullptr), bin_file);
                CopyDiffutilTextStats(diffData->m_inf, diffData);
        }
        catch (SE_Exception&)
        {
-               *diffs = NULL;
+               *diffs = nullptr;
                bRet = false;
        }
        return bRet;
index c704f74..297aec8 100644 (file)
@@ -285,8 +285,8 @@ UPDATEITEM_TYPE UpdateDiffAfterOperation(const FileActionItem & act, CDiffContex
 
 /**
  * @brief Find the CDiffContext diffpos of an item from its left & right paths
- * @return POSITION to item, NULL if not found.
- * @note Filenames must be same, if they differ NULL is returned.
+ * @return POSITION to item, `nullptr` if not found.
+ * @note Filenames must be same, if they differ `nullptr` is returned.
  */
 uintptr_t FindItemFromPaths(const CDiffContext& ctxt, const PathContext& paths)
 {
index 5e3bfb3..dd9ede4 100644 (file)
@@ -120,11 +120,11 @@ static HGLOBAL ConvertToUTF16ForClipboard(HGLOBAL hMem, int codepage)
        size_t len = GlobalSize(hMem);
        HGLOBAL hMemW = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE|GMEM_ZEROINIT, (len + 1) * sizeof(wchar_t));
        if (!hMemW)
-               return NULL;
+               return nullptr;
        LPCSTR pstr = reinterpret_cast<LPCSTR>(GlobalLock(hMem));
        LPWSTR pwstr = reinterpret_cast<LPWSTR>(GlobalLock(hMemW));
-       if (!pstr || !pwstr)
-               return NULL;
+       if (pstr == nullptr || pwstr == nullptr)
+               return nullptr;
        int wlen = MultiByteToWideChar(codepage, 0, pstr, static_cast<int>(len), pwstr, static_cast<int>(len + 1));
        if (len > 0 && pstr[len - 1] != '\0')
        {
@@ -204,7 +204,7 @@ bool DirCmpReport::GenerateReport(String &errStr)
                if (!dlg.m_sReportFile.empty())
                {
                        String path;
-                       paths::SplitFilename(dlg.m_sReportFile, &path, NULL, NULL);
+                       paths::SplitFilename(dlg.m_sReportFile, &path, nullptr, nullptr);
                        if (!paths::CreateIfNeeded(path))
                        {
                                errStr = _("Folder does not exist.");
@@ -223,7 +223,7 @@ bool DirCmpReport::GenerateReport(String &errStr)
                e->ReportError(MB_ICONSTOP);
                e->Delete();
        }
-       m_pFile = NULL;
+       m_pFile = nullptr;
        return bRet;
 }
 
@@ -467,7 +467,7 @@ void DirCmpReport::GenerateXmlHeader()
 void DirCmpReport::GenerateXmlHtmlContent(bool xml)
 {
        String sFileName, sParentDir;
-       paths::SplitFilename((const TCHAR *)m_pFile->GetFilePath(), &sParentDir, &sFileName, NULL);
+       paths::SplitFilename((const TCHAR *)m_pFile->GetFilePath(), &sParentDir, &sFileName, nullptr);
        String sRelDestDir = sFileName.substr(0, sFileName.find_last_of(_T("."))) + _T(".files");
        String sDestDir = paths::ConcatPath(sParentDir, sRelDestDir);
        if (!xml && m_bIncludeFileCmpReport && m_pFileCmpReport)
index 04e884c..86601be 100644 (file)
@@ -168,7 +168,7 @@ void CDirColsDlg::MoveItem(int index, int newIndex)
 
 /**
  * @brief Move selected items one position up or down.
- * @param [in] bUp If TRUE items are moved up,
+ * @param [in] bUp If `true` items are moved up,
  *  if FALSE items are moved down.
  */
 void CDirColsDlg::MoveSelectedItems(bool bUp)
index a5c2ab3..0769d39 100644 (file)
@@ -78,7 +78,7 @@ BOOL DirCompProgressBar::Create(CWnd* pParentWnd)
                return FALSE; 
 
 #ifdef __ITaskbarList3_INTERFACE_DEFINED__
-       CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_ALL, IID_ITaskbarList3, (void**)&m_pTaskbarList);
+       CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_ITaskbarList3, (void**)&m_pTaskbarList);
        if (m_pTaskbarList)
                m_pTaskbarList->SetProgressState(AfxGetMainWnd()->m_hWnd, TBPF_INDETERMINATE);
 #endif
@@ -172,7 +172,7 @@ void DirCompProgressBar::OnTimer(UINT_PTR nIDEvent)
 void DirCompProgressBar::StartUpdating()
 {
        ClearStat();
-       SetTimer(IDT_UPDATE, UPDATE_INTERVAL, NULL);
+       SetTimer(IDT_UPDATE, UPDATE_INTERVAL, nullptr);
 }
 
 /**
index e8260db..218d010 100644 (file)
@@ -142,7 +142,7 @@ void CDirDoc::Serialize(CArchive& ar)
  * Initialises directory compare with paths given and recursive choice.
  * Previous compare context is first free'd.
  * @param [in] paths Paths to compare
- * @param [in] bRecursive If TRUE subdirectories are included to compare.
+ * @param [in] bRecursive If `true` subdirectories are included to compare.
  */
 void CDirDoc::InitCompare(const PathContext & paths, bool bRecursive, CTempPathContext *pTempPathContext)
 {
@@ -427,7 +427,7 @@ bool CDirDoc::CloseMergeDocs()
  * @param [in] paths Paths for files we update
  * @param [in] nDiffs Total amount of differences
  * @param [in] nTrivialDiffs Amount of ignored differences
- * @param [in] bIdentical TRUE if files became identical, FALSE otherwise.
+ * @param [in] bIdentical `true` if files became identical, FALSE otherwise.
  */
 void CDirDoc::UpdateChangedItem(PathContext &paths,
        UINT nDiffs, UINT nTrivialDiffs, bool bIdentical)
index 3118bdc..5cd0dfd 100644 (file)
@@ -187,7 +187,7 @@ void CDirFrame::ActivateFrame(int nCmdShow)
        // get the active child frame, and a flag whether it is maximized
        BOOL bMaximized;
        CMDIChildWnd * oldActiveFrame = GetMDIFrame()->MDIGetActive(&bMaximized);
-       if (oldActiveFrame == NULL)
+       if (oldActiveFrame == nullptr)
                // for the first frame, get the restored/maximized state from the registry
                bMaximized = theApp.GetProfileInt(_T("Settings"), _T("ActiveFrameMax"), TRUE);
        if (bMaximized)
index c3e046a..489d8b9 100644 (file)
@@ -275,14 +275,14 @@ int DirScan_GetItems(const PathContext &paths, const String subdir[],
                {
                        if (nDirs < 3)
                                AddToList(subdir[0], subdir[1], 
-                                       (nDiffCode & DIFFCODE::FIRST ) ? &dirs[0][i] : NULL
-                                       (nDiffCode & DIFFCODE::SECOND) ? &dirs[1][j] : NULL,
+                                       (nDiffCode & DIFFCODE::FIRST ) ? &dirs[0][i] : nullptr
+                                       (nDiffCode & DIFFCODE::SECOND) ? &dirs[1][j] : nullptr,
                                        nDiffCode, myStruct, parent);
                        else
                                AddToList(subdir[0], subdir[1], subdir[2], 
-                                       (nDiffCode & DIFFCODE::FIRST ) ? &dirs[0][i] : NULL,
-                                       (nDiffCode & DIFFCODE::SECOND) ? &dirs[1][j] : NULL,
-                                       (nDiffCode & DIFFCODE::THIRD ) ? &dirs[2][k] : NULL,
+                                       (nDiffCode & DIFFCODE::FIRST ) ? &dirs[0][i] : nullptr,
+                                       (nDiffCode & DIFFCODE::SECOND) ? &dirs[1][j] : nullptr,
+                                       (nDiffCode & DIFFCODE::THIRD ) ? &dirs[2][k] : nullptr,
                                        nDiffCode, myStruct, parent);
                }
                else
@@ -291,8 +291,8 @@ int DirScan_GetItems(const PathContext &paths, const String subdir[],
                        if (nDirs < 3)
                        {
                                DIFFITEM *me = AddToList(subdir[0], subdir[1], 
-                                       (nDiffCode & DIFFCODE::FIRST ) ? &dirs[0][i] : NULL
-                                       (nDiffCode & DIFFCODE::SECOND) ? &dirs[1][j] : NULL,
+                                       (nDiffCode & DIFFCODE::FIRST ) ? &dirs[0][i] : nullptr
+                                       (nDiffCode & DIFFCODE::SECOND) ? &dirs[1][j] : nullptr,
                                        nDiffCode, myStruct, parent);
                                if ((nDiffCode & DIFFCODE::SKIPPED) == 0 && ((nDiffCode & DIFFCODE::SIDEFLAGS) == DIFFCODE::BOTH || bUniques))
                                {
@@ -307,9 +307,9 @@ int DirScan_GetItems(const PathContext &paths, const String subdir[],
                        else
                        {
                                DIFFITEM *me = AddToList(subdir[0], subdir[1], subdir[2], 
-                                       (nDiffCode & DIFFCODE::FIRST ) ? &dirs[0][i] : NULL,
-                                       (nDiffCode & DIFFCODE::SECOND) ? &dirs[1][j] : NULL,
-                                       (nDiffCode & DIFFCODE::THIRD ) ? &dirs[2][k] : NULL,
+                                       (nDiffCode & DIFFCODE::FIRST ) ? &dirs[0][i] : nullptr,
+                                       (nDiffCode & DIFFCODE::SECOND) ? &dirs[1][j] : nullptr,
+                                       (nDiffCode & DIFFCODE::THIRD ) ? &dirs[2][k] : nullptr,
                                        nDiffCode, myStruct, parent);
                                if ((nDiffCode & DIFFCODE::SKIPPED) == 0 && ((nDiffCode & DIFFCODE::SIDEFLAGS) == DIFFCODE::ALL || bUniques))
                                {
@@ -733,7 +733,7 @@ void CompareDiffItem(DIFFITEM &di, CDiffContext * pCtxt)
        {
                // We don't actually 'compare' directories, just add non-ignored
                // directories to list.
-               StoreDiffData(di, pCtxt, NULL);
+               StoreDiffData(di, pCtxt, nullptr);
        }
        else
        {
@@ -751,7 +751,7 @@ void CompareDiffItem(DIFFITEM &di, CDiffContext * pCtxt)
                else
                {
                        di.diffcode.diffcode |= DIFFCODE::SKIPPED;
-                       StoreDiffData(di, pCtxt, NULL);
+                       StoreDiffData(di, pCtxt, nullptr);
                }
        }
 }
index df11042..2d37464 100644 (file)
@@ -390,7 +390,8 @@ void CDirView::OnInitialUpdate()
        }
 
        // Replace standard header with sort header
-       if (HWND hWnd = ListView_GetHeader(m_pList->m_hWnd))
+       HWND hWnd = ListView_GetHeader(m_pList->m_hWnd);
+       if (hWnd != nullptr)
                m_ctlSortHeader.SubclassWindow(hWnd);
 
        // Load the icons used for the list view (to reflect diff status)
@@ -442,7 +443,7 @@ void CDirView::OnInitialUpdate()
  */
 void CDirView::StartCompare(CompareStats *pCompareStats)
 {
-       if (m_pCmpProgressBar == NULL)
+       if (m_pCmpProgressBar == nullptr)
                m_pCmpProgressBar.reset(new DirCompProgressBar());
 
        if (!::IsWindow(m_pCmpProgressBar->GetSafeHwnd()))
@@ -1231,7 +1232,7 @@ void CDirView::OpenParentDirectory()
                DWORD dwFlags[3];
                for (int nIndex = 0; nIndex < pathsParent.GetSize(); ++nIndex)
                        dwFlags[nIndex] = FFILEOPEN_NOMRU | (pDoc->GetReadOnly(nIndex) ? FFILEOPEN_READONLY : 0);
-               GetMainFrame()->DoFileOpen(&pathsParent, dwFlags, NULL, _T(""), GetDiffContext().m_bRecursive, (GetAsyncKeyState(VK_CONTROL) & 0x8000) ? NULL : pDoc);
+               GetMainFrame()->DoFileOpen(&pathsParent, dwFlags, nullptr, _T(""), GetDiffContext().m_bRecursive, (GetAsyncKeyState(VK_CONTROL) & 0x8000) ? nullptr : pDoc);
        }
                // fall through (no break!)
        case AllowUpwardDirectory::No:
@@ -1394,12 +1395,12 @@ void CDirView::OpenSelection(SELECTIONTYPE selectionType /*= SELECTIONTYPE_NORMA
        {
                // Open subfolders
                // Don't add folders to MRU
-               GetMainFrame()->DoFileOpen(&paths, dwFlags, NULL, _T(""), GetDiffContext().m_bRecursive, (GetAsyncKeyState(VK_CONTROL) & 0x8000) ? NULL : pDoc);
+               GetMainFrame()->DoFileOpen(&paths, dwFlags, nullptr, _T(""), GetDiffContext().m_bRecursive, (GetAsyncKeyState(VK_CONTROL) & 0x8000) ? nullptr : pDoc);
        }
        else if (HasZipSupport() && std::count_if(paths.begin(), paths.end(), ArchiveGuessFormat) == paths.GetSize())
        {
                // Open archives, not adding paths to MRU
-               GetMainFrame()->DoFileOpen(&paths, dwFlags, NULL, _T(""), GetDiffContext().m_bRecursive, NULL, _T(""), infoUnpacker);
+               GetMainFrame()->DoFileOpen(&paths, dwFlags, nullptr, _T(""), GetDiffContext().m_bRecursive, nullptr, _T(""), infoUnpacker);
        }
        else
        {
@@ -1511,7 +1512,7 @@ void CDirView::OpenSelectionHex()
                fileloc[pane].setPath(paths[pane]);
                dwFlags[pane] |= FFILEOPEN_NOMRU | (pDoc->GetReadOnly(nPane[pane]) ? FFILEOPEN_READONLY : 0);
        }
-       GetMainFrame()->ShowHexMergeDoc(pDoc, paths.GetSize(), fileloc, dwFlags, NULL);
+       GetMainFrame()->ShowHexMergeDoc(pDoc, paths.GetSize(), fileloc, dwFlags, nullptr);
 }
 
 /// User chose (context menu) delete left
@@ -2145,7 +2146,7 @@ BOOL CDirView::PreTranslateMessage(MSG* pMsg)
                                else if (m_bTreeMode && sel >= 0)
                                {
                                        const DIFFITEM& di = GetDiffItem(sel);
-                                       if (di.parent != NULL)
+                                       if (di.parent != nullptr)
                                        {
                                                int i = GetItemIndex((uintptr_t)di.parent);
                                                if (i >= 0)
@@ -2260,7 +2261,7 @@ LRESULT CDirView::OnUpdateUIMessage(WPARAM wParam, LPARAM lParam)
        }
        else if (wParam == CDiffThread::EVENT_COMPARE_PROGRESSED)
        {
-               InvalidateRect(NULL, FALSE);
+               InvalidateRect(nullptr, FALSE);
        }
        else if (wParam == CDiffThread::EVENT_COLLECT_COMPLETED)
        {
@@ -2583,7 +2584,7 @@ struct FileCmpReport: public IFileCmpReport
                }
 
                MSG msg;
-               while (::PeekMessage(&msg, NULL, NULL, NULL, PM_NOREMOVE))
+               while (::PeekMessage(&msg, nullptr, NULL, NULL, PM_NOREMOVE))
                        if (!AfxGetApp()->PumpMessage())
                                break;
                GetMainFrame()->OnUpdateFrameTitle(FALSE);
@@ -2755,7 +2756,7 @@ void CDirView::OnCtxtDirZip()
 
 void CDirView::ShowShellContextMenu(SIDE_TYPE stype)
 {
-       CShellContextMenu *pContextMenu = NULL;
+       CShellContextMenu *pContextMenu = nullptr;
        switch (stype)
        {
        case SIDE_LEFT:
@@ -2783,7 +2784,7 @@ void CDirView::ShowShellContextMenu(SIDE_TYPE stype)
                ASSERT(pFrame != nullptr);
                BOOL bAutoMenuEnableOld = pFrame->m_bAutoMenuEnable;
                pFrame->m_bAutoMenuEnable = FALSE;
-               BOOL nCmd = TrackPopupMenu(pContextMenu->GetHMENU(), TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, point.x, point.y, 0, hWnd, NULL);
+               BOOL nCmd = TrackPopupMenu(pContextMenu->GetHMENU(), TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, point.x, point.y, 0, hWnd, nullptr);
                if (nCmd)
                        pContextMenu->InvokeCommand(nCmd, hWnd);
                pContextMenu->ReleaseShellContextMenu();
@@ -3002,7 +3003,7 @@ void CDirView::OnUpdateCtxtDirMoveTo(CCmdUI* pCmdUI)
 void CDirView::OnSize(UINT nType, int cx, int cy)
 {
        CListView::OnSize(nType, cx, cy);
-       GetDocument()->SetTitle(NULL);
+       GetDocument()->SetTitle(nullptr);
 }
 
 /**
@@ -3089,10 +3090,10 @@ afx_msg void CDirView::OnEndLabelEdit(NMHDR* pNMHDR, LRESULT* pResult)
 {
        *pResult = FALSE;
 
-       // We can't use the normal condition of pszText==NULL to know if the
+       // We can't use the normal condition of pszText==`nullptr` to know if the
        // user cancels editing when file names had different case (e.g.
        // "file.txt|FILE.txt"). The edit text was changed to "file.txt" and
-       // if the user accept it as the new file name, pszText is NULL.
+       // if the user accept it as the new file name, pszText is `nullptr`.
 
        if (!m_bUserCancelEdit)
        {
@@ -3499,7 +3500,7 @@ void CDirView::DoFileEncodingDialog()
 
        ApplyCodepage(SelBegin(), SelEnd(), GetDiffContext(), affected, dlg.GetLoadCodepage());
 
-       m_pList->InvalidateRect(NULL);
+       m_pList->InvalidateRect(nullptr);
        m_pList->UpdateWindow();
 
        // TODO: We could loop through any active merge windows belonging to us
@@ -3592,11 +3593,11 @@ void CDirView::OnUpdateEditUndo(CCmdUI* pCmdUI)
  *
  * @param [in] hMenu Handle to the menu to check ownership of.
  * @return Either m_pShellContextMenuLeft, m_pShellContextMenuRight
- *   or NULL if hMenu is not owned by these two.
+ *   or `nullptr` if hMenu is not owned by these two.
  */
 CShellContextMenu* CDirView::GetCorrespondingShellContextMenu(HMENU hMenu) const
 {
-       CShellContextMenu* pMenu = NULL;
+       CShellContextMenu* pMenu = nullptr;
        if (m_pShellContextMenuLeft && hMenu == m_pShellContextMenuLeft->GetHMENU())
                pMenu = m_pShellContextMenuLeft.get();
        else if (m_pShellContextMenuMiddle && hMenu == m_pShellContextMenuMiddle->GetHMENU())
@@ -3815,7 +3816,7 @@ void CDirView::OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult)
 #else
                DropData->CacheGlobalData(CF_TEXT, hMem);
 #endif
-               DROPEFFECT de = DropData->DoDragDrop(DROPEFFECT_COPY | DROPEFFECT_MOVE, NULL);
+               DROPEFFECT de = DropData->DoDragDrop(DROPEFFECT_COPY | DROPEFFECT_MOVE, nullptr);
        }
 
        *pResult = 0;
@@ -4047,7 +4048,7 @@ DirActions CDirView::MakeDirActions(DirActions::method_type func) const
 DirActions CDirView::MakeDirActions(DirActions::method_type2 func) const
 {
        const CDirDoc *pDoc = GetDocument();
-       return DirActions(pDoc->GetDiffContext(), pDoc->GetReadOnly(), NULL, func);
+       return DirActions(pDoc->GetDiffContext(), pDoc->GetReadOnly(), nullptr, func);
 }
 
 const CDiffContext& CDirView::GetDiffContext() const
index dc1b2fe..027c401 100644 (file)
@@ -213,7 +213,7 @@ String CEditorFilePathBar::GetText(int pane) const
 {
        ASSERT (pane >= 0 && pane < countof(m_Edit));
 
-       // Check for NULL since window may be closing..
+       // Check for `nullptr` since window may be closing..
        if (m_hWnd == nullptr)
                return _T("");
 
@@ -232,7 +232,7 @@ void CEditorFilePathBar::SetText(int pane, const String& sString)
 {
        ASSERT (pane >= 0 && pane < countof(m_Edit));
 
-       // Check for NULL since window may be closing..
+       // Check for `nullptr` since window may be closing..
        if (m_hWnd == nullptr)
                return;
 
@@ -249,7 +249,7 @@ void CEditorFilePathBar::SetActive(int pane, bool bActive)
 {
        ASSERT (pane >= 0 && pane < countof(m_Edit));
 
-       // Check for NULL since window may be closing..
+       // Check for `nullptr` since window may be closing..
        if (m_hWnd == nullptr)
                return;
 
index 83e0f5e..555643e 100644 (file)
@@ -370,7 +370,7 @@ void CFilepathEdit::SetActive(bool bActive)
                SetTextColor(::GetSysColor(COLOR_INACTIVECAPTIONTEXT));
                SetBackColor(::GetSysColor(COLOR_INACTIVECAPTION));
        }
-       RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE);
+       RedrawWindow(nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE);
 }
 
 /**
@@ -384,7 +384,7 @@ void CFilepathEdit::SetActive(bool bActive)
 HBRUSH CFilepathEdit::CtlColor(CDC* pDC, UINT nCtlColor) 
 {
        UNUSED_ALWAYS(nCtlColor);
-       // Return a non-NULL brush if the parent's 
+       // Return a non-`nullptr` brush if the parent's 
        //handler should not be called
 
        //set text color
index ee5a75b..2225bcd 100644 (file)
@@ -311,7 +311,7 @@ int FolderCmp::prepAndCompareFiles(CDiffContext * pCtxt, DIFFITEM &di)
                        // use our own byte-by-byte compare
                        if (tFiles.GetSize() == 2)
                        {
-                               if (m_pByteCompare == NULL)
+                               if (m_pByteCompare == nullptr)
                                        m_pByteCompare.reset(new ByteCompare());
                                bool success = m_pByteCompare->SetCompareOptions(
                                        *pCtxt->GetCompareOptions(CMP_QUICK_CONTENT));
@@ -338,7 +338,7 @@ int FolderCmp::prepAndCompareFiles(CDiffContext * pCtxt, DIFFITEM &di)
                        }
                        else
                        {
-                               if (m_pByteCompare == NULL)
+                               if (m_pByteCompare == nullptr)
                                        m_pByteCompare.reset(new ByteCompare());
                                bool success = m_pByteCompare->SetCompareOptions(
                                        *pCtxt->GetCompareOptions(CMP_QUICK_CONTENT));
index 307821d..ab4066d 100644 (file)
@@ -121,8 +121,8 @@ void CHexMergeView::OnDraw(CDC *)
  */
 bool CHexMergeView::IsLoadable()
 {
-       static void *pv = NULL;
-       if (pv == NULL)
+       static void *pv = nullptr;
+       if (pv == nullptr)
        {
                pv = LoadLibrary(_T("Frhed\\hekseditU.dll"));
        }
index 569e1c8..4c8679f 100644 (file)
@@ -212,7 +212,7 @@ bool CImgMergeFrame::OpenDocs(int nFiles, const FileLocation fileloc[], const bo
        SetTitle(nullptr);
 
        LPCTSTR lpszWndClass = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW,
-                       LoadCursor(NULL, IDC_ARROW), (HBRUSH)(COLOR_WINDOW+1), NULL);
+                       ::LoadCursor(nullptr, IDC_ARROW), (HBRUSH)(COLOR_WINDOW+1), nullptr);
 
        if (!CMDIChildWnd::Create(lpszWndClass, GetTitle(), WS_OVERLAPPEDWINDOW | WS_CHILD, rectDefault, pParent))
                return false;
@@ -909,7 +909,7 @@ void CImgMergeFrame::UpdateHeaderPath(int pane)
        else
        {
                sText = m_filePaths.GetPath(pane);
-               if (m_pDirDoc)
+               if (m_pDirDoc != nullptr)
                        m_pDirDoc->ApplyDisplayRoot(pane, sText);
        }
        if (m_pImgMergeWindow->IsModified(pane))
index 2e3604a..ab7b871 100644 (file)
@@ -63,7 +63,7 @@ public:
        void SetDirDoc(CDirDoc * pDirDoc);
        void UpdateResources();
        bool CloseNow();
-       void DirDocClosing(CDirDoc * pDirDoc) { m_pDirDoc = NULL; }
+       void DirDocClosing(CDirDoc * pDirDoc) { m_pDirDoc = nullptr; }
        void SetSharedMenu(HMENU hMenu) { m_hMenuShared = hMenu; };
        void SetLastCompareResult(int nResult);
        void UpdateLastCompareResult();
index 1d2ff82..820c342 100644 (file)
@@ -117,7 +117,7 @@ void LineFiltersDlg::OnHelp()
  * @param [in] enabled Is filter enabled?
  * @return Index of added row.
  */
-int LineFiltersDlg::AddRow(const String& filter /*= NULL*/, bool enabled /*=false*/)
+int LineFiltersDlg::AddRow(const String& filter /*= nullptr*/, bool enabled /*= false*/)
 {
        int items = m_filtersList.GetItemCount();
        int ind = m_filtersList.InsertItem(items, filter.c_str());
index c056da5..b783054 100644 (file)
@@ -56,7 +56,7 @@ protected:
        DECLARE_MESSAGE_MAP()
 
        void InitList();
-       int AddRow(const String& filter = NULL, bool enabled = false);
+       int AddRow(const String& filter = nullptr, bool enabled = false);
        void EditSelectedFilter();
 
 private:
index 25117f7..1e2d722 100644 (file)
@@ -17,7 +17,7 @@
 // CLoadSaveCodepageDlg dialog
 
 
-CLoadSaveCodepageDlg::CLoadSaveCodepageDlg(int nFiles, CWnd* pParent /*=NULL*/)
+CLoadSaveCodepageDlg::CLoadSaveCodepageDlg(int nFiles, CWnd* pParent /*= nullptr*/)
 : CTrDialog(CLoadSaveCodepageDlg::IDD, pParent)
 , m_bAffectsLeft(true)
 , m_bAffectsMiddle(true)
@@ -80,7 +80,7 @@ BOOL CLoadSaveCodepageDlg::OnInitDialog()
        CTrDialog::OnInitDialog();
 
        IExconverter *pexconv = Exconverter::getInstance();
-       if (pexconv != NULL)
+       if (pexconv != nullptr)
        {
                CComboBox combol, combos;
                combol.Attach(::GetDlgItem(m_hWnd, IDC_LOAD_CODEPAGE_TEXTBOX));
index 8b1aaba..e1eab62 100644 (file)
@@ -15,7 +15,7 @@ class CLoadSaveCodepageDlg : public CTrDialog
 {
 public:
 // Construction
-       CLoadSaveCodepageDlg(int nFiles, CWnd* pParent = NULL);   // standard constructor
+       CLoadSaveCodepageDlg(int nFiles, CWnd* pParent = nullptr);   // standard constructor
        void SetLeftRightAffectStrings(const String & sAffectsLeft, const String & sAffectsMiddle, const String & sAffectsRight);
        void EnableSaveCodepage(bool enable) { m_bEnableSaveCodepage = enable; }
        void SetCodepages(int codepage) { m_nLoadCodepage = m_nSaveCodepage = codepage; }
index 9567318..e19dfe0 100644 (file)
@@ -374,19 +374,19 @@ static HMENU GetSubmenu(HMENU mainMenu, UINT nIDFirstMenuItem, bool bFirstSubmen
        {
                // look for last submenu
                for (i = ::GetMenuItemCount(menu) ; i >= 0  ; i--)
-                       if (::GetSubMenu(menu, i) != NULL)
+                       if (::GetSubMenu(menu, i) != nullptr)
                                return ::GetSubMenu(menu, i);
        }
        else
        {
                // look for first submenu
                for (i = 0 ; i < ::GetMenuItemCount(menu) ; i++)
-                       if (::GetSubMenu(menu, i) != NULL)
+                       if (::GetSubMenu(menu, i) != nullptr)
                                return ::GetSubMenu(menu, i);
        }
 
        // error, submenu not found
-       return NULL;
+       return nullptr;
 }
 
 /** 
@@ -459,7 +459,7 @@ HMENU CMainFrame::NewMenu(int view, int ID)
        {
                if (menu_view == (m_MenuIcons[index].menusToApply & menu_view))
                {
-                       m_pMenus[view]->ModifyODMenu(NULL, m_MenuIcons[index].menuitemID, m_MenuIcons[index].iconResID);
+                       m_pMenus[view]->ModifyODMenu(nullptr, m_MenuIcons[index].menuitemID, m_MenuIcons[index].iconResID);
                }
        }
 
@@ -922,7 +922,7 @@ bool CMainFrame::DoFileOpen(const PathContext * pFiles /*= nullptr*/,
                pOpenDoc->m_bRecurse = bRecurse;
                if (infoUnpacker)
                        pOpenDoc->m_infoHandler = *infoUnpacker;
-               CFrameWnd *pFrame = theApp.m_pOpenTemplate->CreateNewFrame(pOpenDoc, NULL);
+               CFrameWnd *pFrame = theApp.m_pOpenTemplate->CreateNewFrame(pOpenDoc, nullptr);
                theApp.m_pOpenTemplate->InitialUpdateFrame(pFrame, pOpenDoc);
                return true;
        }
@@ -951,7 +951,7 @@ bool CMainFrame::DoFileOpen(const PathContext * pFiles /*= nullptr*/,
                }
        }
 
-       CTempPathContext *pTempPathContext = NULL;
+       CTempPathContext *pTempPathContext = nullptr;
        if (pathsType == paths::IS_EXISTING_DIR)
        {
                DecompressResult res= DecompressArchive(m_hWnd, tFiles);
@@ -972,7 +972,7 @@ bool CMainFrame::DoFileOpen(const PathContext * pFiles /*= nullptr*/,
                        CDirDoc::m_nDirsTemp = tFiles.GetSize();
                        if (m_pMenus[MENU_DIRVIEW] == nullptr)
                                theApp.m_pDirTemplate->m_hMenuShared = NewDirViewMenu();
-                       pDirDoc = static_cast<CDirDoc*>(theApp.m_pDirTemplate->OpenDocumentFile(NULL));
+                       pDirDoc = static_cast<CDirDoc*>(theApp.m_pDirTemplate->OpenDocumentFile(nullptr));
                }
                else
                {
@@ -991,7 +991,7 @@ bool CMainFrame::DoFileOpen(const PathContext * pFiles /*= nullptr*/,
 
                        pDirDoc->SetReportFile(sReportFile);
                        pDirDoc->SetDescriptions(strDesc);
-                       pDirDoc->SetTitle(NULL);
+                       pDirDoc->SetTitle(nullptr);
                        for (int nIndex = 0; nIndex < tFiles.GetSize(); nIndex++)
                                pDirDoc->SetReadOnly(nIndex, bRO[nIndex]);
 
@@ -1063,7 +1063,7 @@ void CMainFrame::OnViewSelectfont()
 {
        FRAMETYPE frame = GetFrameType(GetActiveFrame());
        CHOOSEFONT cf = { sizeof CHOOSEFONT };
-       LOGFONT *lf = NULL;
+       LOGFONT *lf = nullptr;
        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|CF_SCREENFONTS;
        if (frame == FRAME_FILE)
                cf.Flags |= CF_FIXEDPITCHONLY; // Only fixed-width fonts for merge view
@@ -1268,7 +1268,7 @@ void CMainFrame::ApplyDiffOptions()
                // Re-read MergeDoc settings (also updates view settings)
                // and rescan using new options
                pMergeDoc->RefreshOptions();
-               pMergeDoc->FlushAndRescan(TRUE);
+               pMergeDoc->FlushAndRescan(true);
        }
 }
 
@@ -1305,7 +1305,7 @@ DocClass * GetMergeDocForDiff(CMultiDocTemplate *pTemplate, CDirDoc *pDirDoc, in
 {
        // Create a new merge doc
        DocClass::m_nBuffersTemp = nFiles;
-       DocClass *pMergeDoc = static_cast<DocClass*>(pTemplate->OpenDocumentFile(NULL));
+       DocClass *pMergeDoc = static_cast<DocClass*>(pTemplate->OpenDocumentFile(nullptr));
        if (pMergeDoc != nullptr)
        {
                pDirDoc->AddMergeDoc(pMergeDoc);
@@ -1364,7 +1364,7 @@ void CMainFrame::OnDropFiles(const std::vector<String>& dropped_files)
                }
        }
 
-       DoFileOpen(&tFiles, dwFlags, NULL, _T(""), recurse);
+       DoFileOpen(&tFiles, dwFlags, nullptr, _T(""), recurse);
 }
 
 void CMainFrame::OnPluginUnpackMode(UINT nID )
@@ -1444,7 +1444,7 @@ CMergeEditView * CMainFrame::GetActiveMergeEditView()
 {
        // NB: GetActiveDocument does not return the Merge Doc 
        //     even when the merge edit view is in front
-       // NB: CChildFrame::GetActiveView returns NULL when location view active
+       // NB: CChildFrame::GetActiveView returns `nullptr` when location view active
        // So we have this rather complicated logic to try to get a merge edit view
        // We look at the front child window, which should be a frame
        // and we can get a MergeEditView from it, if it is a CChildFrame
@@ -1480,7 +1480,7 @@ void CMainFrame::UpdatePrediffersMenu()
                        int i = GetMenuItemCount(prediffersSubmenu);
                        while (i --)
                                ::DeleteMenu(prediffersSubmenu, 0, MF_BYPOSITION);
-                       ::AppendMenu(prediffersSubmenu, MF_SEPARATOR, 0, NULL);
+                       ::AppendMenu(prediffersSubmenu, MF_SEPARATOR, 0, nullptr);
                }
        }
 }
@@ -1650,7 +1650,7 @@ void CMainFrame::OnToolsFilters()
                if (bFileCompareRescan)
                {
                        for (auto pMergeDoc : GetAllMergeDocs())
-                               pMergeDoc->FlushAndRescan(TRUE);
+                               pMergeDoc->FlushAndRescan(true);
                }
                else if (bFolderCompareRescan)
                {
@@ -1912,7 +1912,7 @@ void CMainFrame::OnSaveProject()
                pOpenDoc->m_strExt = static_cast<FileFilterHelper *>(ctxt.m_piFilterGlobal)->GetFilterNameOrMask();
        }
 
-       CFrameWnd *pOpenFrame = theApp.m_pOpenTemplate->CreateNewFrame(pOpenDoc, NULL);
+       CFrameWnd *pOpenFrame = theApp.m_pOpenTemplate->CreateNewFrame(pOpenDoc, nullptr);
        theApp.m_pOpenTemplate->InitialUpdateFrame(pOpenFrame, pOpenDoc);
 }
 
@@ -2170,7 +2170,7 @@ bool CMainFrame::AskCloseConfirmation()
 void CMainFrame::OnHelpReleasenotes()
 {
        const String sPath = paths::ConcatPath(env::GetProgPath(), RelNotes);
-       ShellExecute(NULL, _T("open"), sPath.c_str(), NULL, NULL, SW_SHOWNORMAL);
+       ShellExecute(nullptr, _T("open"), sPath.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
 }
 
 /**
@@ -2179,7 +2179,7 @@ void CMainFrame::OnHelpReleasenotes()
  */
 void CMainFrame::OnHelpTranslations()
 {
-       ShellExecute(NULL, _T("open"), TranslationsUrl, NULL, NULL, SW_SHOWNORMAL);
+       ShellExecute(nullptr, _T("open"), TranslationsUrl, nullptr, nullptr, SW_SHOWNORMAL);
 }
 
 /**
@@ -2474,18 +2474,18 @@ void CMainFrame::ReloadMenu()
                if (pActiveFrame != nullptr)
                {
                        if (pActiveFrame->IsKindOf(RUNTIME_CLASS(CChildFrame)))
-                               pMainFrame->MDISetMenu(pNewMergeMenu, NULL);
+                               pMainFrame->MDISetMenu(pNewMergeMenu, nullptr);
                        else if (pActiveFrame->IsKindOf(RUNTIME_CLASS(CHexMergeFrame)))
-                               pMainFrame->MDISetMenu(pNewMergeMenu, NULL);
+                               pMainFrame->MDISetMenu(pNewMergeMenu, nullptr);
                        else if (pActiveFrame->IsKindOf(RUNTIME_CLASS(CImgMergeFrame)))
-                               pMainFrame->MDISetMenu(pNewImgMergeMenu, NULL);
+                               pMainFrame->MDISetMenu(pNewImgMergeMenu, nullptr);
                        else if (pActiveFrame->IsKindOf(RUNTIME_CLASS(CDirFrame)))
-                               pMainFrame->MDISetMenu(pNewDirMenu, NULL);
+                               pMainFrame->MDISetMenu(pNewDirMenu, nullptr);
                        else
-                               pMainFrame->MDISetMenu(pNewDefaultMenu, NULL);
+                               pMainFrame->MDISetMenu(pNewDefaultMenu, nullptr);
                }
                else
-                       pMainFrame->MDISetMenu(pNewDefaultMenu, NULL);
+                       pMainFrame->MDISetMenu(pNewDefaultMenu, nullptr);
 
                // Don't delete the old menu
                // There is a bug in BCMenu or in Windows98 : the new menu does not
index cb61599..5c7eee4 100644 (file)
@@ -212,7 +212,7 @@ BOOL CMergeApp::InitInstance()
                        for (auto& msg : cmdInfo.m_sErrorMessages)
                        {
                                String line = _T("WinMerge: ") + msg + _T("\n");
-                               WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), line.c_str(), static_cast<DWORD>(line.length()), &dwWritten, NULL);
+                               WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), line.c_str(), static_cast<DWORD>(line.length()), &dwWritten, nullptr);
                        }
                        FreeConsole();
                }
@@ -242,13 +242,13 @@ BOOL CMergeApp::InitInstance()
        // As the window class name is decorated to distinguish between ANSI and
        // UNICODE build, so will be the mutex name.
        wsprintf(szMutexName, _T("%s-%s"), CMainFrame::szClassName, szDesktopName);
-       HANDLE hMutex = CreateMutex(NULL, FALSE, szMutexName);
+       HANDLE hMutex = CreateMutex(nullptr, FALSE, szMutexName);
        if (hMutex != nullptr)
                WaitForSingleObject(hMutex, INFINITE);
        if (bSingleInstance && GetLastError() == ERROR_ALREADY_EXISTS)
        {
                // Activate previous instance and send commandline to it
-               HWND hWnd = FindWindow(CMainFrame::szClassName, NULL);
+               HWND hWnd = FindWindow(CMainFrame::szClassName, nullptr);
                if (hWnd != nullptr)
                {
                        if (IsIconic(hWnd))
@@ -256,7 +256,7 @@ BOOL CMergeApp::InitInstance()
                        SetForegroundWindow(GetLastActivePopup(hWnd));
                        LPTSTR cmdLine = GetCommandLine();
                        COPYDATASTRUCT data = { 0, (lstrlen(cmdLine) + 1) * sizeof(TCHAR), cmdLine};
-                       if (SendMessage(hWnd, WM_COPYDATA, NULL, (LPARAM)&data))
+                       if (::SendMessage(hWnd, WM_COPYDATA, NULL, (LPARAM)&data))
                        {
                                ReleaseMutex(hMutex);
                                CloseHandle(hMutex);
@@ -650,14 +650,14 @@ bool CMergeApp::ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainF
                        cmdInfo.m_dwRightFlags |= FFILEOPEN_CMDLINE;
                        DWORD dwFlags[3] = {cmdInfo.m_dwLeftFlags, cmdInfo.m_dwMiddleFlags, cmdInfo.m_dwRightFlags};
                        bCompared = pMainFrame->DoFileOpen(&cmdInfo.m_Files,
-                               dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, NULL,
+                               dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, nullptr,
                                cmdInfo.m_sPreDiffer);
                }
                else if (cmdInfo.m_Files.GetSize() > 1)
                {
                        DWORD dwFlags[3] = {cmdInfo.m_dwLeftFlags, cmdInfo.m_dwRightFlags, FFILEOPEN_NONE};
                        bCompared = pMainFrame->DoFileOpen(&cmdInfo.m_Files,
-                               dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, NULL,
+                               dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, nullptr,
                                cmdInfo.m_sPreDiffer);
                }
                else if (cmdInfo.m_Files.GetSize() == 1)
@@ -679,7 +679,7 @@ bool CMergeApp::ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainF
                        {
                                DWORD dwFlags[3] = {cmdInfo.m_dwLeftFlags, cmdInfo.m_dwRightFlags, FFILEOPEN_NONE};
                                bCompared = pMainFrame->DoFileOpen(&cmdInfo.m_Files,
-                                       dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, NULL
+                                       dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, nullptr
                                        cmdInfo.m_sPreDiffer);
                        }
                }
@@ -775,8 +775,8 @@ void CMergeApp::OpenFileToExternalEditor(const String& file, int nLineNumber/* =
        STARTUPINFO stInfo = { sizeof STARTUPINFO };
        PROCESS_INFORMATION processInfo;
 
-       retVal = !!CreateProcess(NULL, (LPTSTR)sCmd.c_str(),
-               NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE, NULL, NULL,
+       retVal = !!CreateProcess(nullptr, (LPTSTR)sCmd.c_str(),
+               nullptr, nullptr, FALSE, CREATE_DEFAULT_ERROR_MODE, nullptr, nullptr,
                &stInfo, &processInfo);
 
        if (!retVal)
@@ -798,16 +798,16 @@ void CMergeApp::OpenFileToExternalEditor(const String& file, int nLineNumber/* =
 void CMergeApp::OpenFileOrUrl(LPCTSTR szFile, LPCTSTR szUrl)
 {
        if (paths::DoesPathExist(szFile) == paths::IS_EXISTING_FILE)
-               ShellExecute(NULL, _T("open"), _T("notepad.exe"), szFile, NULL, SW_SHOWNORMAL);
+               ShellExecute(nullptr, _T("open"), _T("notepad.exe"), szFile, nullptr, SW_SHOWNORMAL);
        else
-               ShellExecute(NULL, _T("open"), szUrl, NULL, NULL, SW_SHOWNORMAL);
+               ShellExecute(nullptr, _T("open"), szUrl, nullptr, nullptr, SW_SHOWNORMAL);
 }
 
 /**
  * @brief Show Help - this is for opening help from outside mainframe.
- * @param [in] helpLocation Location inside help, if NULL main help is opened.
+ * @param [in] helpLocation Location inside help, if `nullptr` main help is opened.
  */
-void CMergeApp::ShowHelp(LPCTSTR helpLocation /*= NULL*/)
+void CMergeApp::ShowHelp(LPCTSTR helpLocation /*= nullptr*/)
 {
        String sPath = env::GetProgPath();
        LANGID LangId = GetLangId();
@@ -815,16 +815,16 @@ void CMergeApp::ShowHelp(LPCTSTR helpLocation /*= NULL*/)
        if (helpLocation == nullptr)
        {
                if (paths::DoesPathExist(sPath) == paths::IS_EXISTING_FILE)
-                       ::HtmlHelp(NULL, sPath.c_str(), HH_DISPLAY_TOC, NULL);
+                       ::HtmlHelp(nullptr, sPath.c_str(), HH_DISPLAY_TOC, NULL);
                else
-                       ShellExecute(NULL, _T("open"), DocsURL, NULL, NULL, SW_SHOWNORMAL);
+                       ShellExecute(nullptr, _T("open"), DocsURL, nullptr, nullptr, SW_SHOWNORMAL);
        }
        else
        {
                if (paths::DoesPathExist(sPath) == paths::IS_EXISTING_FILE)
                {
                        sPath += helpLocation;
-                       ::HtmlHelp(NULL, sPath.c_str(), HH_DISPLAY_TOPIC, NULL);
+                       ::HtmlHelp(nullptr, sPath.c_str(), HH_DISPLAY_TOPIC, NULL);
                }
        }
 }
@@ -1006,7 +1006,7 @@ int CMergeApp::HandleReadonlySave(String& strSavePath, bool bMultiFile,
                {
                // Overwrite read-only file
                case IDYESTOALL:
-                       bApplyToAll = TRUE;  // Don't ask again (no break here)
+                       bApplyToAll = true;  // Don't ask again (no break here)
                case IDYES:
                        CFile::GetStatus(strSavePath.c_str(), status);
                        status.m_mtime = 0;             // Avoid unwanted changes
@@ -1048,7 +1048,7 @@ int CMergeApp::HandleReadonlySave(String& strSavePath, bool bMultiFile,
 bool CMergeApp::IsProjectFile(const String& filepath) const
 {
        String ext;
-       paths::SplitFilename(filepath, NULL, NULL, &ext);
+       paths::SplitFilename(filepath, nullptr, nullptr, &ext);
        if (strutils::compare_nocase(ext, ProjectFile::PROJECTFILE_EXT) == 0)
                return true;
        else
@@ -1145,7 +1145,7 @@ 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, nullptr, sReportFile, bRecursive);
 
        AddToRecentProjectsMRU(sProject.c_str());
        return rtn;
@@ -1216,7 +1216,7 @@ void CMergeApp::AddToRecentProjectsMRU(LPCTSTR sPathName)
 {
        // sPathName will be added to the top of the MRU list. 
        // If sPathName already exists in the MRU list, it will be moved to the top
-       if (m_pRecentFileList != NULL)    {
+       if (m_pRecentFileList != nullptr)    {
                m_pRecentFileList->Add(sPathName);
                m_pRecentFileList->WriteList();
        }
index 34ffab5..86975f5 100644 (file)
@@ -94,7 +94,7 @@ public:
 
        COptionsMgr * GetMergeOptionsMgr() { return static_cast<COptionsMgr *> (m_pOptions.get()); }
        FileFilterHelper * GetGlobalFileFilter() { return m_pGlobalFileFilter.get(); }
-       void ShowHelp(LPCTSTR helpLocation = NULL);
+       void ShowHelp(LPCTSTR helpLocation = nullptr);
        void OpenFileToExternalEditor(const String& file, int nLineNumber = 1);
        void OpenFileOrUrl(LPCTSTR szFile, LPCTSTR szUrl);
        bool CreateBackup(bool bFolder, const String& pszPath);
index ce0433a..a94046c 100644 (file)
@@ -20,10 +20,10 @@ struct Merge7zFormatRegister
                for (size_t i = 0; i < Merge7zFormatRegister::optionalFormats.size(); ++i)
                {
                        Merge7z::Format* pFormat = Merge7zFormatRegister::optionalFormats[i](path);
-                       if (pFormat)
+                       if (pFormat != nullptr)
                                return pFormat;
                }
-               return NULL;
+               return nullptr;
        }
 
        static std::vector<Merge7z::Format *(*)(const String& path)> optionalFormats;
index 5875492..9a24e7d 100644 (file)
@@ -282,7 +282,7 @@ static void SaveBuffForDiff(CDiffTextBuffer & buf, const String& filepath, bool
        }
 
        // and we don't repack the file
-       PackingInfo * tempPacker = NULL;
+       PackingInfo * tempPacker = nullptr;
 
        // write buffer out to temporary file
        String sError;
@@ -1087,7 +1087,7 @@ bool CMergeDoc::ListCopy(int srcPane, int dstPane, int nDiff /* = -1*/,
        int nGroup = GetActiveMergeView()->m_nThisGroup;
        CMergeEditView *pViewSrc = m_pView[nGroup][srcPane];
        CMergeEditView *pViewDst = m_pView[nGroup][dstPane];
-       CCrystalTextView *pSource = bUpdateView ? pViewDst : NULL;
+       CCrystalTextView *pSource = bUpdateView ? pViewDst : nullptr;
 
        // suppress Rescan during this method
        // (Not only do we not want to rescan a lot of times, but
@@ -1311,7 +1311,7 @@ bool CMergeDoc::TrySaveAs(String &strPath, int &nSaveResult, String & sError,
  * Creates backup file if wanted to. And if saving to given path fails,
  * allows user to select new location/name for file.
  * @param [in] szPath Path where to save including filename. Can be
- * empty/NULL if new file is created (scratchpad) without filename.
+ * empty/`nullptr` if new file is created (scratchpad) without filename.
  * @param [out] bSaveSuccess Will contain information about save success with
  * the original name (to determine if file statuses should be changed)
  * @param [in] nBuffer Index (0-based) of buffer to save
@@ -1443,7 +1443,7 @@ bool CMergeDoc::DoSave(LPCTSTR szPath, bool &bSaveSuccess, int nBuffer)
  * Safe top-level file saving function. Asks user to select filename
  * and path. Does not create backups.
  * @param [in] szPath Path where to save including filename. Can be
- * empty/NULL if new file is created (scratchpad) without filename.
+ * empty/`nullptr` if new file is created (scratchpad) without filename.
  * @param [out] bSaveSuccess Will contain information about save success with
  * the original name (to determine if file statuses should be changed)
  * @param [in] nBuffer Index (0-based) of buffer to save
@@ -2078,7 +2078,7 @@ void CMergeDoc::PrimeTextBuffers()
 CMergeDoc::FileChange CMergeDoc::IsFileChangedOnDisk(LPCTSTR szPath, DiffFileInfo &dfi,
        bool bSave, int nBuffer)
 {
-       DiffFileInfo *fileInfo = NULL;
+       DiffFileInfo *fileInfo = nullptr;
        bool bFileChanged = false;
        bool bIgnoreSmallDiff = GetOptionsMgr()->GetBool(OPT_IGNORE_SMALL_FILETIME);
        int tolerance = 0;
@@ -2421,7 +2421,7 @@ bool CMergeDoc::IsValidCodepageForMergeEditor(unsigned cp) const
 {
        if (!cp) // 0 is our signal value for invalid
                return false;
-       return GetEncodingNameFromCodePage(cp) != NULL;
+       return GetEncodingNameFromCodePage(cp) != nullptr;
 }
 
 /**
@@ -2838,7 +2838,7 @@ void CMergeDoc::UpdateHeaderPath(int pane)
 
        pf->GetHeaderInterface()->SetText(pane, sText);
 
-       SetTitle(NULL);
+       SetTitle(nullptr);
 }
 
 /**
@@ -2987,7 +2987,7 @@ void CMergeDoc::SwapFiles()
 bool CMergeDoc::OpenWithUnpackerDialog()
 {
        // let the user choose a handler
-       CSelectUnpackerDlg dlg(m_filePaths[0], NULL);
+       CSelectUnpackerDlg dlg(m_filePaths[0], nullptr);
        // create now a new infoUnpacker to initialize the manual/automatic flag
        PackingInfo infoUnpacker(PLUGIN_AUTO);
        dlg.SetInitialInfoHandler(&infoUnpacker);
@@ -3000,7 +3000,7 @@ bool CMergeDoc::OpenWithUnpackerDialog()
                {
                        DWORD dwFlags[3] = {FFILEOPEN_NOMRU, FFILEOPEN_NOMRU, FFILEOPEN_NOMRU};
                        GetMainFrame()->DoFileOpen(&m_filePaths, dwFlags, m_strDesc, _T(""), 
-                               GetOptionsMgr()->GetBool(OPT_CMP_INCLUDE_SUBDIRS), NULL, _T(""), &infoUnpacker);
+                               GetOptionsMgr()->GetBool(OPT_CMP_INCLUDE_SUBDIRS), nullptr, _T(""), &infoUnpacker);
                        CloseNow();
                }
                else
@@ -3099,7 +3099,7 @@ void CMergeDoc::OnFileRecompareAsBinary()
 String CMergeDoc::GetFileExt(LPCTSTR sFileName, LPCTSTR sDescription) const
 {
        String sExt;
-       paths::SplitFilename(sFileName, NULL, NULL, &sExt);
+       paths::SplitFilename(sFileName, nullptr, nullptr, &sExt);
        return sExt;
 }
 
@@ -3111,7 +3111,7 @@ bool CMergeDoc::GenerateReport(const String& sFileName) const
        // calculate HTML font size
        LOGFONT lf;
        CDC dc;
-       dc.CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
+       dc.CreateDC(_T("DISPLAY"), nullptr, nullptr, nullptr);
        m_pView[0][0]->GetFont(lf);
        int nFontSize = -MulDiv (lf.lfHeight, 72, dc.GetDeviceCaps (LOGPIXELSY));
 
index c732670..47b0fd1 100644 (file)
@@ -41,7 +41,7 @@
  */
 bool CMergeDoc::DoFileEncodingDialog()
 {
-       if (!PromptAndSaveIfNeeded(TRUE))
+       if (!PromptAndSaveIfNeeded(true))
                return false;
        
        CLoadSaveCodepageDlg dlg(m_nBuffers);
index dd1a41b..02a919d 100644 (file)
@@ -53,7 +53,7 @@ public:
        // ClassWizard generated virtual function overrides
        //{{AFX_VIRTUAL(CMergeEditSplitterView)
        public:
-       virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
+       virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = nullptr);
        virtual void OnDraw(CDC* pDC);
        virtual void OnInitialUpdate();
        virtual void OnSize(UINT nType, int cx, int cy);
index 59d13c7..7f53cf5 100644 (file)
@@ -772,7 +772,7 @@ void CMergeEditView::OnDisplayDiff(int nDiff /*=0*/)
        // tell the others views about this diff (no need to call UpdateSiblingScrollPos)
        CSplitterWnd *pSplitterWnd = GetParentSplitter(this, false);
 
-       // pSplitterWnd is NULL if WinMerge started minimized.
+       // pSplitterWnd is `nullptr` if WinMerge started minimized.
        if (pSplitterWnd != nullptr)
        {
                int nRows = pSplitterWnd->GetRowCount ();
@@ -1957,7 +1957,7 @@ void CMergeEditView::OnEditOperation(int nAction, LPCTSTR pszText, size_t cchTex
                        nAction == CE_ACTION_DELETE ||
                        nAction == CE_ACTION_CUT)
                {
-                       if (!SetTimer(IDT_RESCAN, RESCAN_TIMEOUT, NULL))
+                       if (!SetTimer(IDT_RESCAN, RESCAN_TIMEOUT, nullptr))
                                pDoc->FlushAndRescan();
                }
                else
@@ -2544,7 +2544,7 @@ HMENU CMergeEditView::createPrediffersSubmenu(HMENU hMenu)
 
        // build the menu : first part, suggested plugins
        // title
-       AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
+       AppendMenu(hMenu, MF_SEPARATOR, 0, nullptr);
        AppendMenu(hMenu, MF_STRING, ID_SUGGESTED_PLUGINS, _("Suggested plugins").c_str());
 
        int ID = ID_PREDIFFERS_FIRST;   // first ID in menu
@@ -2568,7 +2568,7 @@ HMENU CMergeEditView::createPrediffersSubmenu(HMENU hMenu)
 
        // build the menu : second part, others plugins
        // title
-       AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
+       AppendMenu(hMenu, MF_SEPARATOR, 0, nullptr);
        AppendMenu(hMenu, MF_STRING, ID_NOT_SUGGESTED_PLUGINS, _("Other plugins").c_str());
 
        ID = ID_PREDIFFERS_FIRST;       // first ID in menu
@@ -2837,7 +2837,7 @@ void CMergeEditView::OnWMGoto()
        if (dlg.DoModal() == IDOK)
        {
                CMergeDoc * pDoc1 = GetDocument();
-               CMergeEditView * pCurrentView = NULL;
+               CMergeEditView * pCurrentView = nullptr;
 
                // Get views
                pCurrentView = GetGroupView(m_nThisPane);
@@ -2915,7 +2915,7 @@ void CMergeEditView::OnUpdateNoEditScripts(CCmdUI* pCmdUI)
 {
        // append the scripts submenu
        HMENU scriptsSubmenu = dynamic_cast<CMainFrame*>(AfxGetMainWnd())->GetScriptsSubmenu(AfxGetMainWnd()->GetMenu()->m_hMenu);
-       if (scriptsSubmenu != NULL)
+       if (scriptsSubmenu != nullptr)
                createScriptsSubmenu(scriptsSubmenu);
 
        pCmdUI->Enable(true);
@@ -3543,7 +3543,7 @@ int CMergeEditView::GetEmptySubLines( int nLineIndex )
                {
                        if (nLineIndex >= pView->GetLineCount())
                                return 0;
-                       pView->WrapLineCached( nLineIndex, pView->GetScreenChars(), NULL, nBreaks[nPane] );
+                       pView->WrapLineCached( nLineIndex, pView->GetScreenChars(), nullptr, nBreaks[nPane] );
                }
                nMaxBreaks = max(nMaxBreaks, nBreaks[nPane]);
        }
@@ -3743,7 +3743,7 @@ void CMergeEditView::OnUpdateViewChangeScheme(CCmdUI *pCmdUI)
 
        String name = theApp.LoadString(ID_COLORSCHEME_FIRST);
        AppendMenu(hSubMenu, MF_STRING, ID_COLORSCHEME_FIRST, name.c_str());
-       AppendMenu(hSubMenu, MF_SEPARATOR, 0, NULL);
+       AppendMenu(hSubMenu, MF_SEPARATOR, 0, nullptr);
 
        for (int i = ID_COLORSCHEME_FIRST + 1; i <= ID_COLORSCHEME_LAST; ++i)
        {
index 5749dfa..2416d0d 100644 (file)
@@ -155,7 +155,7 @@ void CMergeStatusBar::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
                dc.SetBkColor(m_cachedColors.clrWordDiff);
                dc.ExtTextOut(
                        lpDrawItemStruct->rcItem.left, lpDrawItemStruct->rcItem.top,
-                       ETO_OPAQUE, &lpDrawItemStruct->rcItem, _T(""), NULL );
+                       ETO_OPAQUE, &lpDrawItemStruct->rcItem, _T(""), nullptr );
        }
        else
        {
index 65f41e2..0ef7edf 100644 (file)
@@ -76,7 +76,7 @@ void COpenFrame::RecalcLayout(BOOL bNotify)
                        rc.top = rc.Height() - sz.cy;
 
                // This actually moves the view window
-               pView->SetWindowPos(NULL, rc.left, rc.top, sz.cx, sz.cy,
+               pView->SetWindowPos(nullptr, rc.left, rc.top, sz.cx, sz.cy,
                        SWP_NOACTIVATE|SWP_NOZORDER);
        }
 }
index 2045908..4268209 100644 (file)
@@ -371,7 +371,7 @@ void COpenView::OnLButtonDown(UINT nFlags, CPoint point)
                rc.bottom = rc.top + m_sizeOrig.cy;
                m_rectTracker.m_rect.right = m_rectTracker.m_rect.left + width;
                m_rectTracker.m_rect.bottom = m_rectTracker.m_rect.top + m_sizeOrig.cy;
-               SetWindowPos(NULL, rc.left, rc.top, rc.Width(), rc.Height(), SWP_NOZORDER);
+               SetWindowPos(nullptr, rc.left, rc.top, rc.Width(), rc.Height(), SWP_NOZORDER);
                m_constraint.UpdateSizes();
        }
 }
@@ -481,7 +481,7 @@ void COpenView::OnOK()
        }
        // If left path is a project-file, load it
        String ext;
-       paths::SplitFilename(m_strPath[0], NULL, NULL, &ext);
+       paths::SplitFilename(m_strPath[0], nullptr, nullptr, &ext);
        if (m_strPath[1].empty() && strutils::compare_nocase(ext, ProjectFile::PROJECTFILE_EXT) == 0)
                LoadProjectFile(m_strPath[0]);
 
@@ -560,7 +560,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);
+               nullptr, _T(""), pDoc->m_bRecurse, nullptr, _T(""), &tmpPackingInfo);
 }
 
 /** 
@@ -739,10 +739,10 @@ static UINT UpdateButtonStatesThread(LPVOID lpParam)
        MSG msg;
        BOOL bRet;
 
-       CoInitialize(NULL);
+       CoInitialize(nullptr);
        CAssureScriptsForThread scriptsForRescan;
 
-       while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
+       while( (bRet = GetMessage( &msg, nullptr, 0, 0 )) != 0)
        { 
                if (bRet == -1)
                        break;
@@ -763,7 +763,7 @@ static UINT UpdateButtonStatesThread(LPVOID lpParam)
                // Check if we have project file as left side path
                bool bProject = false;
                String ext;
-               paths::SplitFilename(paths[0], NULL, NULL, &ext);
+               paths::SplitFilename(paths[0], nullptr, nullptr, &ext);
                if (paths[1].empty() && strutils::compare_nocase(ext, ProjectFile::PROJECTFILE_EXT) == 0)
                        bProject = true;
 
@@ -860,7 +860,7 @@ void COpenView::UpdateButtonStates()
        if (!m_pUpdateButtonStatusThread)
        {
                m_pUpdateButtonStatusThread = AfxBeginThread(
-                       UpdateButtonStatesThread, NULL, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
+                       UpdateButtonStatesThread, nullptr, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
                m_pUpdateButtonStatusThread->m_bAutoDelete = FALSE;
                m_pUpdateButtonStatusThread->ResumeThread();
                while (PostThreadMessage(m_pUpdateButtonStatusThread->m_nThreadID, WM_NULL, 0, 0) == FALSE)
@@ -890,7 +890,7 @@ void COpenView::TerminateThreadIfRunning()
                TerminateThread(m_pUpdateButtonStatusThread->m_hThread, 0);
        }
        delete m_pUpdateButtonStatusThread;
-       m_pUpdateButtonStatusThread = NULL;
+       m_pUpdateButtonStatusThread = nullptr;
 }
 
 /**
@@ -935,7 +935,7 @@ void COpenView::OnEditEvent()
 {
        // (Re)start timer to path validity check delay
        // If timer starting fails, update buttonstates immediately
-       if (!SetTimer(IDT_CHECKFILES, CHECKFILES_TIMEOUT, NULL))
+       if (!SetTimer(IDT_CHECKFILES, CHECKFILES_TIMEOUT, nullptr))
                UpdateButtonStates();
 }
 
index 6db2df1..74d7968 100644 (file)
@@ -41,7 +41,7 @@ using std::swap;
 /** 
  * @brief Constructor, initializes members.
  */
-CPatchDlg::CPatchDlg(CWnd* pParent /*=NULL*/)
+CPatchDlg::CPatchDlg(CWnd* pParent /*= nullptr*/)
        : CTrDialog(CPatchDlg::IDD, pParent)
        , m_caseSensitive(false)
        , m_ignoreBlanks(false)
index 2d4a04f..ad25953 100644 (file)
@@ -40,7 +40,7 @@ class CPatchDlg : public CTrDialog
 {
 // Construction
 public:
-       explicit CPatchDlg(CWnd* pParent = NULL);   // standard constructor
+       explicit CPatchDlg(CWnd* pParent = nullptr);   // standard constructor
 
        // Functions to add and get selected files (as PATCHFILEs)
        void AddItem(const PATCHFILES& pf);
index 6807cd0..7506b17 100644 (file)
@@ -22,7 +22,7 @@ END_MESSAGE_MAP()
 /**
  * @brief Constructor.
  */
-PluginsListDlg::PluginsListDlg(CWnd* pParent /*=NULL*/)
+PluginsListDlg::PluginsListDlg(CWnd* pParent /*= nullptr*/)
        : CTrDialog(PluginsListDlg::IDD, pParent)
 {
 }
@@ -124,7 +124,7 @@ void PluginsListDlg::OnBnClickedOk()
 
        for (int i = 0; i < m_list.GetItemCount(); ++i)
        {
-               PluginInfo * plugin = CAllThreadsScripts::GetActiveSet()->GetPluginByName(NULL, String(m_list.GetItemText(i, 0)));
+               PluginInfo * plugin = CAllThreadsScripts::GetActiveSet()->GetPluginByName(nullptr, String(m_list.GetItemText(i, 0)));
                plugin->m_disabled = !m_list.GetCheck(i);
        }
        CAllThreadsScripts::GetActiveSet()->SaveSettings();
index 35a1465..a4f5722 100644 (file)
@@ -19,7 +19,7 @@ class PluginsListDlg : public CTrDialog
        DECLARE_DYNAMIC(PluginsListDlg)
 
 public:
-       explicit PluginsListDlg(CWnd* pParent = NULL);   // standard constructor
+       explicit PluginsListDlg(CWnd* pParent = nullptr);   // standard constructor
        virtual ~PluginsListDlg();
 
 // Dialog Data
index 5fd9277..fea0bfd 100755 (executable)
@@ -263,9 +263,9 @@ bool ProjectFile::HasSubfolders() const
  * @param [out] pReadOnly true if readonly was specified for path.
  * @return Left path.
  */
-String ProjectFile::GetLeft(bool * pReadOnly /*=NULL*/) const
+String ProjectFile::GetLeft(bool * pReadOnly /*= nullptr*/) const
 {
-       if (pReadOnly)
+       if (pReadOnly != nullptr)
                *pReadOnly = m_bLeftReadOnly;
        return m_paths.GetLeft();
 }
@@ -284,10 +284,10 @@ bool ProjectFile::GetLeftReadOnly() const
  * @param [in] sLeft Left path.
  * @param [in] bReadOnly Will path be recorded read-only?
  */
-void ProjectFile::SetLeft(const String& sLeft, const bool * pReadOnly /*=NULL*/)
+void ProjectFile::SetLeft(const String& sLeft, const bool * pReadOnly /*= nullptr*/)
 {
        m_paths.SetLeft(sLeft, false);
-       if (pReadOnly)
+       if (pReadOnly != nullptr)
                m_bLeftReadOnly = *pReadOnly;
 }
 
@@ -295,9 +295,9 @@ void ProjectFile::SetLeft(const String& sLeft, const bool * pReadOnly /*=NULL*/)
  * @brief Returns middle path.
  * @param [out] pReadOnly true if readonly was specified for path.
  */
-String ProjectFile::GetMiddle(bool * pReadOnly /*=NULL*/) const
+String ProjectFile::GetMiddle(bool * pReadOnly /*= nullptr*/) const
 {
-       if (pReadOnly)
+       if (pReadOnly != nullptr)
                *pReadOnly = m_bMiddleReadOnly;
        return m_paths.GetMiddle();
 }
@@ -315,10 +315,10 @@ bool ProjectFile::GetMiddleReadOnly() const
  * @param [in] sMiddle Middle path.
  * @param [in] bReadOnly Will path be recorded read-only?
  */
-void ProjectFile::SetMiddle(const String& sMiddle, const bool * pReadOnly /*=NULL*/)
+void ProjectFile::SetMiddle(const String& sMiddle, const bool * pReadOnly /*= nullptr*/)
 {
        m_paths.SetMiddle(sMiddle, false);
-       if (pReadOnly)
+       if (pReadOnly != nullptr)
                m_bMiddleReadOnly = *pReadOnly;
 
        return;
@@ -329,9 +329,9 @@ void ProjectFile::SetMiddle(const String& sMiddle, const bool * pReadOnly /*=NUL
  * @param [out] pReadOnly true if readonly was specified for path.
  * @return Right path.
  */
-String ProjectFile::GetRight(bool * pReadOnly /*=NULL*/) const
+String ProjectFile::GetRight(bool * pReadOnly /*= nullptr*/) const
 {
-       if (pReadOnly)
+       if (pReadOnly != nullptr)
                *pReadOnly = m_bRightReadOnly;
        return m_paths.GetRight();
 }
@@ -350,10 +350,10 @@ bool ProjectFile::GetRightReadOnly() const
  * @param [in] sRight Right path.
  * @param [in] bReadOnly Will path be recorded read-only?
  */
-void ProjectFile::SetRight(const String& sRight, const bool * pReadOnly /*=NULL*/)
+void ProjectFile::SetRight(const String& sRight, const bool * pReadOnly /*= nullptr*/)
 {
        m_paths.SetRight(sRight, false);
-       if (pReadOnly)
+       if (pReadOnly != nullptr)
                m_bRightReadOnly = *pReadOnly;
 }
 
index 3c69161..9cb5fc6 100755 (executable)
@@ -45,19 +45,19 @@ public:
        bool HasFilter() const;
        bool HasSubfolders() const;
 
-       String GetLeft(bool * pReadOnly = NULL) const;
+       String GetLeft(bool * pReadOnly = nullptr) const;
        bool GetLeftReadOnly() const;
-       String GetMiddle(bool * pReadOnly = NULL) const;
+       String GetMiddle(bool * pReadOnly = nullptr) const;
        bool GetMiddleReadOnly() const;
        String GetMiddle() const;
-       String GetRight(bool * pReadOnly = NULL) const;
+       String GetRight(bool * pReadOnly = nullptr) const;
        bool GetRightReadOnly() const;
        String GetFilter() const;
        int GetSubfolders() const;
 
-       void SetLeft(const String& sLeft, const bool * pReadOnly = NULL);
-       void SetMiddle(const String& sMiddle, const bool * pReadOnly = NULL);
-       void SetRight(const String& sRight, const bool * pReadOnly = NULL);
+       void SetLeft(const String& sLeft, const bool * pReadOnly = nullptr);
+       void SetMiddle(const String& sMiddle, const bool * pReadOnly = nullptr);
+       void SetRight(const String& sRight, const bool * pReadOnly = nullptr);
        void SetFilter(const String& sFilter);
        void SetSubfolders(bool bSubfolder);
 
index 0b34b64..370ced8 100644 (file)
@@ -110,7 +110,7 @@ BOOL PropCodepage::OnInitDialog()
        m_comboCustomCodepageValue.SetWindowText(strutils::to_str(m_nCustomCodepageValue).c_str());
 
        IExconverter *pexconv = Exconverter::getInstance();
-       if (pexconv != NULL)
+       if (pexconv != nullptr)
        {
                std::vector<CodePageInfo> cpi = pexconv->enumCodePages();
                for (size_t i = 0, j = 0; i < cpi.size(); i++)
index c2fd772..3c07009 100644 (file)
@@ -45,7 +45,7 @@ PropGeneral::PropGeneral(COptionsMgr *optionsMgr)
 , m_bScroll(false)
 , m_bSingleInstance(false)
 , m_bVerifyPaths(false)
-, m_bCloseWindowWithEsc(TRUE)
+, m_bCloseWindowWithEsc(true)
 , m_bAskMultiWindowClose(false)
 , m_nAutoCompleteSource(0)
 , m_bPreserveFiletime(false)
index 42018af..3543eed 100644 (file)
@@ -94,7 +94,7 @@ BOOL PropShell::OnInitDialog()
        AdvancedContextMenuCheck();
        UpdateData(FALSE);
 
-       SetTimer(0, 1000, NULL);
+       SetTimer(0, 1000, nullptr);
 
        return TRUE;  // return TRUE  unless you set the focus to a control
 }
index 5d19e12..73cbac2 100644 (file)
@@ -211,7 +211,7 @@ void PropTextColors::OnDefaultsStandardColors()
 
 /** 
  * @brief Enable / disable color controls on dialog.
- * @param [in] bEnable If TRUE color controls are enabled.
+ * @param [in] bEnable If `true` color controls are enabled.
  */
 void PropTextColors::EnableColorButtons(bool bEnable)
 {
index 73b80c1..e4460eb 100644 (file)
@@ -36,7 +36,7 @@ IMPLEMENT_DYNAMIC(SaveClosingDlg, CTrDialog)
  * @brief Constructor.
  * @param [in] pParent Dialog's parent window.
  */
-SaveClosingDlg::SaveClosingDlg(CWnd* pParent /*=NULL*/)
+SaveClosingDlg::SaveClosingDlg(CWnd* pParent /*= nullptr*/)
  : CTrDialog(SaveClosingDlg::IDD, pParent)
  , m_leftSave(SAVECLOSING_SAVE)
  , m_middleSave(SAVECLOSING_SAVE)
index 122f1e1..1a540a6 100644 (file)
@@ -49,7 +49,7 @@ public:
                SAVECLOSING_DISCARD,  /**< Discard changes */
        };
 
-       explicit SaveClosingDlg(CWnd* pParent = NULL);   // standard constructor
+       explicit SaveClosingDlg(CWnd* pParent = nullptr);   // standard constructor
        void DoAskFor(bool bLeft = false, bool bMiddle = false, bool bRight = false);
 
 // Dialog Data
index 5c8ce68..8d5d87b 100644 (file)
@@ -48,10 +48,10 @@ void CSelectUnpackerDlg::Initialize()
 
        // texts for the default unpackers
        noPlugin.reset(new PluginInfo);
-       noPlugin->m_lpDispatch = NULL;
+       noPlugin->m_lpDispatch = nullptr;
        noPlugin->m_name = _("<None>");
        automaticPlugin.reset(new PluginInfo);
-       automaticPlugin->m_lpDispatch = NULL;
+       automaticPlugin->m_lpDispatch = nullptr;
        automaticPlugin->m_name = _("<Automatic>");
        automaticPlugin->m_description = _("The adapted unpacker is applied to both files (one file only needs the extension)");
 
@@ -104,13 +104,13 @@ void CSelectUnpackerDlg::Initialize()
 }
 
 
-CSelectUnpackerDlg::CSelectUnpackerDlg(const String& filename, CWnd* pParent /*=NULL*/)
+CSelectUnpackerDlg::CSelectUnpackerDlg(const String& filename, CWnd* pParent /*= nullptr*/)
        : CTrDialog(CSelectUnpackerDlg::IDD, pParent), m_filteredFilenames(filename)
 {
        Initialize();
 }
 
-CSelectUnpackerDlg::CSelectUnpackerDlg(const String& filename1, const String& filename2, CWnd* pParent /*=NULL*/)
+CSelectUnpackerDlg::CSelectUnpackerDlg(const String& filename1, const String& filename2, CWnd* pParent /*= nullptr*/)
        : CTrDialog(CSelectUnpackerDlg::IDD, pParent), m_filteredFilenames(filename1 + _T("|") + filename2)
 {
        Initialize();
index 5fcd05f..f97d1dc 100644 (file)
@@ -44,8 +44,8 @@ private:
 
 public:
 // Construction
-       CSelectUnpackerDlg(const String& filename, CWnd* pParent /*=NULL*/);
-       CSelectUnpackerDlg(const String& filename1, const String& filename2, CWnd* pParent /*=NULL*/);
+       CSelectUnpackerDlg(const String& filename, CWnd* pParent /*= nullptr*/);
+       CSelectUnpackerDlg(const String& filename1, const String& filename2, CWnd* pParent /*= nullptr*/);
        ~CSelectUnpackerDlg();
 
        void SetInitialInfoHandler(PackingInfo * infoHandler);
index 3eae815..dac482c 100644 (file)
@@ -18,7 +18,7 @@
 /**
  * @brief A constructor.
  */
-CSharedFilterDlg::CSharedFilterDlg(FilterType type, CWnd* pParent /*=NULL*/)
+CSharedFilterDlg::CSharedFilterDlg(FilterType type, CWnd* pParent /*= nullptr*/)
        : CTrDialog(CSharedFilterDlg::IDD, pParent), m_selectedType(type)
 {
 }
index c75d231..d1110a7 100644 (file)
@@ -22,7 +22,7 @@ class CSharedFilterDlg : public CTrDialog
 // Construction
 public:
        enum FilterType : int { SHARED = 0, PRIVATE = 1 };
-       CSharedFilterDlg(FilterType type, CWnd* pParent = NULL);
+       CSharedFilterDlg(FilterType type, CWnd* pParent = nullptr);
        FilterType GetSelectedFilterType() const { return m_selectedType; }
 
 // Implementation
index 425d67a..ccaeae5 100644 (file)
@@ -40,8 +40,8 @@ class CTrDialog : public CDialog, public DlgUtils<CTrDialog>
        DECLARE_DYNAMIC(CTrDialog)\r
 public:\r
        CTrDialog() : CDialog() {}\r
-       CTrDialog(UINT nIDTemplate, CWnd *pParent = NULL) : CDialog(nIDTemplate, pParent) {}\r
-       CTrDialog(LPCTSTR lpszTemplateName, CWnd *pParentWnd = NULL) : CDialog(lpszTemplateName, pParentWnd) {}\r
+       CTrDialog(UINT nIDTemplate, CWnd *pParent = nullptr) : CDialog(nIDTemplate, pParent) {}\r
+       CTrDialog(LPCTSTR lpszTemplateName, CWnd *pParentWnd = nullptr) : CDialog(lpszTemplateName, pParentWnd) {}\r
 \r
        virtual BOOL OnInitDialog();\r
 };\r
index a1a5ea4..d844392 100644 (file)
@@ -193,7 +193,7 @@ static unsigned GuessEncoding_from_bytes(const String& ext, const char *src, siz
        else if (guessEncodingType & 2)
        {
                IExconverter *pexconv = Exconverter::getInstance();
-               if (pexconv && src != NULL)
+               if (pexconv != nullptr && src != nullptr)
                {
                        int autodetectType = (unsigned)guessEncodingType >> 16;
                        cp = pexconv->detectInputCodepage(autodetectType, cp, src, len);
index 11eb762..d298c75 100644 (file)
@@ -65,7 +65,7 @@ bool EndsWithSlash(const String& s)
  * - IS_EXISTING_DIR : path points to existing folder
  * - IS_EXISTING_FILE : path points to existing file
  */
-PATH_EXISTENCE DoesPathExist(const String& szPath, bool (*IsArchiveFile)(const String&))
+PATH_EXISTENCE DoesPathExist(const String& szPath, bool (*IsArchiveFile)(const String&) /*= nullptr*/)
 {
        if (szPath.empty())
                return DOES_NOT_EXIST;
@@ -237,7 +237,7 @@ String GetLongPath(const String& szPath, bool bExpandEnvs)
                _tcscpy_s(pFullPath, MAX_PATH_FULL, tPath.c_str());
 
        // We are done if this is not a short name.
-       if (_tcschr(pFullPath, _T('~')) == NULL)
+       if (_tcschr(pFullPath, _T('~')) == nullptr)
                return pFullPath;
 
        // We have to do it the hard way because GetLongPathName is not
@@ -247,7 +247,7 @@ String GetLongPath(const String& szPath, bool bExpandEnvs)
        // and leave the invalid stuff at the end.
        String sLong;
        TCHAR *ptr = pFullPath;
-       TCHAR *end = NULL;
+       TCHAR *end = nullptr;
 
        // Skip to \ position     d:\abcd or \\host\share\abcd
        // indicated by ^           ^                    ^
@@ -392,7 +392,7 @@ bool CreateIfNeeded(const String& szPath)
  *  - IS_EXISTING_FILE : both are files & exist
  *  - DOES_NOT_EXIST : in all other cases
 */
-PATH_EXISTENCE GetPairComparability(const PathContext & paths, bool (*IsArchiveFile)(const String&))
+PATH_EXISTENCE GetPairComparability(const PathContext & paths, bool (*IsArchiveFile)(const String&) /*= nullptr*/)
 {
        // fail if not both specified
        if (paths.GetSize() < 2 || paths[0].empty() || paths[1].empty())
@@ -434,7 +434,7 @@ bool IsShortcut(const String& inPath)
 {
        const TCHAR ShortcutExt[] = _T(".lnk");
        TCHAR ext[_MAX_EXT] = {0};
-       _tsplitpath_s(inPath.c_str(), NULL, 0, NULL, 0, NULL, 0, ext, _MAX_EXT);
+       _tsplitpath_s(inPath.c_str(), nullptr, 0, nullptr, 0, nullptr, 0, ext, _MAX_EXT);
        if (_tcsicmp(ext, ShortcutExt) == 0)
                return true;
        else
@@ -473,7 +473,7 @@ String ExpandShortcut(const String &inFile)
        HRESULT hres;
 
        // Create instance for shell link
-       hres = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
+       hres = ::CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER,
                IID_IShellLink, (LPVOID*) &psl);
        if (SUCCEEDED(hres))
        {
@@ -496,7 +496,7 @@ String ExpandShortcut(const String &inFile)
                        {
                                // find the path from that
                                TCHAR buf[MAX_PATH_FULL] = {0};
-                               psl->GetPath(buf, MAX_PATH_FULL, NULL, SLGP_UNCPRIORITY);
+                               psl->GetPath(buf, MAX_PATH_FULL, nullptr, SLGP_UNCPRIORITY);
                                outFile = buf;
                        }
                        ppf->Release();
@@ -687,7 +687,7 @@ void SplitFilename(const String& pathLeft, String* pPath, String* pFile, String*
                {
                        if (!ext)
                        {
-                               if (pExt)
+                               if (pExt != nullptr)
                                {
                                        (*pExt) = pszChar + 1;
                                }
@@ -700,7 +700,7 @@ void SplitFilename(const String& pathLeft, String* pPath, String* pFile, String*
                        // Ok, found last slash, so we collect any info desired
                        // and we're done
 
-                       if (pPath)
+                       if (pPath != nullptr)
                        {
                                // Grab directory (omit trailing slash)
                                size_t len = pszChar - pathLeft.c_str();
@@ -710,7 +710,7 @@ void SplitFilename(const String& pathLeft, String* pPath, String* pFile, String*
                                pPath->erase(len); // Cut rest of path
                        }
 
-                       if (pFile)
+                       if (pFile != nullptr)
                        {
                                // Grab file
                                *pFile = pszChar + 1;
@@ -721,7 +721,7 @@ void SplitFilename(const String& pathLeft, String* pPath, String* pFile, String*
        }
 
        // Never found a delimiter
-       if (pFile)
+       if (pFile != nullptr)
        {
                *pFile = pathLeft;
        }
@@ -729,7 +729,7 @@ void SplitFilename(const String& pathLeft, String* pPath, String* pFile, String*
 endSplit:
        // if both filename & extension requested, remove extension from filename
 
-       if (pFile && pExt && extptr)
+       if (pFile != nullptr && pExt != nullptr && extptr != nullptr)
        {
                size_t extlen = pend - extptr;
                pFile->erase(pFile->length() - extlen);
index f1ebcbc..04e45c4 100644 (file)
@@ -28,13 +28,13 @@ typedef enum
 
 bool EndsWithSlash(const String& s);
 
-PATH_EXISTENCE DoesPathExist(const String& szPath, bool (*IsArchiveFile)(const String&) = NULL);
+PATH_EXISTENCE DoesPathExist(const String& szPath, bool (*IsArchiveFile)(const String&) = nullptr);
 String FindFileName(const String& path);
 String FindExtension(const String& path);
 void normalize(String & sPath);
 String GetLongPath(const String& szPath, bool bExpandEnvs = true);
 bool CreateIfNeeded(const String& szPath);
-PATH_EXISTENCE GetPairComparability(const PathContext & paths, bool (*IsArchiveFile)(const String&) = NULL);
+PATH_EXISTENCE GetPairComparability(const PathContext & paths, bool (*IsArchiveFile)(const String&) = nullptr);
 bool IsDirectory(const String& path);
 bool IsShortcut(const String& inPath);
 String ExpandShortcut(const String &inFile);