Index: src/ch/AboutDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/AboutDlg.cpp (.../AboutDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/AboutDlg.cpp (.../AboutDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -29,7 +29,7 @@ bool CAboutDlg::m_bLock=false; -CAboutDlg::CAboutDlg() :ictranslate::CLanguageDialog(IDD_ABOUTBOX, NULL, &m_bLock) +CAboutDlg::CAboutDlg() :ictranslate::CLanguageDialog(IDD_ABOUTBOX, nullptr, &m_bLock) { //{{AFX_DATA_INIT(CAboutDlg) //}}AFX_DATA_INIT Index: src/ch/AppHelper.cpp =================================================================== diff -u -rffb46a396ce20cda2e04020cf01c118ae81642b5 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision ffb46a396ce20cda2e04020cf01c118ae81642b5) +++ src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -37,7 +37,7 @@ // single-instance protection m_bFirstInstance=true; - m_hMutex=NULL; + m_hMutex=nullptr; } CAppHelper::~CAppHelper() @@ -54,7 +54,7 @@ TCHAR* pszArgv = __wargv[ 0 ]; TCHAR* pszName = _tcsrchr(pszArgv, _T('\\')); - if(pszName != NULL) + if(pszName != nullptr) { // copy name m_pszProgramName = new TCHAR[ _tcslen(pszName + 1) + 1 ]; @@ -71,8 +71,8 @@ // inits mutex app protection void CAppHelper::InitProtection() { - m_hMutex=CreateMutex(NULL, TRUE, CH_MUTEX_NAME); - m_bFirstInstance=(m_hMutex != NULL && GetLastError() != ERROR_ALREADY_EXISTS); + m_hMutex=CreateMutex(nullptr, TRUE, CH_MUTEX_NAME); + m_bFirstInstance=(m_hMutex != nullptr && GetLastError() != ERROR_ALREADY_EXISTS); } void CAppHelper::RetrieveAppInfo() @@ -92,12 +92,12 @@ rStrPath += L"\\Copy Handler"; // make sure to create the required directories if they does not exist - if(!CreateDirectory(rStrPath, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) + if(!CreateDirectory(rStrPath, nullptr) && GetLastError() != ERROR_ALREADY_EXISTS) return false; } // create directory for tasks - if(!CreateDirectory(rStrPath + _T("\\Tasks"), NULL) && GetLastError() != ERROR_ALREADY_EXISTS) + if(!CreateDirectory(rStrPath + _T("\\Tasks"), nullptr) && GetLastError() != ERROR_ALREADY_EXISTS) return false; return true; @@ -131,7 +131,7 @@ bool CAppHelper::SetAutorun(bool bEnable) { // check the current key value (to avoid irritating messages from some firewall software) - HKEY hkeyRun = NULL; + HKEY hkeyRun = nullptr; CString strValue; CString strKey; DWORD dwType = REG_SZ; @@ -141,7 +141,7 @@ if(lStatus != ERROR_SUCCESS) return false; - lStatus = RegQueryValueEx(hkeyRun, m_pszAppName, NULL, &dwType, (BYTE*)strValue.GetBufferSetLength(_MAX_PATH), &dwCount); + lStatus = RegQueryValueEx(hkeyRun, m_pszAppName, nullptr, &dwType, (BYTE*)strValue.GetBufferSetLength(_MAX_PATH), &dwCount); RegCloseKey(hkeyRun); if(lStatus != ERROR_SUCCESS && lStatus != ERROR_FILE_NOT_FOUND) Index: src/ch/AsyncHttpFile.cpp =================================================================== diff -u -r6015bff29e76b4f7c4cb06d66b7b9ec9dc00d31c -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/AsyncHttpFile.cpp (.../AsyncHttpFile.cpp) (revision 6015bff29e76b4f7c4cb06d66b7b9ec9dc00d31c) +++ src/ch/AsyncHttpFile.cpp (.../AsyncHttpFile.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -31,9 +31,9 @@ /// @brief Constructs the CAsyncHttpFile object. // ============================================================================ CAsyncHttpFile::CAsyncHttpFile() : - m_hInternet(NULL), - m_hOpenUrl(NULL), - m_hFinishedEvent(NULL), + m_hInternet(nullptr), + m_hOpenUrl(nullptr), + m_hFinishedEvent(nullptr), m_dwError(ERROR_SUCCESS) { memset(&m_internetBuffers, 0, sizeof(INTERNET_BUFFERSA)); @@ -84,22 +84,22 @@ SetErrorCode(ERROR_SUCCESS); // create event - m_hFinishedEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL); + m_hFinishedEvent = ::CreateEvent(nullptr, FALSE, FALSE, nullptr); if(!m_hFinishedEvent) { SetErrorCode(GetLastError()); return E_FAIL; } - m_hInternet = ::InternetOpen(pszUserAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_ASYNC); + m_hInternet = ::InternetOpen(pszUserAgent, INTERNET_OPEN_TYPE_PRECONFIG, nullptr, nullptr, INTERNET_FLAG_ASYNC); if(!m_hInternet) { DWORD dwError = GetLastError(); ATLTRACE(L"InternetOpen failed with error: %lu\n", dwError); SetErrorCode(dwError); ::CloseHandle(m_hFinishedEvent); - m_hFinishedEvent = NULL; + m_hFinishedEvent = nullptr; return E_FAIL; } @@ -113,7 +113,7 @@ ::InternetCloseHandle(m_hInternet); ::CloseHandle(m_hFinishedEvent); - m_hFinishedEvent = NULL; + m_hFinishedEvent = nullptr; return E_FAIL; } @@ -126,12 +126,12 @@ SetErrorCode(dwError); if(GetErrorCode() != ERROR_IO_PENDING) { - ::InternetSetStatusCallback(m_hInternet, NULL); + ::InternetSetStatusCallback(m_hInternet, nullptr); ::InternetCloseHandle(m_hInternet); ::CloseHandle(m_hFinishedEvent); - m_hInternet = NULL; - m_hFinishedEvent = NULL; + m_hInternet = nullptr; + m_hFinishedEvent = nullptr; return E_FAIL; } @@ -164,7 +164,7 @@ } DWORD dwContentLengthSize = sizeof(DWORD); - if(!HttpQueryInfo(m_hOpenUrl, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &stSize, &dwContentLengthSize, NULL) || stSize == 0 || stSize > 1 * 1024UL * 1024UL) + if(!HttpQueryInfo(m_hOpenUrl, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &stSize, &dwContentLengthSize, nullptr) || stSize == 0 || stSize > 1 * 1024UL * 1024UL) { stSize = 65536; // safe fallback return S_FALSE; @@ -383,7 +383,7 @@ } case INTERNET_STATUS_CLOSING_CONNECTION: { - pRequest->pHttpFile->SetUrlHandle(NULL); + pRequest->pHttpFile->SetUrlHandle(nullptr); break; } case INTERNET_STATUS_CONNECTION_CLOSED: Index: src/ch/AsyncHttpFile.h =================================================================== diff -u -r045540c818c374806d09742ef3d7a984d8d757d3 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/AsyncHttpFile.h (.../AsyncHttpFile.h) (revision 045540c818c374806d09742ef3d7a984d8d757d3) +++ src/ch/AsyncHttpFile.h (.../AsyncHttpFile.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -71,7 +71,7 @@ bool IsClosed() const { - return m_hOpenUrl == NULL; + return m_hOpenUrl == nullptr; } protected: Index: src/ch/CDragDropComboEx.cpp =================================================================== diff -u -r926b1177cffa2face218fabb3d8af71910d1b8e5 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/CDragDropComboEx.cpp (.../CDragDropComboEx.cpp) (revision 926b1177cffa2face218fabb3d8af71910d1b8e5) +++ src/ch/CDragDropComboEx.cpp (.../CDragDropComboEx.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -34,7 +34,7 @@ void CDragDropComboEx::OnDropFiles(HDROP hDrop) { - UINT uiPathsCount = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0); + UINT uiPathsCount = DragQueryFile(hDrop, 0xFFFFFFFF, nullptr, 0); wchar_t szFilename[ MAX_PATH + 1 ]; for(UINT iIndex = 0; iIndex < uiPathsCount; ++iIndex) Index: src/ch/CDragDropListCtrl.cpp =================================================================== diff -u -r926b1177cffa2face218fabb3d8af71910d1b8e5 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/CDragDropListCtrl.cpp (.../CDragDropListCtrl.cpp) (revision 926b1177cffa2face218fabb3d8af71910d1b8e5) +++ src/ch/CDragDropListCtrl.cpp (.../CDragDropListCtrl.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -38,7 +38,7 @@ void CDragDropListCtrl::OnDropFiles(HDROP hDrop) { - UINT uiPathsCount = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0); + UINT uiPathsCount = DragQueryFile(hDrop, 0xFFFFFFFF, nullptr, 0); wchar_t szFilename[MAX_PATH + 1]; for(UINT iIndex = 0; iIndex < uiPathsCount; ++iIndex) Index: src/ch/ClipboardMonitor.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -84,10 +84,10 @@ if (uiCounter == 0 && GetPropValue(rConfig) && IsClipboardFormatAvailable(CF_HDROP)) { // get data from clipboard - OpenClipboard(NULL); + OpenClipboard(nullptr); HANDLE handle=GetClipboardData(CF_HDROP); - UINT nCount=DragQueryFile(static_cast(handle), 0xffffffff, NULL, 0); + UINT nCount=DragQueryFile(static_cast(handle), 0xffffffff, nullptr, 0); chcore::TTaskDefinition tTaskDefinition; @@ -161,12 +161,12 @@ HANDLE hToken = nullptr; TOKEN_PRIVILEGES tp = { 0 }; if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken) - && LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tp.Privileges[0].Luid)) + && LookupPrivilegeValue(nullptr, SE_SHUTDOWN_NAME, &tp.Privileges[0].Luid)) { tp.PrivilegeCount=1; tp.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED; - AdjustTokenPrivileges(hToken, FALSE, &tp, NULL, NULL, NULL); + AdjustTokenPrivileges(hToken, FALSE, &tp, 0, nullptr, nullptr); } Index: src/ch/CrashDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/CrashDlg.cpp (.../CrashDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/CrashDlg.cpp (.../CrashDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -36,7 +36,7 @@ IMPLEMENT_DYNAMIC(CCrashDlg,ictranslate::CLanguageDialog) -CCrashDlg::CCrashDlg(bool bResult, PCTSTR pszFilename, CWnd* pParent /*=NULL*/) +CCrashDlg::CCrashDlg(bool bResult, PCTSTR pszFilename, CWnd* pParent /*=nullptr*/) : CDialog(IDD_CRASH_DIALOG, pParent), m_bResult(bResult), m_strFilename(pszFilename) Index: src/ch/CrashDlg.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/CrashDlg.h (.../CrashDlg.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/CrashDlg.h (.../CrashDlg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -25,7 +25,7 @@ DECLARE_DYNAMIC(CCrashDlg) public: - CCrashDlg(bool bResult, PCTSTR pszFilename, CWnd* pParent = NULL); // standard constructor + CCrashDlg(bool bResult, PCTSTR pszFilename, CWnd* pParent = nullptr); // standard constructor virtual ~CCrashDlg(); virtual BOOL OnInitDialog(); Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -384,7 +384,7 @@ void CCustomCopyDlg::OnAddFilesButton() { - CFileDialog dlg(TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_ENABLESIZING | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_NODEREFERENCELINKS | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager().LoadString(IDS_FILEDLGALLFILTER_STRING), this); + CFileDialog dlg(TRUE, nullptr, nullptr, OFN_ALLOWMULTISELECT | OFN_ENABLESIZING | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_NODEREFERENCELINKS | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager().LoadString(IDS_FILEDLGALLFILTER_STRING), this); TCHAR *pszBuffer = new TCHAR[65535]; memset(pszBuffer, 0, 65535*sizeof(TCHAR)); @@ -425,7 +425,7 @@ while (true) { pos = m_ctlFiles.GetFirstSelectedItemPosition(); - if (pos == NULL) + if (pos == nullptr) break; else { @@ -703,7 +703,7 @@ while(true) { pos=m_ctlFilters.GetFirstSelectedItemPosition(); - if (pos == NULL) + if (pos == nullptr) break; else { @@ -716,7 +716,7 @@ void CCustomCopyDlg::OnDestroy() { - m_ctlFiles.SetImageList(NULL, LVSIL_SMALL); + m_ctlFiles.SetImageList(nullptr, LVSIL_SMALL); m_ilImages.Detach(); CLanguageDialog::OnDestroy(); @@ -753,7 +753,7 @@ void CCustomCopyDlg::OnDblclkFiltersList(NMHDR* /*pNMHDR*/, LRESULT* pResult) { POSITION pos = m_ctlFilters.GetFirstSelectedItemPosition(); - if(pos != NULL) + if(pos != nullptr) { chcore::TFileFiltersArray& afFilters = m_tTaskDefinition.GetFilters(); @@ -864,7 +864,7 @@ { boost::shared_array spBuffer; - CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager().LoadString(IDS_FLTALLFILTER_STRING)); + CFileDialog dlg(TRUE, nullptr, nullptr, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager().LoadString(IDS_FLTALLFILTER_STRING)); if(dlg.DoModal() == IDOK) { unsigned long ulSize = 0; Index: src/ch/Dialogs.cpp =================================================================== diff -u -r449a5b399ab21ca0d06050b47b264f2f704af966 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/Dialogs.cpp (.../Dialogs.cpp) (revision 449a5b399ab21ca0d06050b47b264f2f704af966) +++ src/ch/Dialogs.cpp (.../Dialogs.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -39,16 +39,16 @@ LPITEMIDLIST pidl; // Get help on BROWSEINFO struct - it's got all the bit settings. - bi.hwndOwner = NULL; - bi.pidlRoot = NULL; + bi.hwndOwner = nullptr; + bi.pidlRoot = nullptr; bi.pszDisplayName = pszBuffer; bi.lpszTitle = lpszTitle; bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS; - bi.lpfn = NULL; + bi.lpfn = nullptr; bi.lParam = 0; // This next call issues the dialog box. - if ((pidl = ::SHBrowseForFolder(&bi)) != NULL) + if ((pidl = ::SHBrowseForFolder(&bi)) != nullptr) { if (::SHGetPathFromIDList(pidl, pszBuffer)) { Index: src/ch/DirTreeCtrl.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/DirTreeCtrl.cpp (.../DirTreeCtrl.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/DirTreeCtrl.cpp (.../DirTreeCtrl.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -312,7 +312,7 @@ // compares two items int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM/* lParamSort*/) { - if (lParam1 == NULL || lParam2 == NULL) + if (lParam1 == 0 || lParam2 == 0) return 0; SHELLITEMDATA* psidl1=(SHELLITEMDATA*)lParam1, *psidl2=(SHELLITEMDATA*)lParam2; @@ -434,7 +434,7 @@ TVSORTCB tvscb = { 0 }; tvscb.hParent=hParent; tvscb.lpfnCompare=&CompareFunc; - tvscb.lParam = NULL; + tvscb.lParam = 0; if (!SortChildrenCB(&tvscb)) TRACE("SortChildren failed\n"); } @@ -816,7 +816,7 @@ tvis.item.iSelectedImage=-1; tvis.item.pszText=pszPath; tvis.item.cchTextMax=lstrlen(tvis.item.pszText); - tvis.item.lParam = NULL; + tvis.item.lParam = 0; HTREEITEM hRes=InsertItem(&tvis); Index: src/ch/DirTreeCtrl.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/DirTreeCtrl.h (.../DirTreeCtrl.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/DirTreeCtrl.h (.../DirTreeCtrl.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -86,8 +86,8 @@ LPSHELLFOLDER lpsf; // this shell folder (always exists) LPITEMIDLIST lpiidl; // this item id list relative to desktop (always exists) - LPSHELLFOLDER lpsfParent; // parent shell folder (may be NULL) - LPITEMIDLIST lpiidlRelative; // this item id list relative to the parent's lpsf (may be NULL) + LPSHELLFOLDER lpsfParent; // parent shell folder (may be nullptr) + LPITEMIDLIST lpiidlRelative; // this item id list relative to the parent's lpsf (may be nullptr) }; class CDirTreeCtrl : public CTreeCtrl Index: src/ch/FeedbackFileErrorDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/FeedbackFileErrorDlg.cpp (.../FeedbackFileErrorDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/FeedbackFileErrorDlg.cpp (.../FeedbackFileErrorDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -13,7 +13,7 @@ IMPLEMENT_DYNAMIC(CFeedbackFileErrorDlg, ictranslate::CLanguageDialog) -CFeedbackFileErrorDlg::CFeedbackFileErrorDlg(const wchar_t* pszSrcPath, const wchar_t* pszDstPath, unsigned long ulSysError, CWnd* pParent /*=NULL*/) +CFeedbackFileErrorDlg::CFeedbackFileErrorDlg(const wchar_t* pszSrcPath, const wchar_t* pszDstPath, unsigned long ulSysError, CWnd* pParent /*=nullptr*/) : ictranslate::CLanguageDialog(IDD_FEEDBACK_FILE_ERROR_DIALOG, pParent), m_bAllItems(FALSE), m_strSrcPath(pszSrcPath), Index: src/ch/FeedbackFileErrorDlg.h =================================================================== diff -u -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/FeedbackFileErrorDlg.h (.../FeedbackFileErrorDlg.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) +++ src/ch/FeedbackFileErrorDlg.h (.../FeedbackFileErrorDlg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -25,7 +25,7 @@ DECLARE_DYNAMIC(CFeedbackFileErrorDlg) public: - CFeedbackFileErrorDlg(const wchar_t* pszSrcPath, const wchar_t* pszDstPath, unsigned long ulSysError, CWnd* pParent = NULL); // standard constructor + CFeedbackFileErrorDlg(const wchar_t* pszSrcPath, const wchar_t* pszDstPath, unsigned long ulSysError, CWnd* pParent = nullptr); // standard constructor virtual ~CFeedbackFileErrorDlg(); afx_msg void OnBnClickedRetryButton(); Index: src/ch/FeedbackHandler.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/FeedbackHandler.cpp (.../FeedbackHandler.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/FeedbackHandler.cpp (.../FeedbackHandler.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -87,7 +87,7 @@ if (GetPropValue(GetConfig())) { CString strPath = GetPropValue(GetConfig()); - PlaySound(GetApp().ExpandPath(strPath), NULL, SND_FILENAME | SND_ASYNC); + PlaySound(GetApp().ExpandPath(strPath), nullptr, SND_FILENAME | SND_ASYNC); } return TFeedbackResult(eResult_Unknown, true); @@ -98,7 +98,7 @@ if (GetPropValue(GetConfig())) { CString strPath = GetPropValue(GetConfig()); - PlaySound(GetApp().ExpandPath(strPath), NULL, SND_FILENAME | SND_ASYNC); + PlaySound(GetApp().ExpandPath(strPath), nullptr, SND_FILENAME | SND_ASYNC); } return TFeedbackResult(eResult_Unknown, true); Index: src/ch/FeedbackNotEnoughSpaceDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/FeedbackNotEnoughSpaceDlg.cpp (.../FeedbackNotEnoughSpaceDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/FeedbackNotEnoughSpaceDlg.cpp (.../FeedbackNotEnoughSpaceDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -82,7 +82,7 @@ pWnd->SetWindowText(GetSizeString(m_ullRequired)); unsigned long long ullFree; pWnd=GetDlgItem(IDC_AVAILABLE_STATIC); - if (pWnd && GetDynamicFreeSpace(m_strDisk, &ullFree, NULL)) + if (pWnd && GetDynamicFreeSpace(m_strDisk, &ullFree, nullptr)) pWnd->SetWindowText(GetSizeString(ullFree)); } @@ -119,7 +119,7 @@ // format needed text UpdateDialog(); - SetTimer(1601, 1000, NULL); + SetTimer(1601, 1000, nullptr); return TRUE; } @@ -131,7 +131,7 @@ // update free space unsigned long long ullFree; CWnd *pWnd=GetDlgItem(IDC_AVAILABLE_STATIC); - if (pWnd && GetDynamicFreeSpace(m_strDisk, &ullFree, NULL)) + if (pWnd && GetDynamicFreeSpace(m_strDisk, &ullFree, nullptr)) { pWnd->SetWindowText(GetSizeString(ullFree)); Index: src/ch/FeedbackReplaceDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/FeedbackReplaceDlg.cpp (.../FeedbackReplaceDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/FeedbackReplaceDlg.cpp (.../FeedbackReplaceDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -14,7 +14,7 @@ IMPLEMENT_DYNAMIC(CFeedbackReplaceDlg, ictranslate::CLanguageDialog) -CFeedbackReplaceDlg::CFeedbackReplaceDlg(const chcore::TFileInfo& spSrcFile, const chcore::TFileInfo& spDstFile, CWnd* pParent /*=NULL*/) +CFeedbackReplaceDlg::CFeedbackReplaceDlg(const chcore::TFileInfo& spSrcFile, const chcore::TFileInfo& spDstFile, CWnd* pParent /*=nullptr*/) : ictranslate::CLanguageDialog(IDD_FEEDBACK_REPLACE_DIALOG, pParent), m_rSrcFile(spSrcFile), m_rDstFile(spDstFile), Index: src/ch/FeedbackReplaceDlg.h =================================================================== diff -u -r5d8ca703882285442606338c1acfc5fff6084e59 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/FeedbackReplaceDlg.h (.../FeedbackReplaceDlg.h) (revision 5d8ca703882285442606338c1acfc5fff6084e59) +++ src/ch/FeedbackReplaceDlg.h (.../FeedbackReplaceDlg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -24,7 +24,7 @@ DECLARE_DYNAMIC(CFeedbackReplaceDlg) public: - CFeedbackReplaceDlg(const chcore::TFileInfo& spSrcFile, const chcore::TFileInfo& spDstFile, CWnd* pParent = NULL); // standard constructor + CFeedbackReplaceDlg(const chcore::TFileInfo& spSrcFile, const chcore::TFileInfo& spDstFile, CWnd* pParent = nullptr); // standard constructor virtual ~CFeedbackReplaceDlg(); virtual BOOL OnInitDialog(); Index: src/ch/FileSupport.cpp =================================================================== diff -u -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/FileSupport.cpp (.../FileSupport.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) +++ src/ch/FileSupport.cpp (.../FileSupport.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -28,7 +28,7 @@ bool GetDynamicFreeSpace(LPCTSTR lpszPath, unsigned long long* pFree, unsigned long long* pTotal) { ULARGE_INTEGER ui64Available, ui64Total; - if(!GetDiskFreeSpaceEx(lpszPath, &ui64Available, &ui64Total, NULL)) + if(!GetDiskFreeSpaceEx(lpszPath, &ui64Available, &ui64Total, nullptr)) { if(pFree) *pFree = 0; Index: src/ch/FolderDialog.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -122,7 +122,7 @@ LRESULT CALLBACK CustomWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { int iID=GetDlgCtrlID(hwnd); - WNDPROC pfOld=NULL; + WNDPROC pfOld=nullptr; switch(iID) { case IDC_TOGGLE_BUTTON: @@ -149,11 +149,11 @@ ///////////////////////////////////////////////////////////////////////////// // CFolderDialog dialog -CFolderDialog::CFolderDialog(CWnd* /*pParent*/ /*=NULL*/) +CFolderDialog::CFolderDialog(CWnd* /*pParent*/ /*=nullptr*/) :ictranslate::CLanguageDialog() { - m_hImages=NULL; - m_hLargeImages=NULL; + m_hImages=nullptr; + m_hLargeImages=nullptr; m_bIgnoreUpdate=false; m_bIgnoreTreeRefresh=false; } @@ -580,7 +580,7 @@ { // currently selected item HTREEITEM hItem=m_ctlTree.GetSelectedItem(); - if (hItem == NULL) + if (hItem == nullptr) return; // insert child item @@ -876,7 +876,7 @@ // edit item m_ctlShortcuts.SetFocus(); - if (m_ctlShortcuts.EditLabel(iIndex) == NULL) + if (m_ctlShortcuts.EditLabel(iIndex) == nullptr) { TRACE("Couldn't edit shortcut list's item label\n"); return; @@ -914,7 +914,7 @@ NMLVDISPINFO* pdi = (NMLVDISPINFO*)pNMHDR; // editing has been cancelled - delete item - if (pdi->item.pszText == NULL) + if (pdi->item.pszText == nullptr) { m_ctlShortcuts.DeleteItem(pdi->item.iItem); m_bdData.cvShortcuts.erase(m_bdData.cvShortcuts.begin() + pdi->item.iItem); Index: src/ch/FolderDialog.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/FolderDialog.h (.../FolderDialog.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/FolderDialog.h (.../FolderDialog.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -43,7 +43,7 @@ { // Construction public: - explicit CFolderDialog(CWnd* pParent = NULL); // standard constructor + explicit CFolderDialog(CWnd* pParent = nullptr); // standard constructor virtual ~CFolderDialog(); public: Index: src/ch/MainWnd.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -98,10 +98,10 @@ wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = AfxGetInstanceHandle(); - wc.hIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(AFX_IDI_STD_FRAME)); - wc.hCursor = ::LoadCursor(NULL, IDC_ARROW); + wc.hIcon = ::LoadIcon(nullptr, MAKEINTRESOURCE(AFX_IDI_STD_FRAME)); + wc.hCursor = ::LoadCursor(nullptr, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - wc.lpszMenuName = NULL; + wc.lpszMenuName = nullptr; wc.lpszClassName = CH_WNDCLASS_NAME; return ::AfxRegisterClass(&wc); @@ -114,7 +114,7 @@ if(!bReg) return FALSE; - return CreateEx(WS_EX_TOOLWINDOW, CH_WNDCLASS_NAME, _T("Copy Handler"), WS_OVERLAPPED, 10, 10, 10, 10, NULL, (HMENU)NULL, NULL); + return CreateEx(WS_EX_TOOLWINDOW, CH_WNDCLASS_NAME, _T("Copy Handler"), WS_OVERLAPPED, 10, 10, 10, 10, nullptr, (HMENU)nullptr, nullptr); } int CMainWnd::ShowTrayIcon() @@ -292,7 +292,7 @@ if (!mMenu.Attach(hMenu)) return (LRESULT)FALSE; - if ((pSubMenu = mMenu.GetSubMenu(0)) == NULL) + if ((pSubMenu = mMenu.GetSubMenu(0)) == nullptr) return (LRESULT)FALSE; // double click received, the default action is to execute first menu item @@ -311,7 +311,7 @@ if (!mMenu.Attach(hMenu)) return (LRESULT)FALSE; - if ((pSubMenu = mMenu.GetSubMenu(0)) == NULL) + if ((pSubMenu = mMenu.GetSubMenu(0)) == nullptr) return (LRESULT)FALSE; // set menu default item @@ -371,7 +371,7 @@ m_pdlgStatus->Create(); // hide miniview if showing status - if (m_pdlgMiniView != NULL && m_pdlgMiniView->m_bLock) + if (m_pdlgMiniView != nullptr && m_pdlgMiniView->m_bLock) { if (::IsWindow(m_pdlgMiniView->m_hWnd)) m_pdlgMiniView->HideWindow(); @@ -440,7 +440,7 @@ LOG_ERROR(fmt); } - SetTimer(1023, GetPropValue(GetConfig()), NULL); + SetTimer(1023, GetPropValue(GetConfig()), nullptr); break; } case 3245: @@ -454,7 +454,7 @@ m_pdlgStatus->SendMessage(WM_UPDATESTATUS); } - SetTimer(3245, TM_AUTOREMOVE, NULL); + SetTimer(3245, TM_AUTOREMOVE, nullptr); break; case 8743: @@ -790,7 +790,7 @@ unsigned long long ullSize = 0; // retrieving free space might fail, but it's not critical - we just won't show the free space - if(bRetrieveFreeSpace && GetDynamicFreeSpace(tShortcut.m_strPath, &ullSize, NULL)) + if(bRetrieveFreeSpace && GetDynamicFreeSpace(tShortcut.m_strPath, &ullSize, nullptr)) { CString strNameFormat; strNameFormat.Format(_T("%s (%s)"), tShortcut.m_strName, GetSizeString(ullSize)); @@ -933,7 +933,7 @@ } case WM_STATUSCLOSING: { - if (m_pdlgMiniView != NULL && m_pdlgMiniView->m_bLock && ::IsWindow(m_pdlgMiniView->m_hWnd)) + if (m_pdlgMiniView != nullptr && m_pdlgMiniView->m_bLock && ::IsWindow(m_pdlgMiniView->m_hWnd)) m_pdlgMiniView->RefreshStatus(); break; @@ -1008,7 +1008,7 @@ void CMainWnd::OnPopupHelp() { - GetApp().HtmlHelp(HH_DISPLAY_TOPIC, NULL); + GetApp().HtmlHelp(HH_DISPLAY_TOPIC, 0); } void CMainWnd::OnPopupCheckForUpdates() @@ -1056,7 +1056,7 @@ } // get last check time stored in configuration - unsigned long long ullCurrentStamp = _time64(NULL); + unsigned long long ullCurrentStamp = _time64(nullptr); unsigned long long ullTimestamp = GetPropValue(GetConfig()); // perform checking for updates only when the minimal interval has passed @@ -1071,7 +1071,7 @@ chcore::TConfig& rConfig = GetConfig(); try { - SetPropValue(rConfig, _time64(NULL)); + SetPropValue(rConfig, _time64(nullptr)); rConfig.Write(); } catch(const std::exception& /*e*/) @@ -1085,8 +1085,8 @@ void CMainWnd::SetupTimers() { // start saving timer - SetTimer(1023, GetPropValue(GetConfig()), NULL); + SetTimer(1023, GetPropValue(GetConfig()), nullptr); - SetTimer(3245, TM_AUTOREMOVE, NULL); - SetTimer(8743, TM_ACCEPTING, NULL); // ends wait state in tasks + SetTimer(3245, TM_AUTOREMOVE, nullptr); + SetTimer(8743, TM_ACCEPTING, nullptr); // ends wait state in tasks } Index: src/ch/MemDC.h =================================================================== diff -u -r3432ca77e8f6d67bf0de4e0dfa36cf89705ae853 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/MemDC.h (.../MemDC.h) (revision 3432ca77e8f6d67bf0de4e0dfa36cf89705ae853) +++ src/ch/MemDC.h (.../MemDC.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -52,12 +52,12 @@ // constructor sets up the memory DC CMemDC(CDC* pDC, LPCRECT lpSrcRect) : CDC() { - ASSERT(pDC != NULL); + ASSERT(pDC != nullptr); if(!pDC) return; m_rect.CopyRect(lpSrcRect); m_pDC = pDC; - m_pOldBitmap = NULL; + m_pOldBitmap = nullptr; m_bMemDC = !pDC->IsPrinting(); if (m_bMemDC) // Create a Memory DC @@ -90,7 +90,7 @@ // All we need to do is replace the DC with an illegal value, // this keeps us from accidently deleting the handles associated with // the CDC that was passed to the constructor. - m_hDC = m_hAttribDC = NULL; + m_hDC = m_hAttribDC = nullptr; } } Index: src/ch/MiniViewDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/MiniViewDlg.cpp (.../MiniViewDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/MiniViewDlg.cpp (.../MiniViewDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -46,7 +46,7 @@ ///////////////////////////////////////////////////////////////////////////// // CMiniViewDlg dialog -CMiniViewDlg::CMiniViewDlg(chcore::TTaskManager* pTaskManager, bool *pbHide, CWnd* pParent /*=NULL*/) +CMiniViewDlg::CMiniViewDlg(chcore::TTaskManager* pTaskManager, bool *pbHide, CWnd* pParent /*=nullptr*/) :ictranslate::CLanguageDialog(IDD_MINIVIEW_DIALOG, pParent, &m_bLock), m_iLastHeight(0), m_bShown(false), @@ -132,7 +132,7 @@ RefreshStatus(); - SetTimer(9843, GetPropValue(GetConfig()), NULL); + SetTimer(9843, GetPropValue(GetConfig()), nullptr); } CLanguageDialog::OnTimer(nIDEvent); @@ -174,7 +174,7 @@ iHeight += (sg_iMargin - iYMargin); // place listbox in the best place - m_ctlStatus.SetWindowPos(NULL, iListXOffset, 0, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + m_ctlStatus.SetWindowPos(nullptr, iListXOffset, 0, 0, 0, SWP_NOZORDER | SWP_NOSIZE); // size of a dialog and screen CRect rcDialog, rcScreen; @@ -200,7 +200,7 @@ m_pTasks->GetStatsSnapshot(spTaskMgrStats); int index=0; - _PROGRESSITEM_* pItem=NULL; + _PROGRESSITEM_* pItem=nullptr; if(GetPropValue(GetConfig())) { @@ -300,7 +300,7 @@ RefreshStatus(); // set refresh timer - SetTimer(9843, GetPropValue(GetConfig()), NULL); + SetTimer(9843, GetPropValue(GetConfig()), nullptr); return static_cast(0); } @@ -659,7 +659,7 @@ void CMiniViewDlg::OnSelchangeProgressList() { RefreshStatus(); - RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME); + RedrawWindow(nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME); // PostMessage(WM_NCPAINT); } @@ -687,8 +687,8 @@ m_iIndex=i; m_bdButtons[i].bPressed=true; SetCapture(); - RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME); -// PostMessage(WM_NCPAINT, NULL, NULL); + RedrawWindow(nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME); +// PostMessage(WM_NCPAINT, nullptr, nullptr); return; } } @@ -706,9 +706,9 @@ if (m_iIndex != -1 && m_bdButtons[m_iIndex].bPressed) { m_bdButtons[m_iIndex].bPressed=false; - RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME); -// PostMessage(WM_NCPAINT, NULL, NULL); - m_bdButtons[m_iIndex].pfnCallbackFunc(this, MSG_ONCLICK, &m_bdButtons[m_iIndex], NULL); + RedrawWindow(nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME); +// PostMessage(WM_NCPAINT, nullptr, nullptr); + m_bdButtons[m_iIndex].pfnCallbackFunc(this, MSG_ONCLICK, &m_bdButtons[m_iIndex], nullptr); bProcessed=true; } @@ -723,21 +723,21 @@ BOOL CMiniViewDlg::OnNcActivate(BOOL bActive) { m_bActive=bActive != 0; - RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME); + RedrawWindow(nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME); // PostMessage(WM_NCPAINT); return TRUE/*bResult*/; } void CMiniViewDlg::OnSetfocusProgressList() { - RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME); + RedrawWindow(nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME); // PostMessage(WM_NCPAINT); } void CMiniViewDlg::OnSelcancelProgressList() { RefreshStatus(); - RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME); + RedrawWindow(nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME); // PostMessage(WM_NCPAINT); } @@ -754,15 +754,15 @@ if (!m_bdButtons[m_iIndex].bPressed) { m_bdButtons[m_iIndex].bPressed=true; - SendMessage(WM_NCPAINT, NULL, NULL); + SendMessage(WM_NCPAINT); } } else { if (m_bdButtons[m_iIndex].bPressed) { m_bdButtons[m_iIndex].bPressed=false; - SendMessage(WM_NCPAINT, NULL, NULL); + SendMessage(WM_NCPAINT); } } } Index: src/ch/MiniViewDlg.h =================================================================== diff -u -rc5252ea6f56ae2094a1f46fce4900f4e7be61a17 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/MiniViewDlg.h (.../MiniViewDlg.h) (revision c5252ea6f56ae2094a1f46fce4900f4e7be61a17) +++ src/ch/MiniViewDlg.h (.../MiniViewDlg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -51,15 +51,15 @@ // Construction public: - CMiniViewDlg(chcore::TTaskManager* pArray, bool* pbHide, CWnd* pParent = NULL); // standard constructor + CMiniViewDlg(chcore::TTaskManager* pArray, bool* pbHide, CWnd* pParent = nullptr); // standard constructor void ShowWindow(); void HideWindow(); void ResizeDialog(); - friend void OnRestartBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=NULL); - friend void OnCancelBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=NULL); - friend void OnResume(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=NULL); - friend void OnPause(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=NULL); + friend void OnRestartBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=nullptr); + friend void OnCancelBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=nullptr); + friend void OnResume(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=nullptr); + friend void OnPause(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=nullptr); friend void OnCloseBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC); void RefreshStatus(); Index: src/ch/OptionsDlg.cpp =================================================================== diff -u -rd18db617f4727a237c94b59af9b4328f829eda16 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision d18db617f4727a237c94b59af9b4328f829eda16) +++ src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -38,7 +38,7 @@ ///////////////////////////////////////////////////////////////////////////// // COptionsDlg dialog -COptionsDlg::COptionsDlg(CWnd* pParent /*=NULL*/) +COptionsDlg::COptionsDlg(CWnd* pParent /*=nullptr*/) :ictranslate::CLanguageDialog(IDD_OPTIONS_DIALOG, pParent, &m_bLock) { } Index: src/ch/OptionsDlg.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/OptionsDlg.h (.../OptionsDlg.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/OptionsDlg.h (.../OptionsDlg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -29,7 +29,7 @@ class COptionsDlg : public ictranslate::CLanguageDialog { public: - explicit COptionsDlg(CWnd* pParent = NULL); // standard constructor + explicit COptionsDlg(CWnd* pParent = nullptr); // standard constructor virtual void OnLanguageChanged(); Index: src/ch/ProgressListBox.cpp =================================================================== diff -u -r1d8d51e0dd4d8ebcf0bd457d01fab984585220c0 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/ProgressListBox.cpp (.../ProgressListBox.cpp) (revision 1d8d51e0dd4d8ebcf0bd457d01fab984585220c0) +++ src/ch/ProgressListBox.cpp (.../ProgressListBox.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -157,7 +157,7 @@ // change control size CRect rcCtl; GetClientRect(&rcCtl); - this->SetWindowPos(NULL, 0, 0, rcCtl.Width(), iCtlHeight, SWP_NOZORDER | SWP_NOMOVE); + this->SetWindowPos(nullptr, 0, 0, rcCtl.Width(), iCtlHeight, SWP_NOZORDER | SWP_NOMOVE); } void CProgressListBox::Init() Index: src/ch/PropertyListCtrl.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -184,24 +184,24 @@ m_bDeleteFont = TRUE; m_bBoldSelection = TRUE; - m_pBkBrush = NULL; - m_pBkPropertyBrush = NULL; - m_pEditWnd = NULL; - m_pFontButton = NULL; - m_pPathButton = NULL; - m_pDirButton=NULL; - m_pCustomButton=NULL; - m_pComboButton = NULL; - m_pListBox = NULL; - m_pBkHighlightBrush = NULL; - m_pSelectedFont = NULL; - m_pBorderPen = NULL; - m_pCurItem = NULL; - m_pCurFont = NULL; - m_pCurDrawItem = NULL; - m_pTextFont = NULL; - m_pSelectedFont = NULL; - m_pBorderPen = NULL; + m_pBkBrush = nullptr; + m_pBkPropertyBrush = nullptr; + m_pEditWnd = nullptr; + m_pFontButton = nullptr; + m_pPathButton = nullptr; + m_pDirButton=nullptr; + m_pCustomButton=nullptr; + m_pComboButton = nullptr; + m_pListBox = nullptr; + m_pBkHighlightBrush = nullptr; + m_pSelectedFont = nullptr; + m_pBorderPen = nullptr; + m_pCurItem = nullptr; + m_pCurFont = nullptr; + m_pCurDrawItem = nullptr; + m_pTextFont = nullptr; + m_pSelectedFont = nullptr; + m_pBorderPen = nullptr; m_crBorderColor = RGB(192,192,192); m_crBkColor = GetSysColor(COLOR_WINDOW); @@ -753,7 +753,7 @@ PROPERTYITEM* pNewItem = new PROPERTYITEM; pNewItem->nType = nType; pNewItem->nAlignment = nAlignment; - pNewItem->pBrush = NULL; + pNewItem->pBrush = nullptr; pNewItem->bComboEditable = bComboEditable; pNewItem->pfnCallback=pfnCallback; pNewItem->iParam=iParam; @@ -804,7 +804,7 @@ PROPERTYITEM* pNewItem = new PROPERTYITEM; pNewItem->nType = nType; pNewItem->nAlignment = nAlignment; - pNewItem->pBrush = NULL; + pNewItem->pBrush = nullptr; pNewItem->bComboEditable = bComboEditable; // Calculate the Width of the string based on the font set @@ -1098,7 +1098,7 @@ if(m_pCurFont) { m_pCurFont->GetLogFont(&pPropertyItem->LogFont); - m_pCurFont = NULL; + m_pCurFont = nullptr; } break; @@ -1124,13 +1124,13 @@ // Establish string and get the first token: pWord = _tcstok( pText, Separations); - while( pWord != NULL ) + while( pWord != nullptr ) { // Add this to the Array pPropertyItem->csProperties.Add(pWord); // Get next token - pWord = _tcstok( NULL, Separations ); + pWord = _tcstok( nullptr, Separations ); } // Release the buffer @@ -1250,7 +1250,7 @@ *SelectedItem = pItem->nPropertySelected; // Do they want the text - if(pText != NULL && pItem->nType == ID_PROPERTY_COMBO_LIST) + if(pText != nullptr && pItem->nType == ID_PROPERTY_COMBO_LIST) *pText = pItem->csProperties.GetAt(pItem->nPropertySelected); return true; } Index: src/ch/PropertyListCtrl.h =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/PropertyListCtrl.h (.../PropertyListCtrl.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/ch/PropertyListCtrl.h (.../PropertyListCtrl.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -170,8 +170,8 @@ bool GetProperty(int nItem, bool* bValue); bool GetProperty(int nItem, COLORREF* crColor); bool GetProperty(int nItem, LOGFONT* LogFont); - bool GetProperty(int nItem, CStringArray* pArray, int* /*SelectedItem = NULL*/); - bool GetProperty(int nItem, int* SelectedItem, CString* csText = NULL); + bool GetProperty(int nItem, CStringArray* pArray, int* /*SelectedItem = nullptr*/); + bool GetProperty(int nItem, int* SelectedItem, CString* csText = nullptr); // Overrides // ClassWizard generated virtual function overrides Index: src/ch/RecentDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/RecentDlg.cpp (.../RecentDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/RecentDlg.cpp (.../RecentDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -32,7 +32,7 @@ // CRecentDlg dialog -CRecentDlg::CRecentDlg(CWnd* pParent /*=NULL*/) +CRecentDlg::CRecentDlg(CWnd* pParent /*=nullptr*/) :ictranslate::CLanguageDialog(IDD_RECENTEDIT_DIALOG, pParent) { } Index: src/ch/RecentDlg.h =================================================================== diff -u -r8f15ad1d2f65340f4f5a30bc95f40a12b0b7dd66 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/RecentDlg.h (.../RecentDlg.h) (revision 8f15ad1d2f65340f4f5a30bc95f40a12b0b7dd66) +++ src/ch/RecentDlg.h (.../RecentDlg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -26,7 +26,7 @@ { // Construction public: - explicit CRecentDlg(CWnd* pParent = NULL); // standard constructor + explicit CRecentDlg(CWnd* pParent = nullptr); // standard constructor protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support Index: src/ch/ShortcutsDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/ShortcutsDlg.cpp (.../ShortcutsDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/ShortcutsDlg.cpp (.../ShortcutsDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -32,7 +32,7 @@ ///////////////////////////////////////////////////////////////////////////// // CShortcutsDlg dialog -CShortcutsDlg::CShortcutsDlg(CWnd* pParent /*=NULL*/) +CShortcutsDlg::CShortcutsDlg(CWnd* pParent /*=nullptr*/) :ictranslate::CLanguageDialog(IDD_SHORTCUTEDIT_DIALOG, pParent) { } Index: src/ch/ShutdownDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/ShutdownDlg.cpp (.../ShutdownDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/ShutdownDlg.cpp (.../ShutdownDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -65,7 +65,7 @@ m_ctlProgress.SetRange32(0, m_iOverallTime); // init timer - SetTimer(6678, 200, NULL); + SetTimer(6678, 200, nullptr); return TRUE; } Index: src/ch/StaticEx.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/StaticEx.cpp (.../StaticEx.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/ch/StaticEx.cpp (.../StaticEx.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -33,23 +33,23 @@ case WM_NCCREATE: { STATICEXSETTINGS* pSett=new STATICEXSETTINGS; - pSett->hFontNormal=NULL; - pSett->hFontUnderline=NULL; - pSett->pszLink=NULL; - pSett->pszText=NULL; + pSett->hFontNormal=nullptr; + pSett->hFontUnderline=nullptr; + pSett->pszLink=nullptr; + pSett->pszText=nullptr; pSett->bActive=false; pSett->bDown=false; - pSett->hLink=NULL; - pSett->hNormal=NULL; + pSett->hLink=nullptr; + pSett->hNormal=nullptr; pSett->rcText.left=0; pSett->rcText.right=0; pSett->rcText.top=0; pSett->rcText.bottom=0; ::SetWindowLongPtr(hwnd, 0, (LONG_PTR)pSett); // create cursors - pSett->hNormal=::LoadCursor(NULL, IDC_ARROW); - pSett->hLink=::LoadCursor(NULL, IDC_HAND); + pSett->hNormal=::LoadCursor(nullptr, IDC_ARROW); + pSett->hLink=::LoadCursor(nullptr, IDC_HAND); break; } @@ -59,11 +59,11 @@ const TCHAR* pSep=_tcsrchr(pcs->lpszName, _T('|')); - if (!(pcs->style & SES_LINK) || pSep == NULL || pSep-pcs->lpszName < 0) + if (!(pcs->style & SES_LINK) || pSep == nullptr || pSep-pcs->lpszName < 0) { pSettings->pszText=new TCHAR[_tcslen(pcs->lpszName)+1]; _tcscpy(pSettings->pszText, pcs->lpszName); - pSettings->pszLink=NULL; + pSettings->pszLink=nullptr; } else { @@ -119,8 +119,8 @@ } else { - pSettings->hFontNormal=NULL; - pSettings->hFontUnderline=NULL; + pSettings->hFontNormal=nullptr; + pSettings->hFontUnderline=nullptr; } break; @@ -137,11 +137,11 @@ LPCTSTR psz=(LPCTSTR)lParam; const TCHAR* pSep=_tcsrchr(psz, _T('|')); - if (!(lStyle & SES_LINK) || pSep == NULL || pSep-psz < 0) + if (!(lStyle & SES_LINK) || pSep == nullptr || pSep-psz < 0) { pSettings->pszText=new TCHAR[_tcslen(psz)+1]; _tcscpy(pSettings->pszText, psz); - pSettings->pszLink=NULL; + pSettings->pszLink=nullptr; } else { @@ -153,7 +153,7 @@ _tcscpy(pSettings->pszLink, pSep); } - ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); + ::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); break; } case WM_ERASEBKGND: @@ -170,7 +170,7 @@ HDC hdc=::CreateCompatibleDC(hDC); HBITMAP hBmp=::CreateCompatibleBitmap(hDC, ps.rcPaint.right-ps.rcPaint.left+1, ps.rcPaint.bottom-ps.rcPaint.top+1); HBITMAP hOldBitmap=(HBITMAP)::SelectObject(hdc, hBmp); - ::SetWindowOrgEx(hdc, ps.rcPaint.left, ps.rcPaint.top, NULL); + ::SetWindowOrgEx(hdc, ps.rcPaint.left, ps.rcPaint.top, nullptr); // paint the background ::FillRect(hdc, &ps.rcPaint, ::GetSysColorBrush(COLOR_BTNFACE)); @@ -259,7 +259,7 @@ { pSettings->bActive=false; ::ReleaseCapture(); - ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); + ::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); ::SetCursor(pSettings->hNormal); } @@ -269,7 +269,7 @@ if (::PtInRect(&pSettings->rcText, pt)) { pSettings->bActive=true; - ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); + ::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); ::SetCapture(hwnd); ::SetCursor(pSettings->hLink); } @@ -295,7 +295,7 @@ { TRACE("Executing %s...\n", pSettings->pszLink); - ShellExecute(NULL, _T("open"), pSettings->pszLink, NULL, NULL, SW_SHOWNORMAL); + ShellExecute(nullptr, _T("open"), pSettings->pszLink, nullptr, nullptr, SW_SHOWNORMAL); } } pSettings->bDown=false; @@ -336,10 +336,10 @@ wndcls.cbClsExtra = 0; wndcls.cbWndExtra = sizeof(STATICEXSETTINGS*); wndcls.hInstance = hInstance; - wndcls.hIcon = NULL; - wndcls.hCursor = NULL; // will load each time needed - wndcls.hbrBackground = NULL; - wndcls.lpszMenuName = NULL; + wndcls.hIcon = nullptr; + wndcls.hCursor = nullptr; // will load each time needed + wndcls.hbrBackground = nullptr; + wndcls.lpszMenuName = nullptr; wndcls.lpszClassName = STATICEX_CLASS; if (!RegisterClass(&wndcls)) Index: src/ch/StatusDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -41,7 +41,7 @@ ///////////////////////////////////////////////////////////////////////////// // CStatusDlg dialog -CStatusDlg::CStatusDlg(chcore::TTaskManager* pTasks, CWnd* pParent /*=NULL*/) +CStatusDlg::CStatusDlg(chcore::TTaskManager* pTasks, CWnd* pParent /*=nullptr*/) : ictranslate::CLanguageDialog(IDD_STATUS_DIALOG, pParent, &m_bLock), m_spTaskMgrStats(new chcore::TTaskManagerStatsSnapshot), m_pTasks(pTasks) @@ -171,7 +171,7 @@ } // refresh data timer - SetTimer(777, GetPropValue(GetConfig()), NULL); + SetTimer(777, GetPropValue(GetConfig()), nullptr); return TRUE; } @@ -221,7 +221,7 @@ RefreshStatus(); // reenable - SetTimer(777, GetPropValue(GetConfig()), NULL); + SetTimer(777, GetPropValue(GetConfig()), nullptr); } CLanguageDialog::OnTimer(nIDEvent); @@ -283,7 +283,7 @@ SystemParametersInfo(SPI_GETWORKAREA, 0, &rcScreen, 0); GetWindowRect(&rect); - SetWindowPos(NULL, rcScreen.right-rect.Width(), + SetWindowPos(nullptr, rcScreen.right-rect.Width(), rcScreen.bottom-rect.Height(), rect.Width(), rect.Height(), SWP_NOOWNERZORDER | SWP_NOZORDER); } @@ -294,7 +294,7 @@ chcore::TTaskPtr spSelectedTask = GetSelectedItemPointer(); // set status of buttons pause/resume/cancel - if (spSelectedTask != NULL) + if (spSelectedTask != nullptr) { if(spSelectedTask->GetTaskState() == chcore::eTaskState_LoadError) { @@ -360,7 +360,7 @@ } CMenu* pPopup = menu.GetSubMenu(0); - ASSERT(pPopup != NULL); + ASSERT(pPopup != nullptr); if(pPopup) { // set point in which to set menu @@ -382,7 +382,7 @@ } CMenu* pPopup = menu.GetSubMenu(0); - ASSERT(pPopup != NULL); + ASSERT(pPopup != nullptr); if(pPopup) { // set point in which to set menu @@ -402,7 +402,7 @@ // processing priority chcore::TTaskPtr spSelectedTask = GetSelectedItemPointer(); - if(spSelectedTask == NULL) + if(spSelectedTask == nullptr) return ictranslate::CLanguageDialog::OnCommand(wParam, lParam); switch (LOWORD(wParam)) @@ -442,7 +442,7 @@ // processing priority chcore::TTaskPtr spSelectedTask = GetSelectedItemPointer(); - if(spSelectedTask == NULL) + if(spSelectedTask == nullptr) return ictranslate::CLanguageDialog::OnCommand(wParam, lParam); spSelectedTask->RestoreFeedbackDefaults(); @@ -703,7 +703,7 @@ if(!spTask) return; - ULONG_PTR hResult = (ULONG_PTR)ShellExecute(this->m_hWnd, _T("open"), _T("notepad.exe"), spTask->GetLogPath().ToString(), NULL, SW_SHOWNORMAL); + ULONG_PTR hResult = (ULONG_PTR)ShellExecute(this->m_hWnd, _T("open"), _T("notepad.exe"), spTask->GetLogPath().ToString(), nullptr, SW_SHOWNORMAL); if(hResult < 32) { ictranslate::CFormat fmt(GetResManager().LoadString(IDS_SHELLEXECUTEERROR_STRING)); Index: src/ch/StatusDlg.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/StatusDlg.h (.../StatusDlg.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/StatusDlg.h (.../StatusDlg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -38,7 +38,7 @@ { // Construction public: - CStatusDlg(chcore::TTaskManager* pTasks, CWnd* pParent = NULL); // standard constructor + CStatusDlg(chcore::TTaskManager* pTasks, CWnd* pParent = nullptr); // standard constructor virtual ~CStatusDlg(); void PostCloseMessage(); Index: src/ch/TMsgBox.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/TMsgBox.cpp (.../TMsgBox.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/TMsgBox.cpp (.../TMsgBox.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -34,7 +34,7 @@ ON_WM_GETMINMAXINFO() END_MESSAGE_MAP() -TMsgBox::TMsgBox(UINT uiMsgResourceID, EButtonConfig eButtons, EIconConfig eIcon, CWnd* pParent /*= NULL*/) : +TMsgBox::TMsgBox(UINT uiMsgResourceID, EButtonConfig eButtons, EIconConfig eIcon, CWnd* pParent /*= nullptr*/) : CLanguageDialog(IDD_MSGBOX_DIALOG, pParent), m_eButtons(eButtons), m_eIcon(eIcon), @@ -46,7 +46,7 @@ m_strMessageText = GetResManager().LoadString(uiMsgResourceID); } -TMsgBox::TMsgBox(const CString& strMessage, EButtonConfig eButtons, EIconConfig eIcon, CWnd* pParent /*= NULL*/) : +TMsgBox::TMsgBox(const CString& strMessage, EButtonConfig eButtons, EIconConfig eIcon, CWnd* pParent /*= nullptr*/) : CLanguageDialog(IDD_MSGBOX_DIALOG, pParent), m_strMessageText(strMessage), m_eButtons(eButtons), @@ -216,7 +216,7 @@ m_ctlRichEdit.SetWindowText(m_strMessageText); m_ctlMeasureRichEdit.SetWindowText(m_strMessageText); - HICON hIcon = NULL; + HICON hIcon = nullptr; switch(m_eIcon) { case eIcon_Warning: @@ -320,7 +320,7 @@ iNewHeight = std::max(m_rcDialogMinSize.Height(), iNewHeight); // move window - SetWindowPos(NULL, 0, 0, iNewWidth, iNewHeight, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE); + SetWindowPos(nullptr, 0, 0, iNewWidth, iNewHeight, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE); // update richedit size m_ctlRichEdit.GetWindowRect(&m_rcRichEdit); @@ -340,7 +340,7 @@ CRect rcThis(0,0,0,0); GetWindowRect(&rcThis); - SetWindowPos(NULL, 0, 0, rcThis.Width() + iWidthDiff, rcThis.Height() + iHeightDiff + (m_iCheckBoxHeight / 2), SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE); + SetWindowPos(nullptr, 0, 0, rcThis.Width() + iWidthDiff, rcThis.Height() + iHeightDiff + (m_iCheckBoxHeight / 2), SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE); m_ctlRichEdit.SetEventMask(m_ctlRichEdit.GetEventMask() & ~ENM_REQUESTRESIZE); } @@ -401,7 +401,7 @@ return m_bCheckboxChecked; } -INT_PTR TMsgBox::MsgBox(UINT uiMsgResourceID, EButtonConfig eButtons, EIconConfig eIcon, UINT uiCheckboxResourceID /*= 0*/, bool* pbWasChecked, CWnd* pParent /*= NULL*/) +INT_PTR TMsgBox::MsgBox(UINT uiMsgResourceID, EButtonConfig eButtons, EIconConfig eIcon, UINT uiCheckboxResourceID /*= 0*/, bool* pbWasChecked, CWnd* pParent /*= nullptr*/) { TMsgBox msgBox(uiMsgResourceID, eButtons, eIcon, pParent); msgBox.SetCheckBoxMessage(uiCheckboxResourceID); @@ -411,7 +411,7 @@ return iResult; } -INT_PTR TMsgBox::MsgBox(const CString& strMessage, EButtonConfig eButtons, EIconConfig eIcon, const CString& strCheckboxText /*= CString()*/, bool* pbWasChecked, CWnd* pParent /*= NULL*/) +INT_PTR TMsgBox::MsgBox(const CString& strMessage, EButtonConfig eButtons, EIconConfig eIcon, const CString& strCheckboxText /*= CString()*/, bool* pbWasChecked, CWnd* pParent /*= nullptr*/) { TMsgBox msgBox(strMessage, eButtons, eIcon, pParent); msgBox.SetCheckBoxMessage(strCheckboxText); Index: src/ch/TMsgBox.h =================================================================== diff -u -r75318f0d3808d8d3c02dbc333c80b6d6e07fae13 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/TMsgBox.h (.../TMsgBox.h) (revision 75318f0d3808d8d3c02dbc333c80b6d6e07fae13) +++ src/ch/TMsgBox.h (.../TMsgBox.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -41,17 +41,17 @@ }; public: - TMsgBox(UINT uiMsgResourceID, EButtonConfig eButtons, EIconConfig eIcon, CWnd* pParent = NULL); - TMsgBox(const CString& strMessage, EButtonConfig eButtons, EIconConfig eIcon, CWnd* pParent = NULL); + TMsgBox(UINT uiMsgResourceID, EButtonConfig eButtons, EIconConfig eIcon, CWnd* pParent = nullptr); + TMsgBox(const CString& strMessage, EButtonConfig eButtons, EIconConfig eIcon, CWnd* pParent = nullptr); virtual ~TMsgBox(); void SetCheckBoxMessage(UINT uiMsgResourceID); void SetCheckBoxMessage(const CString& strCheckboxMessage); bool WasChecked() const; - static INT_PTR MsgBox(UINT uiMsgResourceID, EButtonConfig eButtons, EIconConfig eIcon, UINT uiCheckboxResourceID = 0, bool* pbWasChecked = NULL, CWnd* pParent = NULL); - static INT_PTR MsgBox(const CString& strMessage, EButtonConfig eButtons, EIconConfig eIcon, const CString& strCheckboxText = CString(), bool* pbWasChecked = NULL, CWnd* pParent = NULL); + static INT_PTR MsgBox(UINT uiMsgResourceID, EButtonConfig eButtons, EIconConfig eIcon, UINT uiCheckboxResourceID = 0, bool* pbWasChecked = nullptr, CWnd* pParent = nullptr); + static INT_PTR MsgBox(const CString& strMessage, EButtonConfig eButtons, EIconConfig eIcon, const CString& strCheckboxText = CString(), bool* pbWasChecked = nullptr, CWnd* pParent = nullptr); protected: virtual void DoDataExchange(CDataExchange* pDX); Index: src/ch/TPathProcessor.cpp =================================================================== diff -u -rffb46a396ce20cda2e04020cf01c118ae81642b5 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/TPathProcessor.cpp (.../TPathProcessor.cpp) (revision ffb46a396ce20cda2e04020cf01c118ae81642b5) +++ src/ch/TPathProcessor.cpp (.../TPathProcessor.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -114,7 +114,7 @@ CString TPathProcessor::GetFolderLocation(int iFolder) { LPITEMIDLIST piid = nullptr; - HRESULT hResult = SHGetSpecialFolderLocation(NULL, iFolder, &piid); + HRESULT hResult = SHGetSpecialFolderLocation(nullptr, iFolder, &piid); if(!SUCCEEDED(hResult)) return CString(); Index: src/ch/TRegistry.cpp =================================================================== diff -u -rd5fd15320ef765fd5225b10e764bca458c2e317c -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/TRegistry.cpp (.../TRegistry.cpp) (revision d5fd15320ef765fd5225b10e764bca458c2e317c) +++ src/ch/TRegistry.cpp (.../TRegistry.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -39,7 +39,7 @@ std::unique_ptr buf(new wchar_t[stMaxBuffer]); DWORD dwCount = stMaxBuffer; - LSTATUS lStatus = RegQueryValueEx(m_hKey, pszValueKey, NULL, &dwType, (BYTE*)buf.get(), &dwCount); + LSTATUS lStatus = RegQueryValueEx(m_hKey, pszValueKey, nullptr, &dwType, (BYTE*)buf.get(), &dwCount); if (lStatus != ERROR_SUCCESS) return false; @@ -54,7 +54,7 @@ DWORD dwType = REG_DWORD; DWORD dwCount = sizeof(DWORD); DWORD dwValue = 0; - LSTATUS lStatus = RegQueryValueEx(m_hKey, pszValueKey, NULL, &dwType, (BYTE*)&dwValue, &dwCount); + LSTATUS lStatus = RegQueryValueEx(m_hKey, pszValueKey, nullptr, &dwType, (BYTE*)&dwValue, &dwCount); if (lStatus != ERROR_SUCCESS) return false; Index: src/ch/TShellExtensionClient.cpp =================================================================== diff -u -r1716e3b1c975937ae6f9583f91e8940d5bc855a2 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/TShellExtensionClient.cpp (.../TShellExtensionClient.cpp) (revision 1716e3b1c975937ae6f9583f91e8940d5bc855a2) +++ src/ch/TShellExtensionClient.cpp (.../TShellExtensionClient.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -25,7 +25,7 @@ #endif TShellExtensionClient::TShellExtensionClient() : - m_piShellExtControl(NULL), + m_piShellExtControl(nullptr), m_bInitialized(false) { } @@ -41,7 +41,7 @@ if(m_bInitialized) return S_FALSE; - HRESULT hResult = CoInitializeEx(NULL, COINIT_MULTITHREADED); + HRESULT hResult = CoInitializeEx(nullptr, COINIT_MULTITHREADED); if(SUCCEEDED(hResult)) m_bInitialized = true; @@ -75,16 +75,16 @@ // if failed - try by loading extension manually (would fail on vista when running as user) if(SUCCEEDED(hResult)) { - HRESULT (STDAPICALLTYPE *pfn)(void) = NULL; + HRESULT (STDAPICALLTYPE *pfn)(void) = nullptr; HINSTANCE hMod = LoadLibrary(strPath); // load the dll - if(hMod == NULL) + if(hMod == nullptr) hResult = HRESULT_FROM_WIN32(GetLastError()); if(SUCCEEDED(hResult) && !hMod) hResult = E_FAIL; if(SUCCEEDED(hResult)) { (FARPROC&)pfn = GetProcAddress(hMod, "DllRegisterServer"); - if(pfn == NULL) + if(pfn == nullptr) hResult = E_FAIL; if(SUCCEEDED(hResult)) hResult = (*pfn)(); @@ -115,7 +115,7 @@ if(SUCCEEDED(hResult)) { - SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); + SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nullptr, nullptr); // NOTE: we are re-trying to enable the shell extension through our notification interface // in case of class-not-registered error because (it seems) system needs some time to process @@ -154,16 +154,16 @@ // if failed - try by loading extension manually (would fail on vista when running as user) if(SUCCEEDED(hResult)) { - HRESULT (STDAPICALLTYPE *pfn)(void) = NULL; + HRESULT (STDAPICALLTYPE *pfn)(void) = nullptr; HINSTANCE hMod = LoadLibrary(strPath); // load the dll - if(hMod == NULL) + if(hMod == nullptr) hResult = HRESULT_FROM_WIN32(GetLastError()); if(SUCCEEDED(hResult) && !hMod) hResult = E_FAIL; if(SUCCEEDED(hResult)) { (FARPROC&)pfn = GetProcAddress(hMod, "DllUnregisterServer"); - if(pfn == NULL) + if(pfn == nullptr) hResult = E_FAIL; if(SUCCEEDED(hResult)) hResult = (*pfn)(); @@ -193,7 +193,7 @@ } if(SUCCEEDED(hResult)) - SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); + SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nullptr, nullptr); return hResult; } @@ -203,7 +203,7 @@ rlExtensionVersion = 0; rstrExtensionStringVersion.Empty(); - BSTR bstrVersion = NULL; + BSTR bstrVersion = nullptr; HRESULT hResult = RetrieveControlInterface(); if(SUCCEEDED(hResult) && !m_piShellExtControl) @@ -238,7 +238,7 @@ { HRESULT hResult = InitializeCOM(); if(SUCCEEDED(hResult)) - hResult = CoCreateInstance(CLSID_CShellExtControl, NULL, CLSCTX_ALL, IID_IShellExtControl, (void**)&m_piShellExtControl); + hResult = CoCreateInstance(CLSID_CShellExtControl, nullptr, CLSCTX_ALL, IID_IShellExtControl, (void**)&m_piShellExtControl); if(SUCCEEDED(hResult) && !m_piShellExtControl) hResult = E_FAIL; @@ -250,6 +250,6 @@ if(m_piShellExtControl) { m_piShellExtControl->Release(); - m_piShellExtControl = NULL; + m_piShellExtControl = nullptr; } } Index: src/ch/Theme Helpers.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/Theme Helpers.cpp (.../Theme Helpers.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/Theme Helpers.cpp (.../Theme Helpers.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -38,14 +38,14 @@ { ASSERT(m_hThemesDll); if(!m_hThemesDll) - return NULL; + return nullptr; PFNOPENTHEMEDATA pfnProc=(PFNOPENTHEMEDATA)GetProcAddress(m_hThemesDll, "OpenThemeData"); if (pfnProc) return (*pfnProc)(hwnd, pszClassList); else - return NULL; + return nullptr; } HRESULT CUxThemeSupport::CloseThemeData(HTHEME hTheme) Index: src/ch/Theme Helpers.h =================================================================== diff -u -rc435ab507c8b8280264188b49e9ada56d46c0261 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/Theme Helpers.h (.../Theme Helpers.h) (revision c435ab507c8b8280264188b49e9ada56d46c0261) +++ src/ch/Theme Helpers.h (.../Theme Helpers.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -40,7 +40,7 @@ HTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList); HRESULT CloseThemeData(HTHEME hTheme); - bool IsThemeSupported() { return m_hThemesDll != NULL; }; + bool IsThemeSupported() { return m_hThemesDll != nullptr; }; BOOL IsAppThemed(); HRESULT DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pDestRect, UINT uEdge, UINT uFlags, RECT* pContentRect); Index: src/ch/ThemedButton.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/ThemedButton.cpp (.../ThemedButton.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/ThemedButton.cpp (.../ThemedButton.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -43,7 +43,7 @@ { m_bHovering=false; m_iIndex=-1; - m_pilList=NULL; + m_pilList=nullptr; } CThemedButton::~CThemedButton() @@ -76,7 +76,7 @@ HTHEME ht=uxTheme.OpenThemeData(lpDrawItemStruct->hwndItem, L"TOOLBAR"); uxTheme.DrawThemeParentBackground(lpDrawItemStruct->hwndItem, memdc.GetSafeHdc(), &rcItem); - uxTheme.DrawThemeBackground(ht, memdc.GetSafeHdc(), TP_BUTTON, bPushed ? TS_PRESSED : (m_bHovering ? TS_HOT : TS_NORMAL), &rcItem, NULL); + uxTheme.DrawThemeBackground(ht, memdc.GetSafeHdc(), TP_BUTTON, bPushed ? TS_PRESSED : (m_bHovering ? TS_HOT : TS_NORMAL), &rcItem, nullptr); uxTheme.CloseThemeData(ht); } Index: src/ch/TrayIcon.cpp =================================================================== diff -u -rc435ab507c8b8280264188b49e9ada56d46c0261 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/TrayIcon.cpp (.../TrayIcon.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) +++ src/ch/TrayIcon.cpp (.../TrayIcon.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -112,7 +112,7 @@ bool CTrayIcon::SetStandardIcon(LPCTSTR lpIconName) { - HICON hIcon=::LoadIcon(NULL, lpIconName); + HICON hIcon=::LoadIcon(nullptr, lpIconName); return SetIcon(hIcon); } Index: src/ch/UpdateChecker.cpp =================================================================== diff -u -r4572f6cddf7dab06b1de99504a6bbd3680d11e6d -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/UpdateChecker.cpp (.../UpdateChecker.cpp) (revision 4572f6cddf7dab06b1de99504a6bbd3680d11e6d) +++ src/ch/UpdateChecker.cpp (.../UpdateChecker.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -35,12 +35,12 @@ /// @brief Constructs the update checker object. // ============================================================================ CUpdateChecker::CUpdateChecker() : - m_hThread(NULL), - m_hKillEvent(NULL), + m_hThread(nullptr), + m_hKillEvent(nullptr), m_eResult(eResult_Undefined), m_eUpdateChannel(UpdateVersionInfo::eStable) { - m_hKillEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL); + m_hKillEvent = ::CreateEvent(nullptr, FALSE, FALSE, nullptr); BOOST_ASSERT(m_hKillEvent); ::InitializeCriticalSection(&m_cs); } @@ -100,7 +100,7 @@ ::ResetEvent(m_hKillEvent); - m_hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&CUpdateChecker::UpdateCheckThread, (void*)this, 0, NULL); + m_hThread = CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)&CUpdateChecker::UpdateCheckThread, (void*)this, 0, nullptr); if(!m_hThread) { Cleanup(); @@ -126,7 +126,7 @@ if (dwResult == WAIT_TIMEOUT || dwResult == WAIT_FAILED) throw std::exception("Failed to stop update checker thread."); - m_hThread = NULL; + m_hThread = nullptr; } ::ResetEvent(m_hKillEvent); Index: src/ch/UpdaterDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -28,7 +28,7 @@ IMPLEMENT_DYNAMIC(CUpdaterDlg, ictranslate::CLanguageDialog) -CUpdaterDlg::CUpdaterDlg(bool bBackgroundMode, CWnd* pParent /*=NULL*/) : +CUpdaterDlg::CUpdaterDlg(bool bBackgroundMode, CWnd* pParent /*=nullptr*/) : ictranslate::CLanguageDialog(IDD_UPDATER_DIALOG, pParent), m_eLastState(CUpdateChecker::eResult_Undefined), m_bBackgroundMode(bBackgroundMode) @@ -70,7 +70,7 @@ CheckForUpdates(); // start a timer to display progress - SetTimer(UPDATER_TIMER, 50, NULL); + SetTimer(UPDATER_TIMER, 50, nullptr); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE @@ -221,7 +221,7 @@ void CUpdaterDlg::UpdateIcon(EUpdateType eType) { - HICON hIcon = NULL; + HICON hIcon = nullptr; switch(eType) { case eIcon_Warning: Index: src/ch/UpdaterDlg.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/UpdaterDlg.h (.../UpdaterDlg.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/UpdaterDlg.h (.../UpdaterDlg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -22,7 +22,7 @@ }; public: - CUpdaterDlg(bool bBackgroundMode, CWnd* pParent = NULL); // standard constructor + CUpdaterDlg(bool bBackgroundMode, CWnd* pParent = nullptr); // standard constructor virtual ~CUpdaterDlg(); virtual BOOL OnInitDialog(); Index: src/ch/ch.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/ch.cpp (.../ch.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/ch.cpp (.../ch.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -97,7 +97,7 @@ } CCopyHandlerApp::CCopyHandlerApp() : - m_pMainWindow(NULL) + m_pMainWindow(nullptr) { // this is the one-instance application InitProtection(); @@ -109,7 +109,7 @@ { ((CMainWnd*)m_pMainWindow)->DestroyWindow(); delete m_pMainWindow; - m_pMainWnd=NULL; + m_pMainWnd=nullptr; } } @@ -158,23 +158,23 @@ { // Step1 - should not fail - prepare some more unique crash name, create under the path where ch data exists TCHAR szPath[_MAX_PATH]; - HRESULT hResult = SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, szPath); + HRESULT hResult = SHGetFolderPath(nullptr, CSIDL_LOCAL_APPDATA, nullptr, 0, szPath); if(FAILED(hResult)) _tcscpy(szPath, _T("c:\\")); CString strPath(szPath); // make sure to create the required directories if they does not exist strPath += _T("\\Copy Handler"); - CreateDirectory(strPath, NULL); + CreateDirectory(strPath, nullptr); strPath += _T("\\Dumps"); - CreateDirectory(strPath, NULL); + CreateDirectory(strPath, nullptr); // current date SYSTEMTIME st; GetLocalTime(&st); TCHAR szName[_MAX_PATH]; - _sntprintf(szName, _MAX_PATH, _T("%s\\ch_crashdump-%s-%I64u-%s.dmp"), (PCTSTR)strPath, _T(PRODUCT_VERSION), (unsigned long long)_time64(NULL), + _sntprintf(szName, _MAX_PATH, _T("%s\\ch_crashdump-%s-%I64u-%s.dmp"), (PCTSTR)strPath, _T(PRODUCT_VERSION), (unsigned long long)_time64(nullptr), #ifdef _WIN64 _T("64") #else @@ -185,15 +185,15 @@ // Step 2 - create the crash dump in case anything happens later bool bResult = false; - HANDLE hFile = CreateFile(szName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE hFile = CreateFile(szName, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); if(hFile != INVALID_HANDLE_VALUE) { MINIDUMP_EXCEPTION_INFORMATION mei; mei.ThreadId = GetCurrentThreadId(); mei.ExceptionPointers = ExceptionInfo; mei.ClientPointers = TRUE; - if(MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpWithProcessThreadData, &mei, NULL, NULL)) + if(MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpWithProcessThreadData, &mei, nullptr, nullptr)) bResult = true; } @@ -295,7 +295,7 @@ // initialize configuration file chcore::TConfig& rCfg = GetConfig(); - rCfg.ConnectToNotifier(ConfigPropertyChangedCallback, NULL); + rCfg.ConnectToNotifier(ConfigPropertyChangedCallback, nullptr); // read the configuration try @@ -327,7 +327,7 @@ // ================================= COM ======================================== LOG_INFO(_T("Initializing COM")); - HRESULT hResult = CoInitializeEx(NULL, COINIT_MULTITHREADED); + HRESULT hResult = CoInitializeEx(nullptr, COINIT_MULTITHREADED); if(FAILED(hResult)) { CString strMsg; @@ -384,7 +384,7 @@ if(m_cmdLineParser.HasCommandLineParams()) { HWND hWnd = ::FindWindow(_T("Copy Handler Wnd Class"), _T("Copy handler")); - if(hWnd == NULL) + if(hWnd == nullptr) { // cannot pass command line to running ch LOG_ERROR(_T("Cannot determine running CH's window. Cannot pass command line there.")); @@ -400,7 +400,7 @@ cds.lpData = (void*)(PCTSTR)strCmdLine; // send a message to ch - if(::SendMessage(hWnd, WM_COPYDATA, NULL, reinterpret_cast(&cds)) == 0) + if(::SendMessage(hWnd, WM_COPYDATA, 0, reinterpret_cast(&cds)) == 0) { LOG_ERROR(_T("Command line was not processed properly at the running CH's instance.")); MsgBox(IDS_COMMAND_LINE_FAILED_STRING, MB_OK | MB_ICONERROR); @@ -681,7 +681,7 @@ { // language has been changed - close the current help file if (UpdateHelpPaths()) - HtmlHelp(NULL, HH_CLOSE_ALL); + HtmlHelp(0, HH_CLOSE_ALL); } } @@ -716,11 +716,11 @@ case HH_DISPLAY_TOPIC: case HH_HELP_CONTEXT: { - HHelp(GetDesktopWindow(), NULL, nCmd, dwData); + HHelp(GetDesktopWindow(), nullptr, nCmd, dwData); break; } case HH_CLOSE_ALL: - ::HtmlHelp(NULL, NULL, HH_CLOSE_ALL, NULL); + ::HtmlHelp(nullptr, nullptr, HH_CLOSE_ALL, 0); break; case HH_DISPLAY_TEXT_POPUP: { @@ -731,9 +731,9 @@ HH_POPUP hhp; hhp.cbStruct=sizeof(HH_POPUP); - hhp.hinst=NULL; + hhp.hinst=nullptr; hhp.idString=(pHelp->dwContextId & 0xffff); - hhp.pszText=NULL; + hhp.pszText=nullptr; hhp.pt=pHelp->MousePos; hhp.pt.y+=::GetSystemMetrics(SM_CYCURSOR)/2; hhp.clrForeground=(COLORREF)-1; Index: src/ch/shortcutsdlg.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/shortcutsdlg.h (.../shortcutsdlg.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/shortcutsdlg.h (.../shortcutsdlg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -26,7 +26,7 @@ { // Construction public: - explicit CShortcutsDlg(CWnd* pParent = NULL); // standard constructor + explicit CShortcutsDlg(CWnd* pParent = nullptr); // standard constructor protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support Index: src/chext/DropMenuExt.cpp =================================================================== diff -u -rc17c4aa7bb4c96219af4191623abe40d18e02713 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/chext/DropMenuExt.cpp (.../DropMenuExt.cpp) (revision c17c4aa7bb4c96219af4191623abe40d18e02713) +++ src/chext/DropMenuExt.cpp (.../DropMenuExt.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -33,11 +33,11 @@ // CDropMenuExt CDropMenuExt::CDropMenuExt() : - m_piShellExtControl(NULL) + m_piShellExtControl(nullptr) { BOOST_LOG_FUNC(); - HRESULT hResult = CoCreateInstance(CLSID_CShellExtControl, NULL, CLSCTX_ALL, IID_IShellExtControl, (void**)&m_piShellExtControl); + HRESULT hResult = CoCreateInstance(CLSID_CShellExtControl, nullptr, CLSCTX_ALL, IID_IShellExtControl, (void**)&m_piShellExtControl); TLogger& rLogger = Logger::get(); BOOST_LOG_HRESULT(rLogger, hResult) << L"CoCreateInstance()"; @@ -48,7 +48,7 @@ if(m_piShellExtControl) { m_piShellExtControl->Release(); - m_piShellExtControl = NULL; + m_piShellExtControl = nullptr; } } @@ -81,7 +81,7 @@ // check options HWND hWnd = ShellExtensionVerifier::VerifyShellExt(m_piShellExtControl); - if(hWnd == NULL) + if(hWnd == nullptr) return E_FAIL; HRESULT hResult = ReadShellConfig(); @@ -130,7 +130,7 @@ BOOST_LOG_SEV(rLogger, debug) << L""; HWND hWnd = ShellExtensionVerifier::VerifyShellExt(m_piShellExtControl); - if(hWnd == NULL) + if(hWnd == nullptr) return E_FAIL; // find command to be executed, if not found - fail @@ -238,7 +238,7 @@ try { HWND hWnd = ShellExtensionVerifier::VerifyShellExt(m_piShellExtControl); - if(hWnd == NULL) + if(hWnd == nullptr) return E_FAIL; // get cfg from ch Index: src/chext/MenuExt.cpp =================================================================== diff -u -rb54c79b15d7c1a101c43994e9a403b07d695c8dc -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision b54c79b15d7c1a101c43994e9a403b07d695c8dc) +++ src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -50,11 +50,11 @@ ///////////////////////////////////////////////////////////////////////////// // CMenuExt CMenuExt::CMenuExt() : - m_piShellExtControl(NULL) + m_piShellExtControl(nullptr) { BOOST_LOG_FUNC(); - HRESULT hResult = CoCreateInstance(CLSID_CShellExtControl, NULL, CLSCTX_ALL, IID_IShellExtControl, (void**)&m_piShellExtControl); + HRESULT hResult = CoCreateInstance(CLSID_CShellExtControl, nullptr, CLSCTX_ALL, IID_IShellExtControl, (void**)&m_piShellExtControl); TLogger& rLogger = Logger::get(); BOOST_LOG_HRESULT(rLogger, hResult) << LOG_PARAM(m_piShellExtControl); } @@ -64,7 +64,7 @@ if(m_piShellExtControl) { m_piShellExtControl->Release(); - m_piShellExtControl = NULL; + m_piShellExtControl = nullptr; } } @@ -127,9 +127,9 @@ _tcslwr(szText); // check for texts Wytnij/Wklej/Kopiuj/Cut/Paste/Copy - if (_tcsstr(szText, _T("wytnij")) != NULL || _tcsstr(szText, _T("wklej")) != NULL || - _tcsstr(szText, _T("kopiuj")) != NULL || _tcsstr(szText, _T("cut")) != NULL || - _tcsstr(szText, _T("paste")) != NULL || _tcsstr(szText, _T("copy")) != NULL) + if (_tcsstr(szText, _T("wytnij")) != nullptr || _tcsstr(szText, _T("wklej")) != nullptr || + _tcsstr(szText, _T("kopiuj")) != nullptr || _tcsstr(szText, _T("cut")) != nullptr || + _tcsstr(szText, _T("paste")) != nullptr || _tcsstr(szText, _T("copy")) != nullptr) { // found - find the nearest bar and insert above for (int j=i+1;jitemState & ODS_SELECTED) { SetTextColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); @@ -395,7 +395,7 @@ try { HWND hWnd = ShellExtensionVerifier::VerifyShellExt(m_piShellExtControl); - if(hWnd == NULL) + if(hWnd == nullptr) return E_FAIL; // get cfg from ch Index: src/chext/ShellExtControl.cpp =================================================================== diff -u -r6c67d46c243c6a275f2a427c991f82db59c63ef0 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/chext/ShellExtControl.cpp (.../ShellExtControl.cpp) (revision 6c67d46c243c6a275f2a427c991f82db59c63ef0) +++ src/chext/ShellExtControl.cpp (.../ShellExtControl.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -24,17 +24,17 @@ #include "TLogger.h" CShellExtControl::CShellExtControl() : - m_pShellExtData(NULL), - m_hMemory(NULL), - m_hMutex(NULL) + m_pShellExtData(nullptr), + m_hMemory(nullptr), + m_hMutex(nullptr) { BOOST_LOG_FUNC(); TLogger& rLogger = Logger::get(); BOOST_LOG_SEV(rLogger, debug) << L""; // create protection mutex - m_hMutex = ::CreateMutex(NULL, FALSE, _T("CHShellExtControlDataMutex")); + m_hMutex = ::CreateMutex(nullptr, FALSE, _T("CHShellExtControlDataMutex")); if(!m_hMutex) { BOOST_LOG_SEV(rLogger, error) << L"Cannot create mutex."; @@ -50,7 +50,7 @@ } // memory mapped file - m_hMemory = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(SHELLEXT_DATA), _T("CHShellExtControlData")); // name of map object + m_hMemory = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, sizeof(SHELLEXT_DATA), _T("CHShellExtControlData")); // name of map object DWORD dwLastError = GetLastError(); // NOTE: last error is needed also for success case (for already exists status) if(!m_hMemory) { @@ -69,7 +69,7 @@ ReleaseMutex(m_hMutex); CloseHandle(m_hMutex); CloseHandle(m_hMemory); - m_hMemory = NULL; + m_hMemory = nullptr; return; } Index: src/chext/ShellExtensionVerifier.cpp =================================================================== diff -u -rb79aca0d66b1084f230022efe39cc89307482e6d -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/chext/ShellExtensionVerifier.cpp (.../ShellExtensionVerifier.cpp) (revision b79aca0d66b1084f230022efe39cc89307482e6d) +++ src/chext/ShellExtensionVerifier.cpp (.../ShellExtensionVerifier.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -28,15 +28,15 @@ if(FAILED(hResult) || hResult == S_FALSE) { BOOST_LOG_SEV(rLogger, debug) << L"Shell extension is disabled."; - return NULL; + return nullptr; } // find CH's window HWND hWnd = ::FindWindow(_T("Copy Handler Wnd Class"), _T("Copy handler")); if(!hWnd) { BOOST_LOG_SEV(rLogger, debug) << L"Cannot find Copy Handler's window."; - return NULL; + return nullptr; } return hWnd; Index: src/chext/ShellPathsHelpers.cpp =================================================================== diff -u -ra13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/chext/ShellPathsHelpers.cpp (.../ShellPathsHelpers.cpp) (revision a13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0) +++ src/chext/ShellPathsHelpers.cpp (.../ShellPathsHelpers.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -50,7 +50,7 @@ tPathContainer.Clear(); // get clipboard data - UINT uiFilesCount = DragQueryFile(hDrop, 0xffffffff, NULL, 0); + UINT uiFilesCount = DragQueryFile(hDrop, 0xffffffff, nullptr, 0); const size_t stMaxPathLength = 32768; TCHAR szPath[stMaxPathLength]; @@ -75,7 +75,7 @@ // retrieve some informations from the data object STGMEDIUM medium; - FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; + FORMATETC fe = { CF_HDROP, nullptr, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; // retrieve the CF_HDROP-type data from data object HRESULT hResult = piDataObject->QueryGetData(&fe); Index: src/chext/TContextMenuHandler.cpp =================================================================== diff -u -rb54c79b15d7c1a101c43994e9a403b07d695c8dc -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/chext/TContextMenuHandler.cpp (.../TContextMenuHandler.cpp) (revision b54c79b15d7c1a101c43994e9a403b07d695c8dc) +++ src/chext/TContextMenuHandler.cpp (.../TContextMenuHandler.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -77,7 +77,7 @@ } case TShellMenuItem::eSeparatorItem: { - ::InsertMenu(hMenu, uiFirstItemPosition++, MF_BYPOSITION | MF_SEPARATOR, m_uiNextMenuID++, NULL); + ::InsertMenu(hMenu, uiFirstItemPosition++, MF_BYPOSITION | MF_SEPARATOR, m_uiNextMenuID++, nullptr); break; } case TShellMenuItem::eStandardItem: Index: src/chext/TLogger.cpp =================================================================== diff -u -r3d1de44762647618faf9b5b3a87f89b293899d8d -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/chext/TLogger.cpp (.../TLogger.cpp) (revision 3d1de44762647618faf9b5b3a87f89b293899d8d) +++ src/chext/TLogger.cpp (.../TLogger.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -49,7 +49,7 @@ bool ReadLoggerConfig(LoggerInfo& rInfo) { - HKEY hKeyShellExt = NULL; + HKEY hKeyShellExt = nullptr; LSTATUS lStatus = RegOpenKeyEx(HKEY_CURRENT_USER, _T("SOFTWARE\\CopyHandler\\ShellExtension"), 0, KEY_QUERY_VALUE, &hKeyShellExt); if(lStatus != ERROR_SUCCESS) return false; @@ -60,7 +60,7 @@ std::unique_ptr buf(new wchar_t[stMaxBuffer]); DWORD dwCount = stMaxBuffer; - lStatus = RegQueryValueEx(hKeyShellExt, L"LogPath", NULL, &dwType, (BYTE*)buf.get(), &dwCount); + lStatus = RegQueryValueEx(hKeyShellExt, L"LogPath", nullptr, &dwType, (BYTE*)buf.get(), &dwCount); if(lStatus != ERROR_SUCCESS) { RegCloseKey(hKeyShellExt); @@ -74,7 +74,7 @@ dwType = REG_DWORD; dwCount = sizeof(DWORD); DWORD dwValue = 0; - lStatus = RegQueryValueEx(hKeyShellExt, L"MinLogLevel", NULL, &dwType, (BYTE*)&dwValue, &dwCount); + lStatus = RegQueryValueEx(hKeyShellExt, L"MinLogLevel", nullptr, &dwType, (BYTE*)&dwValue, &dwCount); if(lStatus != ERROR_SUCCESS) { RegCloseKey(hKeyShellExt); Index: src/chext/TShellExtData.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/chext/TShellExtData.cpp (.../TShellExtData.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/chext/TShellExtData.cpp (.../TShellExtData.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -70,7 +70,7 @@ ReadKeyboardState(); // experimentally deduced condition - m_bFolderBackground = (piDataObject == NULL) && (pidlFolder != NULL); + m_bFolderBackground = (piDataObject == nullptr) && (pidlFolder != nullptr); } return hResult; @@ -467,7 +467,7 @@ if(!uiPreferredDropEffect) return E_FAIL; - FORMATETC fe = { (CLIPFORMAT)uiPreferredDropEffect, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; + FORMATETC fe = { (CLIPFORMAT)uiPreferredDropEffect, nullptr, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; // if the drop effect does not exist - just report it m_dwIDataObjectDropEffect = 0; @@ -504,7 +504,7 @@ if(IsClipboardFormatAvailable(CF_HDROP)) { // read paths from clipboard - if(!OpenClipboard(NULL)) + if(!OpenClipboard(nullptr)) return E_FAIL; HANDLE hClipboardData = GetClipboardData(CF_HDROP); @@ -555,7 +555,7 @@ // it's none by default m_eDefaultSystemMenuAction = eAction_None; - BOOST_ASSERT(hMenu != NULL); + BOOST_ASSERT(hMenu != nullptr); if(hMenu) { MENUITEMINFO mii; Index: src/chext/chext.cpp =================================================================== diff -u -r4572f6cddf7dab06b1de99504a6bbd3680d11e6d -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/chext/chext.cpp (.../chext.cpp) (revision 4572f6cddf7dab06b1de99504a6bbd3680d11e6d) +++ src/chext/chext.cpp (.../chext.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -108,7 +108,7 @@ HRESULT hr = E_FAIL; static const wchar_t szUserSwitch[] = _T("user"); - if (pszCmdLine != NULL) + if (pszCmdLine != nullptr) { if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) == 0) AtlSetPerUserRegistration(true); Index: src/chext/dllmain.cpp =================================================================== diff -u -r4572f6cddf7dab06b1de99504a6bbd3680d11e6d -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/chext/dllmain.cpp (.../dllmain.cpp) (revision 4572f6cddf7dab06b1de99504a6bbd3680d11e6d) +++ src/chext/dllmain.cpp (.../dllmain.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "resource.h" #include "chext.h" #include "dllmain.h" #include "MenuExt.h" Index: src/common/TShellExtMenuConfig.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/common/TShellExtMenuConfig.cpp (.../TShellExtMenuConfig.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/common/TShellExtMenuConfig.cpp (.../TShellExtMenuConfig.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -389,7 +389,7 @@ chcore::TConfig& rCfg = vCfgs.GetAt(stIndex); TShellMenuItemPtr spItem(std::make_shared()); - spItem->ReadFromConfig(rCfg, NULL); + spItem->ReadFromConfig(rCfg, nullptr); m_vChildItems.push_back(spItem); } } Index: src/ictranslate/ICTranslateDlg.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ictranslate/ICTranslateDlg.cpp (.../ICTranslateDlg.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ictranslate/ICTranslateDlg.cpp (.../ICTranslateDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -71,9 +71,9 @@ -CICTranslateDlg::CICTranslateDlg(CWnd* pParent /*=NULL*/) +CICTranslateDlg::CICTranslateDlg(CWnd* pParent /*=nullptr*/) : CDialog(IDD_ICTRANSLATE_DIALOG, pParent), - m_hAccel(NULL) + m_hAccel(nullptr) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } @@ -139,7 +139,7 @@ ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); - if (pSysMenu != NULL) + if (pSysMenu != nullptr) { CString strAboutMenu; if(strAboutMenu.LoadString(IDS_ABOUTBOX)) @@ -446,7 +446,7 @@ // add texts to the list m_ctlBaseLanguageList.DeleteAllItems(); m_ldBase.EnumStrings(&EnumLngStrings, &m_ctlBaseLanguageList); - m_ctlBaseLanguageList.SortItems(&ListSortFunc, NULL); + m_ctlBaseLanguageList.SortItems(&ListSortFunc, 0); UpdateCustomListImages(); } @@ -507,7 +507,7 @@ m_ctlCustomLanguageList.SetItem(&lvi); } } - m_ctlCustomLanguageList.SortItems(&ListSortFunc, NULL); + m_ctlCustomLanguageList.SortItems(&ListSortFunc, 0); UpdateCustomListImages(); } @@ -768,7 +768,7 @@ try { - m_ldCustom.WriteTranslation(NULL); + m_ldCustom.WriteTranslation(nullptr); } catch(const std::exception& e) { Index: src/ictranslate/ICTranslateDlg.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ictranslate/ICTranslateDlg.h (.../ICTranslateDlg.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ictranslate/ICTranslateDlg.h (.../ICTranslateDlg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -27,7 +27,7 @@ { // Construction public: - explicit CICTranslateDlg(CWnd* pParent = NULL); // standard constructor + explicit CICTranslateDlg(CWnd* pParent = nullptr); // standard constructor // Dialog Data virtual BOOL PreTranslateMessage(MSG* pMsg); Index: src/libchcore/ConfigNodeContainer.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/libchcore/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -286,7 +286,7 @@ boost::shared_lock lock(m_lock); size_t stLastIndex = std::numeric_limits::max(); - ConfigNodeContainer* pCurrentContainer = NULL; + ConfigNodeContainer* pCurrentContainer = nullptr; for (NodeContainer::const_iterator iter = m_mic.begin(); iter != m_mic.end(); ++iter) { Index: src/libchcore/TBaseException.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TBaseException.cpp (.../TBaseException.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TBaseException.cpp (.../TBaseException.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -35,7 +35,7 @@ TBaseException::TBaseException(EGeneralErrors eErrorCode, const char* pszMsg, const wchar_t* pszFile, size_t stLineNumber, const wchar_t* pszFunction) : m_eErrorCode(eErrorCode), - m_pszMsg(NULL), + m_pszMsg(nullptr), m_bDeleteMsg(false), m_pszFile(pszFile), m_stLineNumber(stLineNumber), Index: src/libchcore/TConfig.cpp =================================================================== diff -u -r9615294eb17ad0693fc193cca8b972ecb11428fa -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision 9615294eb17ad0693fc193cca8b972ecb11428fa) +++ src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -427,7 +427,7 @@ void TConfig::DisconnectFromNotifier(void(*pfnCallback)(const TStringSet&, void*)) { boost::unique_lock lock(GetImpl()->m_lock); - GetImpl()->m_notifier.disconnect(TConfigNotifier(pfnCallback, NULL)); + GetImpl()->m_notifier.disconnect(TConfigNotifier(pfnCallback, nullptr)); } void TConfig::DelayNotifications() Index: src/libchcore/TDateTime.cpp =================================================================== diff -u -rad4fe0f8085b15527158073aa76eb2d9ef80b0e5 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TDateTime.cpp (.../TDateTime.cpp) (revision ad4fe0f8085b15527158073aa76eb2d9ef80b0e5) +++ src/libchcore/TDateTime.cpp (.../TDateTime.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -116,7 +116,7 @@ void TDateTime::SetCurrentDateTime() { - m_tTime = _time64(NULL); + m_tTime = _time64(nullptr); } void TDateTime::GetAsSystemTime(SYSTEMTIME& tSystemTime) const @@ -145,7 +145,7 @@ const size_t stMaxBufSize = 1024; wchar_t* pszBuffer = strTmp.GetBuffer(stMaxBufSize); - PCTSTR pszFmt = NULL; + PCTSTR pszFmt = nullptr; if (bUseDate && bUseTime) pszFmt = _T("%x %X"); else if (bUseDate) Index: src/libchcore/TEvent.cpp =================================================================== diff -u -re8f31b0f922b402878356e130c866c4f3682a7f5 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TEvent.cpp (.../TEvent.cpp) (revision e8f31b0f922b402878356e130c866c4f3682a7f5) +++ src/libchcore/TEvent.cpp (.../TEvent.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -25,8 +25,8 @@ { TEvent::TEvent(bool bManualReset, bool bInitialState) { - m_hEvent = CreateEvent(NULL, bManualReset, bInitialState, NULL); - if (m_hEvent == NULL) + m_hEvent = CreateEvent(nullptr, bManualReset, bInitialState, nullptr); + if (m_hEvent == nullptr) throw TCoreException(eErr_CannotCreateEvent, L"Failed to create event", LOCATION); } Index: src/libchcore/TFileFiltersArray.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TFileFiltersArray.cpp (.../TFileFiltersArray.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/libchcore/TFileFiltersArray.cpp (.../TFileFiltersArray.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -119,7 +119,7 @@ if (stIndex < m_vFilters.size()) return &m_vFilters.at(stIndex); else - return NULL; + return nullptr; } bool TFileFiltersArray::RemoveAt(size_t stIndex) Index: src/libchcore/TLocalFilesystem.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TLocalFilesystem.cpp (.../TLocalFilesystem.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/libchcore/TLocalFilesystem.cpp (.../TLocalFilesystem.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -104,7 +104,7 @@ void TLocalFilesystem::SetFileDirectoryTime(const TSmartPath& pathFileDir, const TFileTime& ftCreationTime, const TFileTime& ftLastAccessTime, const TFileTime& ftLastWriteTime) { - TAutoFileHandle hFile = TAutoFileHandle(CreateFile(PrependPathExtensionIfNeeded(pathFileDir).ToString(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL)); + TAutoFileHandle hFile = TAutoFileHandle(CreateFile(PrependPathExtensionIfNeeded(pathFileDir).ToString(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, nullptr)); if (hFile == INVALID_HANDLE_VALUE) { DWORD dwLastError = GetLastError(); @@ -131,7 +131,7 @@ { if (!bCreateFullPath) { - if (!::CreateDirectory(PrependPathExtensionIfNeeded(pathDirectory).ToString(), NULL)) + if (!::CreateDirectory(PrependPathExtensionIfNeeded(pathDirectory).ToString(), nullptr)) { DWORD dwLastError = GetLastError(); throw TFileException(eErr_CannotCreateDirectory, dwLastError, pathDirectory, L"Cannot create directory", LOCATION); @@ -152,7 +152,7 @@ if (!pathToTest.IsDrive() && !pathToTest.IsServerName()) { // try to create the specified path - BOOL bRes = ::CreateDirectory(PrependPathExtensionIfNeeded(pathToTest).ToString(), NULL); + BOOL bRes = ::CreateDirectory(PrependPathExtensionIfNeeded(pathToTest).ToString(), nullptr); if (!bRes) { DWORD dwLastError = GetLastError(); @@ -326,7 +326,7 @@ wchar_t szDrive[] = { L'\\', L'\\', L'.', L'\\', wchDrive, L':', L'\0' }; - HANDLE hDevice = CreateFile(szDrive, FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); + HANDLE hDevice = CreateFile(szDrive, FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, nullptr); if (hDevice == INVALID_HANDLE_VALUE) return std::numeric_limits::max(); @@ -337,7 +337,7 @@ VOLUME_DISK_EXTENTS* pVolumeDiskExtents = (VOLUME_DISK_EXTENTS*)spData.get(); DWORD dwBytesReturned = 0; - BOOL bResult = DeviceIoControl(hDevice, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, NULL, 0, pVolumeDiskExtents, stSize, &dwBytesReturned, NULL); + BOOL bResult = DeviceIoControl(hDevice, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, nullptr, 0, pVolumeDiskExtents, stSize, &dwBytesReturned, nullptr); if (!bResult) { CloseHandle(hDevice); @@ -365,7 +365,7 @@ rullFree = 0; ULARGE_INTEGER ui64Available, ui64Total; - if (GetDiskFreeSpaceEx(path.ToString(), &ui64Available, &ui64Total, NULL)) + if (GetDiskFreeSpaceEx(path.ToString(), &ui64Available, &ui64Total, nullptr)) rullFree = ui64Available.QuadPart; else { Index: src/libchcore/TLocalFilesystemFile.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TLocalFilesystemFile.cpp (.../TLocalFilesystemFile.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/libchcore/TLocalFilesystemFile.cpp (.../TLocalFilesystemFile.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -63,7 +63,7 @@ { Close(); - m_hFile = ::CreateFile(m_pathFile.ToString(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, GetFlagsAndAttributes(m_bNoBuffering), NULL); + m_hFile = ::CreateFile(m_pathFile.ToString(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, GetFlagsAndAttributes(m_bNoBuffering), nullptr); if (m_hFile == INVALID_HANDLE_VALUE) { DWORD dwLastError = GetLastError(); @@ -75,7 +75,7 @@ { Close(); - m_hFile = ::CreateFile(m_pathFile.ToString(), GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, GetFlagsAndAttributes(m_bNoBuffering), NULL); + m_hFile = ::CreateFile(m_pathFile.ToString(), GENERIC_WRITE, FILE_SHARE_READ, nullptr, CREATE_NEW, GetFlagsAndAttributes(m_bNoBuffering), nullptr); if (m_hFile == INVALID_HANDLE_VALUE) { DWORD dwLastError = GetLastError(); @@ -92,7 +92,7 @@ { Close(); - m_hFile = CreateFile(m_pathFile.ToString(), GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, GetFlagsAndAttributes(bNoBuffering), NULL); + m_hFile = CreateFile(m_pathFile.ToString(), GENERIC_WRITE, FILE_SHARE_READ, nullptr, OPEN_EXISTING, GetFlagsAndAttributes(bNoBuffering), nullptr); if (m_hFile == INVALID_HANDLE_VALUE) { DWORD dwLastError = GetLastError(); Index: src/libchcore/TOverlappedDataBuffer.cpp =================================================================== diff -u -rc6148b3c853fcd809375d48414b7f13dd4d10d7e -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TOverlappedDataBuffer.cpp (.../TOverlappedDataBuffer.cpp) (revision c6148b3c853fcd809375d48414b7f13dd4d10d7e) +++ src/libchcore/TOverlappedDataBuffer.cpp (.../TOverlappedDataBuffer.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -76,7 +76,7 @@ InternalHigh = 0; Offset = 0; OffsetHigh = 0; - hEvent = NULL; + hEvent = nullptr; // create buffer ReinitializeBuffer(stBufferSize); @@ -93,7 +93,7 @@ { ReleaseBuffer(); - m_pBuffer = VirtualAlloc(NULL, stNewBufferSize, MEM_COMMIT, PAGE_READWRITE); + m_pBuffer = VirtualAlloc(nullptr, stNewBufferSize, MEM_COMMIT, PAGE_READWRITE); if (!m_pBuffer) throw TCoreException(eErr_CannotAllocateMemory, L"VirtualAlloc failed", LOCATION); m_stBufferSize = stNewBufferSize; Index: src/libchcore/TSQLiteDatabase.cpp =================================================================== diff -u -r8d3154738b885f2e01997071e6180da0c4b8cc7c -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TSQLiteDatabase.cpp (.../TSQLiteDatabase.cpp) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) +++ src/libchcore/TSQLiteDatabase.cpp (.../TSQLiteDatabase.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -27,7 +27,7 @@ namespace sqlite { TSQLiteDatabase::TSQLiteDatabase(const TSmartPath& pathDatabase) : - m_pDBHandle(NULL), + m_pDBHandle(nullptr), m_bInTransaction(false), m_pathDatabase(pathDatabase) { @@ -41,7 +41,7 @@ TSQLiteDatabase::~TSQLiteDatabase() { - int iResult = sqlite3_close_v2(m_pDBHandle); // handles properly the NULL DB Handle + int iResult = sqlite3_close_v2(m_pDBHandle); // handles properly the nullptr DB Handle iResult; _ASSERTE(iResult == SQLITE_OK); } Index: src/libchcore/TSQLiteSerializerContainer.cpp =================================================================== diff -u -r8d3154738b885f2e01997071e6180da0c4b8cc7c -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TSQLiteSerializerContainer.cpp (.../TSQLiteSerializerContainer.cpp) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) +++ src/libchcore/TSQLiteSerializerContainer.cpp (.../TSQLiteSerializerContainer.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -36,7 +36,7 @@ TSQLiteSerializerContainer::TSQLiteSerializerContainer(const TString& strName, const sqlite::TSQLiteDatabasePtr& spDB, TPlainStringPool& poolStrings) : m_strName(strName), m_spDB(spDB), - m_pPoolRows(NULL), + m_pPoolRows(nullptr), m_poolStrings(poolStrings) { } Index: src/libchcore/TSQLiteStatement.cpp =================================================================== diff -u -r25129f39720523eca2cb702242890a7862f70ec6 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TSQLiteStatement.cpp (.../TSQLiteStatement.cpp) (revision 25129f39720523eca2cb702242890a7862f70ec6) +++ src/libchcore/TSQLiteStatement.cpp (.../TSQLiteStatement.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -29,7 +29,7 @@ namespace sqlite { TSQLiteStatement::TSQLiteStatement(const TSQLiteDatabasePtr& spDatabase) : - m_pStatement(NULL), + m_pStatement(nullptr), m_spDatabase(spDatabase), m_bHasRow(false) { @@ -48,12 +48,12 @@ void TSQLiteStatement::Close() { - if (m_pStatement != NULL) + if (m_pStatement != nullptr) { int iResult = sqlite3_finalize(m_pStatement); if (iResult != SQLITE_OK) throw TSQLiteException(eErr_SQLiteFinalizeError, iResult, _T("Cannot finalize statement"), LOCATION); - m_pStatement = NULL; + m_pStatement = nullptr; } m_bHasRow = false; } @@ -62,7 +62,7 @@ { Close(); - int iResult = sqlite3_prepare16_v2((sqlite3*)m_spDatabase->GetHandle(), pszQuery, -1, &m_pStatement, NULL); + int iResult = sqlite3_prepare16_v2((sqlite3*)m_spDatabase->GetHandle(), pszQuery, -1, &m_pStatement, nullptr); if (iResult != SQLITE_OK) throw TSQLiteException(eErr_SQLitePrepareError, iResult, (PCTSTR)sqlite3_errmsg16((sqlite3*)m_spDatabase->GetHandle()), LOCATION); } Index: src/libchcore/TSQLiteTransaction.cpp =================================================================== diff -u -r8d3154738b885f2e01997071e6180da0c4b8cc7c -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TSQLiteTransaction.cpp (.../TSQLiteTransaction.cpp) (revision 8d3154738b885f2e01997071e6180da0c4b8cc7c) +++ src/libchcore/TSQLiteTransaction.cpp (.../TSQLiteTransaction.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -40,7 +40,7 @@ // try to rollback the transaction; this is the last resort if (m_bTransactionStarted && m_spDatabase->GetInTransaction()) { - int iResult = sqlite3_exec((sqlite3*)m_spDatabase->GetHandle(), "ROLLBACK TRANSACTION;", NULL, NULL, NULL); + int iResult = sqlite3_exec((sqlite3*)m_spDatabase->GetHandle(), "ROLLBACK TRANSACTION;", nullptr, nullptr, nullptr); iResult; _ASSERTE(iResult == SQLITE_OK); m_spDatabase->SetInTransaction(false); @@ -55,7 +55,7 @@ if (m_bTransactionStarted) throw TSQLiteException(eErr_SQLiteCannotBeginTransaction, 0, _T("Transaction already started"), LOCATION); - int iResult = sqlite3_exec((sqlite3*)m_spDatabase->GetHandle(), "BEGIN TRANSACTION", NULL, NULL, NULL); + int iResult = sqlite3_exec((sqlite3*)m_spDatabase->GetHandle(), "BEGIN TRANSACTION", nullptr, nullptr, nullptr); if (iResult != SQLITE_OK) throw TSQLiteException(eErr_SQLiteCannotBeginTransaction, iResult, _T("Cannot begin transaction"), LOCATION); @@ -73,7 +73,7 @@ if (!m_bTransactionStarted) return; - int iResult = sqlite3_exec((sqlite3*)m_spDatabase->GetHandle(), "ROLLBACK TRANSACTION;", NULL, NULL, NULL); + int iResult = sqlite3_exec((sqlite3*)m_spDatabase->GetHandle(), "ROLLBACK TRANSACTION;", nullptr, nullptr, nullptr); if (iResult != SQLITE_OK) throw TSQLiteException(eErr_SQLiteCannotRollbackTransaction, iResult, _T("Cannot rollback transaction"), LOCATION); m_spDatabase->SetInTransaction(false); @@ -90,7 +90,7 @@ if (!m_bTransactionStarted) return; - int iResult = sqlite3_exec((sqlite3*)m_spDatabase->GetHandle(), "COMMIT TRANSACTION;", NULL, NULL, NULL); + int iResult = sqlite3_exec((sqlite3*)m_spDatabase->GetHandle(), "COMMIT TRANSACTION;", nullptr, nullptr, nullptr); if (iResult != SQLITE_OK) throw TSQLiteException(eErr_SQLiteCannotCommitTransaction, iResult, _T("Cannot commit transaction"), LOCATION); m_spDatabase->SetInTransaction(false); Index: src/libchcore/TSharedMemory.cpp =================================================================== diff -u -re8f31b0f922b402878356e130c866c4f3682a7f5 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TSharedMemory.cpp (.../TSharedMemory.cpp) (revision e8f31b0f922b402878356e130c866c4f3682a7f5) +++ src/libchcore/TSharedMemory.cpp (.../TSharedMemory.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -58,9 +58,9 @@ // TSharedMemory class TSharedMemory::TSharedMemory() : - m_hFileMapping(NULL), - m_pMappedMemory(NULL), - m_hMutex(NULL), + m_hFileMapping(nullptr), + m_pMappedMemory(nullptr), + m_hMutex(nullptr), m_stSize(0) { } @@ -171,20 +171,20 @@ if (m_hMutex) { CloseHandle(m_hMutex); - m_hMutex = NULL; + m_hMutex = nullptr; } if (m_pMappedMemory) { UnmapViewOfFile(m_pMappedMemory); - m_pMappedMemory = NULL; + m_pMappedMemory = nullptr; } // Close the process's handle to the file-mapping object. if (m_hFileMapping) { CloseHandle(m_hFileMapping); - m_hFileMapping = NULL; + m_hFileMapping = nullptr; } } catch (...) @@ -231,15 +231,15 @@ const BYTE* TSharedMemory::GetData() const { if (!m_hFileMapping || !m_pMappedMemory || m_stSize <= sizeof(shm_size_t)) - return NULL; + return nullptr; return (BYTE*)m_pMappedMemory + sizeof(shm_size_t); } BYTE* TSharedMemory::GetData() { if (!m_hFileMapping || !m_pMappedMemory || m_stSize <= sizeof(shm_size_t)) - return NULL; + return nullptr; return (BYTE*)m_pMappedMemory + sizeof(shm_size_t); } Index: src/libchcore/TString.cpp =================================================================== diff -u -r4572f6cddf7dab06b1de99504a6bbd3680d11e6d -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TString.cpp (.../TString.cpp) (revision 4572f6cddf7dab06b1de99504a6bbd3680d11e6d) +++ src/libchcore/TString.cpp (.../TString.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -43,7 +43,7 @@ /** Standard constructor - allocates the underlying data object */ TString::TString() : - m_pszData(NULL), + m_pszData(nullptr), m_stBufferSize(0) { } @@ -53,19 +53,19 @@ * \param[in] pszStr - source unicode TString */ TString::TString(const wchar_t* pszStr) : - m_pszData(NULL), + m_pszData(nullptr), m_stBufferSize(0) { SetString(pszStr); } TString::TString(const wchar_t* pszStart, const wchar_t* pszEnd, size_t stMaxStringSize) : - m_pszData(NULL), + m_pszData(nullptr), m_stBufferSize(0) { - // we support either both arguments != NULL or both == NULL - if (pszEnd != NULL && pszStart == NULL || pszEnd == NULL && pszStart != NULL) - throw TStringException(eErr_InvalidArgument, _T("End of string specified while start is NULL"), LOCATION); + // we support either both arguments != nullptr or both == nullptr + if (pszEnd != nullptr && pszStart == nullptr || pszEnd == nullptr && pszStart != nullptr) + throw TStringException(eErr_InvalidArgument, _T("End of string specified while start is nullptr"), LOCATION); // sanity check if (pszEnd < pszStart) @@ -79,7 +79,7 @@ } TString::TString(const wchar_t* pszStart, size_t stCount) : - m_pszData(NULL), + m_pszData(nullptr), m_stBufferSize(0) { if (!pszStart) @@ -96,7 +96,7 @@ * \param[in] rSrc - source TString object */ TString::TString(const TString& rSrc) : - m_pszData(NULL), + m_pszData(nullptr), m_stBufferSize(0) { SetString(rSrc.m_pszData); @@ -107,7 +107,7 @@ TString::~TString() { delete[] m_pszData; - m_pszData = NULL; + m_pszData = nullptr; m_stBufferSize = 0; } @@ -632,9 +632,9 @@ } /** Returns a pointer to the unicode internal buffer. If the buffer is in ansi format - * then NULL value is returned. Internal buffer is resized to the specified value + * then nullptr value is returned. Internal buffer is resized to the specified value * if currently smaller than requested (if -1 is specified as tMinSize then the buffer - * is not resized, and the return value could be NULL). + * is not resized, and the return value could be nullptr). * \param[in] tMinSize - requested minimal size of the internal buffer (-1 if the size of the TString should not be changed) * \return Pointer to the internal unicode buffer. */ Index: src/libchcore/TSubTaskArray.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -132,7 +132,7 @@ for (const std::pair& tupleRow : m_vSubTasks) { - if (tupleRow.first == NULL) + if (tupleRow.first == nullptr) throw TCoreException(eErr_InternalProblem, L"SubTask is null", LOCATION); tupleRow.first->Reset(); Index: src/libchcore/TWin32ErrorFormatter.cpp =================================================================== diff -u -r86c2327549cd4fa98972cf9035f9a78451a00f88 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TWin32ErrorFormatter.cpp (.../TWin32ErrorFormatter.cpp) (revision 86c2327549cd4fa98972cf9035f9a78451a00f88) +++ src/libchcore/TWin32ErrorFormatter.cpp (.../TWin32ErrorFormatter.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -45,9 +45,9 @@ DWORD dwPos = 0; if(hModule) - dwPos = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE, hModule, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), pszBuffer, dwMaxError - 1, NULL); + dwPos = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE, hModule, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), pszBuffer, dwMaxError - 1, nullptr); else - dwPos = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), pszBuffer, dwMaxError - 1, NULL); + dwPos = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), pszBuffer, dwMaxError - 1, nullptr); if (dwPos == 0xffffffff) { Index: src/libchcore/TWorkerThreadController.cpp =================================================================== diff -u -rad4fe0f8085b15527158073aa76eb2d9ef80b0e5 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/TWorkerThreadController.cpp (.../TWorkerThreadController.cpp) (revision ad4fe0f8085b15527158073aa76eb2d9ef80b0e5) +++ src/libchcore/TWorkerThreadController.cpp (.../TWorkerThreadController.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -28,10 +28,10 @@ namespace chcore { TWorkerThreadController::TWorkerThreadController() : - m_hThread(NULL), - m_hKillThread(NULL) + m_hThread(nullptr), + m_hKillThread(nullptr) { - m_hKillThread = CreateEvent(NULL, TRUE, FALSE, NULL); + m_hKillThread = CreateEvent(nullptr, TRUE, FALSE, nullptr); if (!m_hKillThread) throw TCoreWin32Exception(eErr_CannotCreateEvent, GetLastError(), L"Failed to create event", LOCATION); } @@ -63,7 +63,7 @@ boost::upgrade_to_unique_lock lock_upgraded(lock); - m_hThread = ::CreateThread(NULL, 0, pThreadFunction, pThreadParam, CREATE_SUSPENDED, NULL); + m_hThread = ::CreateThread(nullptr, 0, pThreadFunction, pThreadParam, CREATE_SUSPENDED, nullptr); if (!m_hThread) throw TCoreWin32Exception(eErr_CannotCreateThread, GetLastError(), L"Failed to create thread", LOCATION); @@ -72,7 +72,7 @@ DWORD dwLastError = GetLastError(); CloseHandle(m_hThread); - m_hThread = NULL; + m_hThread = nullptr; throw TCoreWin32Exception(eErr_CannotChangeThreadPriority, dwLastError, L"Failed to set thread priority", LOCATION); } @@ -82,7 +82,7 @@ DWORD dwLastError = GetLastError(); CloseHandle(m_hThread); - m_hThread = NULL; + m_hThread = nullptr; throw TCoreWin32Exception(eErr_CannotResumeThread, dwLastError, L"Failed to resume thread", LOCATION); } @@ -108,7 +108,7 @@ boost::upgrade_to_unique_lock lock_upgraded(lock); CloseHandle(m_hThread); - m_hThread = NULL; + m_hThread = nullptr; } else throw TCoreWin32Exception(eErr_WaitingFailed, GetLastError(), L"Waiting failed", LOCATION); @@ -132,7 +132,7 @@ if (!m_hThread) return; - if (m_hThread != NULL) + if (m_hThread != nullptr) { if (::SuspendThread(m_hThread) == (DWORD)-1) throw TCoreWin32Exception(eErr_CannotSuspendThread, GetLastError(), L"Failed to suspend thread", LOCATION); @@ -159,7 +159,7 @@ // this method does not have any mutexes, because it should be only called from within the thread // being controlled by this object. This implies that the thread is alive and running, // this class must exist because it should not be possible for the thread to exist and be active - // when this object is out of scope, and so the m_hKillThread should be non-NULL, since it is being destroyed + // when this object is out of scope, and so the m_hKillThread should be non-nullptr, since it is being destroyed // in destructor. return (m_hKillThread && WaitForSingleObject(m_hKillThread, dwWaitForSignal) == WAIT_OBJECT_0); } @@ -184,7 +184,7 @@ boost::upgrade_to_unique_lock lock_upgraded(rUpgradeLock); CloseHandle(m_hThread); - m_hThread = NULL; + m_hThread = nullptr; } } @@ -212,7 +212,7 @@ boost::upgrade_to_unique_lock lock_upgraded(rUpgradeLock); CloseHandle(m_hThread); - m_hThread = NULL; + m_hThread = nullptr; } else throw TCoreWin32Exception(eErr_WaitingFailed, GetLastError(), L"Failed to wait for object", LOCATION); Index: src/libchcore/Tests/TestsTSQLiteDatabase.cpp =================================================================== diff -u -rd18db617f4727a237c94b59af9b4328f829eda16 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/Tests/TestsTSQLiteDatabase.cpp (.../TestsTSQLiteDatabase.cpp) (revision d18db617f4727a237c94b59af9b4328f829eda16) +++ src/libchcore/Tests/TestsTSQLiteDatabase.cpp (.../TestsTSQLiteDatabase.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -9,6 +9,6 @@ TEST(SQLiteDatabase, CreationWithVerification) { TSQLiteDatabase db(PathFromString(_T(":memory:"))); - EXPECT_TRUE(db.GetHandle() != NULL); + EXPECT_TRUE(db.GetHandle() != nullptr); EXPECT_FALSE(db.GetInTransaction()); } Index: src/libchcore/Tests/TestsTSmartPath.cpp =================================================================== diff -u -r27c262eb9cae55720e10f4886af6b5a82cb94fe9 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/Tests/TestsTSmartPath.cpp (.../TestsTSmartPath.cpp) (revision 27c262eb9cae55720e10f4886af6b5a82cb94fe9) +++ src/libchcore/Tests/TestsTSmartPath.cpp (.../TestsTSmartPath.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -23,7 +23,7 @@ TEST(TSmartPathTests, PathFromNullString) { TSmartPath tPath; - EXPECT_THROW(tPath.FromString(NULL), TCoreException); + EXPECT_THROW(tPath.FromString(nullptr), TCoreException); } TEST(TSmartPathTests, PathFromTStringToWString) Index: src/libchcore/Tests/TestsTString.cpp =================================================================== diff -u -r2408cac34e827fa43ff1622f65251e219f96a4f1 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/Tests/TestsTString.cpp (.../TestsTString.cpp) (revision 2408cac34e827fa43ff1622f65251e219f96a4f1) +++ src/libchcore/Tests/TestsTString.cpp (.../TestsTString.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -22,7 +22,7 @@ TEST(TStringTests, WcharConstructorWithNullValue_CompareContent) { - TString strValue(NULL); + TString strValue(nullptr); EXPECT_EQ(strValue, L""); } @@ -36,13 +36,13 @@ TEST(TStringTests, WcharRangeConstructor_WithUnsupportedNullValues) { const wchar_t* pszText = L"Some test string"; - EXPECT_THROW(TString strValue(pszText, (const wchar_t*)NULL), TStringException); - EXPECT_THROW(TString strValue((const wchar_t*)NULL, pszText), TStringException); + EXPECT_THROW(TString strValue(pszText, (const wchar_t*)nullptr), TStringException); + EXPECT_THROW(TString strValue((const wchar_t*)nullptr, pszText), TStringException); } TEST(TStringTests, WcharRangeConstructor_WithSupportedNullValues_CompareContent) { - TString strValue((const wchar_t*)NULL, (const wchar_t*)NULL); + TString strValue((const wchar_t*)nullptr, (const wchar_t*)nullptr); EXPECT_EQ(strValue, _T("")); } @@ -83,7 +83,7 @@ TEST(TStringTests, AssignmentOperator_WithNullValue) { TString strValue; - strValue = NULL; + strValue = nullptr; EXPECT_EQ(strValue, _T("")); } @@ -109,7 +109,7 @@ TEST(TStringTests, OperatorAdd_WithNullPtrToString) { - TString strValue = TString(_T("Text: ")) + (const wchar_t*)NULL; + TString strValue = TString(_T("Text: ")) + (const wchar_t*)nullptr; EXPECT_EQ(strValue, _T("Text: ")); } @@ -121,7 +121,7 @@ TEST(TStringTests, OperatorAdd_EmptyWithNullPtrToString) { - TString strValue = TString() + (const wchar_t*)NULL; + TString strValue = TString() + (const wchar_t*)nullptr; EXPECT_EQ(strValue, _T("")); } @@ -141,7 +141,7 @@ TEST(TStringTests, OperatorInplaceAdd_WithNullPtrToString) { TString strValue(_T("Text: ")); - strValue += (const wchar_t*)NULL; + strValue += (const wchar_t*)nullptr; EXPECT_EQ(strValue, _T("Text: ")); } @@ -155,7 +155,7 @@ TEST(TStringTests, OperatorInplaceAdd_EmptyWithNullPtrToString) { TString strValue; - strValue += (const wchar_t*)NULL; + strValue += (const wchar_t*)nullptr; EXPECT_EQ(strValue, _T("")); } @@ -256,7 +256,7 @@ TEST(TStringTests, AppendString_WithNullPtrToString) { TString strValue(_T("Some string")); - strValue.Append((const wchar_t*)NULL); + strValue.Append((const wchar_t*)nullptr); EXPECT_EQ(strValue, _T("Some string")); } @@ -516,15 +516,15 @@ EXPECT_EQ(strValue.FindFirstOf(_T("er"), 3), 3); EXPECT_EQ(strValue.FindFirstOf(_T("er"), 4), 7); EXPECT_EQ(strValue.FindFirstOf(_T(""), 0), TString::npos); - EXPECT_EQ(strValue.FindFirstOf(NULL, 0), TString::npos); + EXPECT_EQ(strValue.FindFirstOf(nullptr, 0), TString::npos); } TEST(TStringTests, FindLastOf_WithPtrToString) { TString strValue(_T("Some string")); EXPECT_EQ(strValue.FindLastOf(_T("er")), 7); EXPECT_EQ(strValue.FindLastOf(_T("")), TString::npos); - EXPECT_EQ(strValue.FindLastOf(NULL), TString::npos); + EXPECT_EQ(strValue.FindLastOf(nullptr), TString::npos); } // find and replace @@ -534,7 +534,7 @@ EXPECT_EQ(strValue.Find(_T("tri"), 6), 6); EXPECT_EQ(strValue.Find(_T("tri"), 7), TString::npos); EXPECT_EQ(strValue.Find(_T(""), 0), TString::npos); - EXPECT_EQ(strValue.Find(NULL, 0), TString::npos); + EXPECT_EQ(strValue.Find(nullptr, 0), TString::npos); } TEST(TStringTests, Find_SearchStringLongerThanThis) @@ -560,7 +560,7 @@ TEST(TStringTests, Replace_EmptyStringWithNullPtrToString) { TString strValue; - strValue.Replace(_T(""), NULL); + strValue.Replace(_T(""), nullptr); EXPECT_EQ(strValue, _T("")); } Index: src/libchcore/log.cpp =================================================================== diff -u -rd18db617f4727a237c94b59af9b4328f829eda16 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libchcore/log.cpp (.../log.cpp) (revision d18db617f4727a237c94b59af9b4328f829eda16) +++ src/libchcore/log.cpp (.../log.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -44,7 +44,7 @@ * Only one global log_file instance could exist in the application. */ log_file::log_file() : - m_pszPath(NULL), + m_pszPath(nullptr), m_iMaxSize(262144), m_bLogStd(false), m_iLogLevel(level_debug), @@ -81,7 +81,7 @@ // try to open a file FILE* pFile = _tfopen(pszPath, bClean ? _T("w") : _T("a")); - if (pFile == NULL) + if (pFile == nullptr) throw TCoreException(eErr_CannotOpenFile, L"Could not open the specified file", LOCATION); fclose(pFile); @@ -137,7 +137,7 @@ int iSize = -1; FILE* pFile = _tfopen(m_pszPath, _T("r")); - if (pFile != NULL) + if (pFile != nullptr) { if (fseek(pFile, 0, SEEK_END) == 0) iSize = ftell(pFile); @@ -173,16 +173,16 @@ #ifdef _WIN32 // win32 does not have the ftruncate function, so we have to make some API calls - HANDLE hFile = CreateFile(m_pszPath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE hFile = CreateFile(m_pszPath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); if (hFile != INVALID_HANDLE_VALUE) { // seek - if (SetFilePointer(hFile, iSize - iNewSize, NULL, FILE_BEGIN) != INVALID_SET_FILE_POINTER) + if (SetFilePointer(hFile, iSize - iNewSize, nullptr, FILE_BEGIN) != INVALID_SET_FILE_POINTER) { // read the string to the eol DWORD dwRD; wchar_t szBuffer[4096 / sizeof(wchar_t)]; - if (ReadFile(hFile, szBuffer, 4096, &dwRD, NULL)) + if (ReadFile(hFile, szBuffer, 4096, &dwRD, nullptr)) { dwRD /= sizeof(wchar_t); szBuffer[(dwRD > 0) ? dwRD - 1 : 0] = _T('\0'); @@ -199,26 +199,26 @@ iNewSize -= (int)(_tcslen(szBuffer) + 1)*sizeof(wchar_t); // new size correction - if (SetFilePointer(hFile, iSize - iNewSize, NULL, FILE_BEGIN) != INVALID_SET_FILE_POINTER) + if (SetFilePointer(hFile, iSize - iNewSize, nullptr, FILE_BEGIN) != INVALID_SET_FILE_POINTER) { - long lSrc = (long)SetFilePointer(hFile, 0, NULL, FILE_CURRENT); + long lSrc = (long)SetFilePointer(hFile, 0, nullptr, FILE_CURRENT); long lDst = 0; DWORD tRD, tWR; do { // seek to src - SetFilePointer(hFile, lSrc, NULL, FILE_BEGIN); + SetFilePointer(hFile, lSrc, nullptr, FILE_BEGIN); // read 4k chars from source offset - if (ReadFile(hFile, szBuffer, 4096, &tRD, NULL)) + if (ReadFile(hFile, szBuffer, 4096, &tRD, nullptr)) { // seek to the dst - SetFilePointer(hFile, lDst, NULL, FILE_BEGIN); + SetFilePointer(hFile, lDst, nullptr, FILE_BEGIN); FlushFileBuffers(hFile); // write the buffer to the dest offset - WriteFile(hFile, szBuffer, tRD, &tWR, NULL); + WriteFile(hFile, szBuffer, tRD, &tWR, nullptr); lDst += (long)tWR; } @@ -334,7 +334,7 @@ return; // log time - time_t t = time(NULL); + time_t t = time(nullptr); std::wstring strTime = _tctime(&t); boost::trim_right_if(strTime, boost::is_any_of(L"\n")); @@ -643,10 +643,10 @@ if (pszFnd) { // find an error description for the error - wchar_t* pszErrDesc = NULL; + wchar_t* pszErrDesc = nullptr; #ifdef _WIN32 wchar_t szErrDesc[512]; - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, (DWORD)iSysErr, 0, szErrDesc, 512, NULL); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, (DWORD)iSysErr, 0, szErrDesc, 512, nullptr); pszErrDesc = szErrDesc; #else pszErrDesc = strerror(iSysErr); Index: src/libictranslate/LanguageDialog.cpp =================================================================== diff -u -r4572f6cddf7dab06b1de99504a6bbd3680d11e6d -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libictranslate/LanguageDialog.cpp (.../LanguageDialog.cpp) (revision 4572f6cddf7dab06b1de99504a6bbd3680d11e6d) +++ src/libictranslate/LanguageDialog.cpp (.../LanguageDialog.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -63,7 +63,7 @@ bool CDlgTemplate::Open(const DLGTEMPLATE* pDlgTemplate) { - if (pDlgTemplate == NULL) + if (pDlgTemplate == nullptr) return false; bool bExt=((DLGTEMPLATEEX*)pDlgTemplate)->signature == 0xffff; const BYTE* pData=((BYTE*)pDlgTemplate); @@ -108,14 +108,14 @@ #ifdef _UNICODE _tcscpy(m_pszFace, (wchar_t*)pData); #else - WideCharToMultiByte(CP_ACP, 0, (wchar_t*)pData, dwLen+1, m_pszFace, dwLen+1, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, (wchar_t*)pData, dwLen+1, m_pszFace, dwLen+1, nullptr, nullptr); #endif pData+=(dwLen+1)*sizeof(wchar_t); } else { m_wFontSize=0xffff; - m_pszFace=NULL; + m_pszFace=nullptr; } // items @@ -138,44 +138,44 @@ } pData=ReadCompoundData(pData, &item.m_wClass, &item.m_pszClass); - if (item.m_wClass == 0xffff && item.m_pszClass != NULL) + if (item.m_wClass == 0xffff && item.m_pszClass != nullptr) { // check the class strings and translate to atom values if (_tcscmp(item.m_pszClass, _T("STATIC")) == 0) { item.m_wClass=0x0082; delete [] item.m_pszClass; - item.m_pszClass=NULL; + item.m_pszClass=nullptr; } else if (_tcscmp(item.m_pszClass, _T("BUTTON")) == 0) { item.m_wClass=0x0080; delete [] item.m_pszClass; - item.m_pszClass=NULL; + item.m_pszClass=nullptr; } else if (_tcscmp(item.m_pszClass, _T("EDIT")) == 0) { item.m_wClass=0x0081; delete [] item.m_pszClass; - item.m_pszClass=NULL; + item.m_pszClass=nullptr; } else if (_tcscmp(item.m_pszClass, _T("COMBOBOX")) == 0) { item.m_wClass=0x0085; delete [] item.m_pszClass; - item.m_pszClass=NULL; + item.m_pszClass=nullptr; } else if (_tcscmp(item.m_pszClass, _T("LISTBOX")) == 0) { item.m_wClass=0x0083; delete [] item.m_pszClass; - item.m_pszClass=NULL; + item.m_pszClass=nullptr; } else if (_tcscmp(item.m_pszClass, _T("SCROLLBAR")) == 0) { item.m_wClass=0x0084; delete [] item.m_pszClass; - item.m_pszClass=NULL; + item.m_pszClass=nullptr; } } pData=ReadCompoundData(pData, &item.m_wTitle, &item.m_pszTitle); @@ -190,7 +190,7 @@ memcpy(item.m_pbyCreationData, pData, item.m_wCreationDataSize); } else - item.m_pbyCreationData=NULL; + item.m_pbyCreationData=nullptr; m_vItems.push_back(item); } @@ -229,7 +229,7 @@ if (*((WORD*)pBuffer) == 0xffff) { *pwData=*((WORD*)(pBuffer+2)); - *ppszStr=NULL; + *ppszStr=nullptr; return pBuffer+4; } @@ -241,7 +241,7 @@ #ifdef _UNICODE _tcscpy(*ppszStr, (wchar_t*)pBuffer); #else - WideCharToMultiByte(CP_ACP, 0, (wchar_t*)pBuffer, dwLen+1, *ppszStr, dwLen+1, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, (wchar_t*)pBuffer, dwLen+1, *ppszStr, dwLen+1, nullptr, nullptr); #endif return pBuffer+(dwLen+1)*sizeof(wchar_t); } @@ -361,7 +361,7 @@ END_MESSAGE_MAP() -CResourceManager *CLanguageDialog::m_prm=NULL; +CResourceManager *CLanguageDialog::m_prm=nullptr; /////////////////////////////////////////////////////////////// // Standard constructor @@ -372,12 +372,12 @@ /////////////////////////////////////////////////////////////// CLanguageDialog::CLanguageDialog(bool* pLock) : CDialog() { - m_pszResName=NULL; + m_pszResName=nullptr; m_uiResID=0; - m_pParent=NULL; + m_pParent=nullptr; m_cType=-1; m_bAutoDelete=false; - m_pFont=NULL; + m_pFont=nullptr; m_pbLock=pLock; m_bLockChanged=false; m_bLockInstance=false; @@ -404,7 +404,7 @@ m_pParent=pParent; m_cType=-1; m_bAutoDelete=false; - m_pFont=NULL; + m_pFont=nullptr; m_pbLock=pLock; m_bLockChanged=false; m_bLockInstance=false; @@ -428,7 +428,7 @@ m_pParent=pParent; m_cType=-1; m_bAutoDelete=false; - m_pFont=NULL; + m_pFont=nullptr; m_pbLock=pLock; m_bLockChanged=false; m_bLockInstance=false; @@ -487,7 +487,7 @@ { _ASSERT(m_pszResName); // nothing was set as a dialog template - if (!m_bLockInstance || m_pbLock == NULL || !(*m_pbLock)) + if (!m_bLockInstance || m_pbLock == nullptr || !(*m_pbLock)) { HGLOBAL hDialog=m_prm->LoadResource(RT_DIALOG, m_pszResName); @@ -567,9 +567,9 @@ // dialog font LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT)); - HDC hdc=::GetDC(NULL); + HDC hdc=::GetDC(nullptr); lf.lfHeight = -MulDiv(m_prm->m_ld.GetPointSize(), GetDeviceCaps(hdc, LOGPIXELSY), 72); - ::ReleaseDC(NULL, hdc); + ::ReleaseDC(nullptr, hdc); lf.lfWeight = FW_NORMAL; lf.lfCharSet = DEFAULT_CHARSET; _tcsncpy_s(lf.lfFaceName, LF_FACESIZE, m_prm->m_ld.GetFontFace(), _TRUNCATE); @@ -591,15 +591,15 @@ CRect rcDialog(0, 0, dt.m_dlgTemplate.cx, dt.m_dlgTemplate.cy); MapRect(&rcDialog); - BOOL bHasMenu = ((dt.m_wMenu != 0xffff) || ((dt.m_pszMenu != NULL) && _tcslen(dt.m_pszMenu) != 0)); + BOOL bHasMenu = ((dt.m_wMenu != 0xffff) || ((dt.m_pszMenu != nullptr) && _tcslen(dt.m_pszMenu) != 0)); AdjustWindowRectEx(&rcDialog, GetStyle(), bHasMenu, GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE)); rcDialog.OffsetRect(-rcDialog.left, -rcDialog.top); rcDialog.OffsetRect(rcWin.CenterPoint().x - rcDialog.Width() / 2, rcWin.CenterPoint().y - rcDialog.Height() / 2); //TEMP TRACE("Old dlg pos/size: x=%lu, y=%lu, cx=%lu, cy=%lu; \n\tNew dlg pos/size: x=%lu, y=%lu, cx=%lu, cy=%lu\n", rcWin.left, rcWin.top, rcWin.Width(), rcWin.Height(), rcDialog.left, rcDialog.top, rcDialog.Width(), rcDialog.Height()); - SetWindowPos(NULL, rcDialog.left, rcDialog.top, rcDialog.Width(), rcDialog.Height(), SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE); + SetWindowPos(nullptr, rcDialog.left, rcDialog.top, rcDialog.Width(), rcDialog.Height(), SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE); } // the controls @@ -608,7 +608,7 @@ { CWnd* pWnd = nullptr; // skip controls that cannot be modified - if ( (*it).m_itemTemplate.id == 0xffff || (pWnd=GetDlgItem((*it).m_itemTemplate.id)) == NULL) + if ( (*it).m_itemTemplate.id == 0xffff || (pWnd=GetDlgItem((*it).m_itemTemplate.id)) == nullptr) continue; // the font @@ -634,10 +634,10 @@ // size CRect rc((*it).m_itemTemplate.x, (*it).m_itemTemplate.y, (*it).m_itemTemplate.x+(*it).m_itemTemplate.cx, (*it).m_itemTemplate.y+(*it).m_itemTemplate.cy); MapRect(&rc); - pWnd->SetWindowPos(NULL, rc.left, rc.top, rc.Width(), rc.Height(), SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE); + pWnd->SetWindowPos(nullptr, rc.left, rc.top, rc.Width(), rc.Height(), SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE); // text/caption - if ( (*it).m_wClass == 0x0080 || (*it).m_wClass == 0x0082 || (*it).m_wClass == 0x0086 || ((*it).m_pszClass != NULL && _tcscmp((*it).m_pszClass, _T("STATICEX")) == 0) ) + if ( (*it).m_wClass == 0x0080 || (*it).m_wClass == 0x0082 || (*it).m_wClass == 0x0086 || ((*it).m_pszClass != nullptr && _tcscmp((*it).m_pszClass, _T("STATICEX")) == 0) ) pWnd->SetWindowText(m_prm->LoadString((WORD)m_uiResID, (*it).m_itemTemplate.id)); } @@ -658,7 +658,7 @@ *m_pbLock=false; delete m_pFont; - m_pFont = NULL; + m_pFont = nullptr; if(m_bAutoDelete) delete this; @@ -774,15 +774,15 @@ void CLanguageDialog::CalcBaseUnits(PCTSTR pszFacename, WORD wPointSize) { LOGFONT lf; - HDC hDC = ::GetDC(NULL); + HDC hDC = ::GetDC(nullptr); memset(&lf, 0, sizeof(LOGFONT)); lf.lfHeight = -MulDiv(wPointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72); lf.lfWeight = FW_NORMAL; lf.lfCharSet = DEFAULT_CHARSET; _tcsncpy_s(lf.lfFaceName, LF_FACESIZE, pszFacename, _TRUNCATE); HFONT hNewFont = CreateFontIndirect(&lf); - if (hNewFont != NULL) + if (hNewFont != nullptr) { HFONT hFontOld = (HFONT)SelectObject(hDC, hNewFont); TEXTMETRIC tm; @@ -800,7 +800,7 @@ m_iBaseX = LOWORD(GetDialogBaseUnits()); m_iBaseY = HIWORD(GetDialogBaseUnits()); } - ::ReleaseDC(NULL, hDC); + ::ReleaseDC(nullptr, hDC); } BOOL CLanguageDialog::OnHelpInfo(HELPINFO* pHelpInfo) @@ -922,7 +922,7 @@ { // retrieve current dialog size CRect rcControl; - CWnd* pWnd = NULL; + CWnd* pWnd = nullptr; CRect rcCurrentDlgPos; GetClientRect(&rcCurrentDlgPos); @@ -936,7 +936,7 @@ if(pWnd && ::IsWindow(pWnd->m_hWnd)) { (*iterControl).second.GetNewControlPlacement(m_rcDialogInitialPosition, rcCurrentDlgPos, rcControl); - pWnd->SetWindowPos(NULL, rcControl.left, rcControl.top, rcControl.Width(), rcControl.Height(), SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS); + pWnd->SetWindowPos(nullptr, rcControl.left, rcControl.top, rcControl.Width(), rcControl.Height(), SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS); } } Index: src/libictranslate/LanguageDialog.h =================================================================== diff -u -r8f15ad1d2f65340f4f5a30bc95f40a12b0b7dd66 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libictranslate/LanguageDialog.h (.../LanguageDialog.h) (revision 8f15ad1d2f65340f4f5a30bc95f40a12b0b7dd66) +++ src/libictranslate/LanguageDialog.h (.../LanguageDialog.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -43,8 +43,8 @@ Constructors - as described in CDialog constructors - language specifies resource language to load CLanguageDialog(); - CLanguageDialog(PCTSTR lpszTemplateName, CWnd* pParent = NULL); - CLanguageDialog(UINT uiIDTemplate, CWnd* pParent = NULL); + CLanguageDialog(PCTSTR lpszTemplateName, CWnd* pParent = nullptr); + CLanguageDialog(UINT uiIDTemplate, CWnd* pParent = nullptr); Functions: int DoModal(); - like in CDialog BOOL Create(); - creates modeless dialog box; this class @@ -176,9 +176,9 @@ { public: // Construction/destruction - explicit CLanguageDialog(bool* pLock=NULL); - CLanguageDialog(PCTSTR lpszTemplateName, CWnd* pParent = NULL, bool* pLock=NULL); // standard constructor - CLanguageDialog(UINT uiIDTemplate, CWnd* pParent = NULL, bool* pLock=NULL); // standard constructor + explicit CLanguageDialog(bool* pLock=nullptr); + CLanguageDialog(PCTSTR lpszTemplateName, CWnd* pParent = nullptr, bool* pLock=nullptr); // standard constructor + CLanguageDialog(UINT uiIDTemplate, CWnd* pParent = nullptr, bool* pLock=nullptr); // standard constructor CLanguageDialog(const CLanguageDialog&) = delete; CLanguageDialog& operator=(const CLanguageDialog&) = delete; Index: src/libictranslate/ResourceManager.cpp =================================================================== diff -u -rbeaf6c76a528f2bcf42efa705770079fd84c0156 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision beaf6c76a528f2bcf42efa705770079fd84c0156) +++ src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -187,7 +187,7 @@ void CTranslationItem::Clear() { delete [] m_pszText; - m_pszText = NULL; + m_pszText = nullptr; m_stTextLength = 0; m_uiChecksum = 0; } @@ -213,7 +213,7 @@ } } - m_pszText = NULL; + m_pszText = nullptr; m_stTextLength = 0; } @@ -289,7 +289,7 @@ const wchar_t* pszData = m_pszText; const size_t stMaxFmt = 256; wchar_t szFmt[stMaxFmt]; - while((pszData = _tcschr(pszData, _T('%'))) != NULL) + while((pszData = _tcschr(pszData, _T('%'))) != nullptr) { pszData++; // it works assuming the string is null-terminated @@ -313,12 +313,12 @@ } CLangData::CLangData() : - m_pszFilename(NULL), - m_pszLngName(NULL), - m_pszFontFace(NULL), + m_pszFilename(nullptr), + m_pszLngName(nullptr), + m_pszFontFace(nullptr), m_wPointSize(0), - m_pszHelpName(NULL), - m_pszAuthor(NULL), + m_pszHelpName(nullptr), + m_pszAuthor(nullptr), m_bRTL(false), m_uiSectionID(0), m_bUpdating(false), @@ -338,15 +338,15 @@ void CLangData::Clear() { delete [] m_pszFilename; - m_pszFilename = NULL; + m_pszFilename = nullptr; delete [] m_pszLngName; - m_pszLngName = NULL; + m_pszLngName = nullptr; delete [] m_pszFontFace; - m_pszFontFace = NULL; + m_pszFontFace = nullptr; delete [] m_pszHelpName; - m_pszHelpName = NULL; + m_pszHelpName = nullptr; delete [] m_pszAuthor; - m_pszAuthor = NULL; + m_pszAuthor = nullptr; m_bModified = false; m_bRTL = false; m_bUpdating = false; @@ -357,11 +357,11 @@ } CLangData::CLangData(const CLangData& ld) : - m_pszFilename(NULL), - m_pszLngName(NULL), - m_pszFontFace(NULL), - m_pszHelpName(NULL), - m_pszAuthor(NULL), + m_pszFilename(nullptr), + m_pszLngName(nullptr), + m_pszFontFace(nullptr), + m_pszHelpName(nullptr), + m_pszAuthor(nullptr), m_bRTL(ld.m_bRTL), m_bUpdating(ld.m_bUpdating), m_uiSectionID(ld.m_uiSectionID), @@ -485,7 +485,7 @@ // parse the pszName to get both the string id and checksum const wchar_t* pszChecksum = _tcschr(pszName, _T('[')); - if(pszChecksum == NULL) + if(pszChecksum == nullptr) { TRACE(_T("Warning! Old-style translation string %s.\n"), pszName); @@ -691,7 +691,7 @@ cfg.set_string(szTemp, strText.c_str()); } - if(pszPath == NULL) + if(pszPath == nullptr) pszPath = m_pszFilename; else SetFilename(pszPath); @@ -735,7 +735,7 @@ } } - return NULL; + return nullptr; } bool CLangData::Exists(unsigned int uiTranslationKey) const @@ -836,8 +836,8 @@ { if (*ppszDst) delete [] (*ppszDst); - const TCHAR* pszLast=NULL; - if ( (pszLast=_tcsrchr(pszSrc, _T('\\'))) != NULL) + const TCHAR* pszLast=nullptr; + if ( (pszLast=_tcsrchr(pszSrc, _T('\\'))) != nullptr) pszLast++; else pszLast=pszSrc; @@ -848,8 +848,8 @@ } CResourceManager::CResourceManager() : - m_pfnCallback(NULL), - m_hRes(NULL) + m_pfnCallback(nullptr), + m_hRes(nullptr) { InitializeCriticalSection(&m_cs); } @@ -966,7 +966,7 @@ EnterCriticalSection(&m_cs); // find resource - HGLOBAL hRet=NULL; + HGLOBAL hRet=nullptr; HRSRC hr=FindResource(m_hRes, pszName, pszType); if (hr) hRet=::LoadResource(m_hRes, hr); Index: src/libictranslate/cfg.cpp =================================================================== diff -u -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libictranslate/cfg.cpp (.../cfg.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) +++ src/libictranslate/cfg.cpp (.../cfg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -128,7 +128,7 @@ config::config(config_base_types eCfgType) : m_lock(), m_hProps((void*)new std::vector), - m_pszCurrentPath(NULL) + m_pszCurrentPath(nullptr) { switch(eCfgType) { @@ -337,8 +337,8 @@ m_lock.Lock(); // get the value for the property name - void* hFind=NULL; - if( (hFind=m_pCfgBase->find(pszName)) != NULL ) + void* hFind=nullptr; + if( (hFind=m_pCfgBase->find(pszName)) != nullptr ) { PROPINFO pi; while(m_pCfgBase->find_next(hFind, pi)) @@ -382,8 +382,8 @@ m_lock.Lock(); // get the value for the property name - void* hFind=NULL; - if( (hFind=m_pCfgBase->find(pszName)) != NULL ) + void* hFind=nullptr; + if( (hFind=m_pCfgBase->find(pszName)) != nullptr ) { PROPINFO pi; while(m_pCfgBase->find_next(hFind, pi)) @@ -424,8 +424,8 @@ m_lock.Lock(); // get the value for the property name - void* hFind=NULL; - if( (hFind=m_pCfgBase->find(pszName)) != NULL ) + void* hFind=nullptr; + if( (hFind=m_pCfgBase->find(pszName)) != nullptr ) { PROPINFO pi; while(m_pCfgBase->find_next(hFind, pi)) @@ -466,8 +466,8 @@ m_lock.Lock(); // get the value for the property name - void* hFind=NULL; - if( (hFind=m_pCfgBase->find(pszName)) != NULL ) + void* hFind=nullptr; + if( (hFind=m_pCfgBase->find(pszName)) != nullptr ) { PROPINFO pi; while(m_pCfgBase->find_next(hFind, pi)) @@ -608,7 +608,7 @@ const wchar_t* config::get_string(unsigned int uiProp, wchar_t* pszBuffer, size_t stBufferSize, size_t stIndex) { if(!pszBuffer || stBufferSize < 1) - return NULL; + return nullptr; m_lock.Lock(); if(uiProp >= m_pvProps->size()) @@ -787,8 +787,8 @@ (*it).clear_array(); // and fill with value(s) - void* hFind=NULL; - if( (hFind=m_pCfgBase->find((*it).get_name())) != NULL) + void* hFind=nullptr; + if( (hFind=m_pCfgBase->find((*it).get_name())) != nullptr) { PROPINFO pi; while(m_pCfgBase->find_next(hFind, pi)) Index: src/libictranslate/cfg.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libictranslate/cfg.h (.../cfg.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/libictranslate/cfg.h (.../cfg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -145,15 +145,15 @@ // setting property data /// Sets the value from the string - void set_value(unsigned int uiProp, const wchar_t* pszVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=NULL); + void set_value(unsigned int uiProp, const wchar_t* pszVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=nullptr); /// Sets the value of longlong_t-type property - void set_signed_num(unsigned int uiProp, long long llVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=NULL); + void set_signed_num(unsigned int uiProp, long long llVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=nullptr); /// Sets the value of ulonglong_t-type property - void set_unsigned_num(unsigned int uiProp, unsigned long long ullVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=NULL); + void set_unsigned_num(unsigned int uiProp, unsigned long long ullVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=nullptr); /// Sets the value of bool-type property - void set_bool(unsigned int uiProp, bool bVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=NULL); + void set_bool(unsigned int uiProp, bool bVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=nullptr); /// Sets the value of string-type property - void set_string(unsigned int uiProp, const wchar_t* pszVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=NULL); + void set_string(unsigned int uiProp, const wchar_t* pszVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=nullptr); /// Sets the string manually, without using registered properties; does not notify about change. void set_string(const wchar_t* pszName, const wchar_t* pszVal, property::actions a=property::action_replace); /**@}*/ Index: src/libictranslate/cfg_ini.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libictranslate/cfg_ini.cpp (.../cfg_ini.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/libictranslate/cfg_ini.cpp (.../cfg_ini.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -79,15 +79,15 @@ FILE* pFile=_tfopen(pszPath, _T("rt")); #endif - if(pFile == NULL) + if(pFile == nullptr) throw std::runtime_error("Cannot open file for reading"); // prepare buffer for data wchar_t* pszBuffer = new wchar_t[INI_BUFFER]; - wchar_t* pszLine = NULL; + wchar_t* pszLine = nullptr; bool bFirstLine = true; - while((pszLine = _fgetts(pszBuffer, INI_BUFFER, pFile)) != NULL) + while((pszLine = _fgetts(pszBuffer, INI_BUFFER, pFile)) != nullptr) { if(bFirstLine) { @@ -188,7 +188,7 @@ void ini_cfg::save(const wchar_t* pszPath) { FILE* pFile=_tfopen(pszPath, _T("wb")); - if(pFile == NULL) + if(pFile == nullptr) throw std::runtime_error("Cannot open file for writing"); // put BOM into the file @@ -246,11 +246,11 @@ * * \param[in] pszName - name of the property to search for(in the form of * "ch/program/startup" -* \return Handle to the search (NULL if not found). +* \return Handle to the search (nullptr if not found). */ void* ini_cfg::find(const wchar_t* pszName) { - if(pszName == NULL || pszName[0] == _T('*')) + if(pszName == nullptr || pszName[0] == _T('*')) { INIFINDHANDLE* pHandle = new INIFINDHANDLE; pHandle->bOnlyAttributes = false; @@ -266,11 +266,11 @@ std::wstring strSection; std::wstring strAttr; if(!parse_property_name(pszName, strSection, strAttr)) - return NULL; + return nullptr; ini_storage::iterator iterSection = m_pMainNode->find(strSection); if(iterSection == m_pMainNode->end()) - return NULL; + return nullptr; std::pair pairRange; if(strAttr == _T("*")) @@ -292,14 +292,14 @@ } } - return NULL; + return nullptr; } /** Finds the next string that belong to a specific key (as defined in * a call to find() function. * * \param[in] pFindHandle - handle to the search (as returned from find()) -* \return Pointer to a next string found, NULL if none. +* \return Pointer to a next string found, nullptr if none. */ bool ini_cfg::find_next(void* pFindHandle, PROPINFO& pi) { @@ -334,7 +334,7 @@ // section name pi.bGroup = true; pi.pszName = (*pfh->itSection++).first.c_str(); - pi.pszValue = NULL; + pi.pszValue = nullptr; return true; } else @@ -436,7 +436,7 @@ */ void ini_cfg::clear(const wchar_t* pszName) { - if(pszName == NULL || pszName[0] == _T('*')) + if(pszName == nullptr || pszName[0] == _T('*')) m_pMainNode->clear(); else { Index: src/libictranslate/config_property.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libictranslate/config_property.cpp (.../config_property.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/libictranslate/config_property.cpp (.../config_property.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -33,7 +33,7 @@ */ property::property() : m_uiPropType(type_unknown | flag_none), - m_pszName(NULL) + m_pszName(nullptr) { memset(&m_val, 0, sizeof(_VALUE)); memset(&m_range, 0, sizeof(_RANGE)); @@ -45,7 +45,7 @@ */ property::property(const wchar_t* pszName, unsigned int uiType) : m_uiPropType(uiType), - m_pszName(NULL) + m_pszName(nullptr) { memset(&m_val, 0, sizeof(_VALUE)); memset(&m_range, 0, sizeof(_RANGE)); @@ -89,7 +89,7 @@ { // delete the property name delete [] m_pszName; - m_pszName=NULL; + m_pszName=nullptr; clear_value(); @@ -324,7 +324,7 @@ /** Retrieves the value as a string. * * \param[out] pszString - pointer to a string that will receive the value (could - * be NULL when retrieving string value type) + * be nullptr when retrieving string value type) * \param[in] stMaxSize - size of the buffer (could be 0 for string value retrieval) * \param[in] stIndex - an index at which to get the value (only meaningful * for array property type). @@ -764,7 +764,7 @@ /** Completely clears the value part internal members. * Unallocates all the memory associated with values and sets - * those members to NULL. + * those members to nullptr. */ void property::clear_value() { @@ -788,15 +788,15 @@ assert(false); // unhandled property type } - m_val.hArray=NULL; + m_val.hArray=nullptr; } else { switch(m_uiPropType & mask_type) { case type_string: delete [] m_val.pszVal; - m_val.pszVal=NULL; + m_val.pszVal=nullptr; break; case type_signed_num: m_val.llVal=0LL; @@ -888,7 +888,7 @@ return psz; } else - return NULL; + return nullptr; } /** Converts a string to a boolean value. Index: src/libictranslate/crc32.cpp =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libictranslate/crc32.cpp (.../crc32.cpp) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/libictranslate/crc32.cpp (.../crc32.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -100,7 +100,7 @@ */ inline void __crc32partial(char byte, unsigned int *pdwCrc32) { -// assert(pdwCrc32 != NULL); +// assert(pdwCrc32 != nullptr); *pdwCrc32 = ((*pdwCrc32) >> 8) ^ __crc32data__[byte ^ ((*pdwCrc32) & 0x000000FF)]; } Index: src/libictranslate/dllmain.cpp =================================================================== diff -u -r8443d0d98d380facaf07b540c8d98da08365b816 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/libictranslate/dllmain.cpp (.../dllmain.cpp) (revision 8443d0d98d380facaf07b540c8d98da08365b816) +++ src/libictranslate/dllmain.cpp (.../dllmain.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -27,7 +27,7 @@ #define new DEBUG_NEW #endif -static AFX_EXTENSION_MODULE libictranslateDLL = { NULL, NULL }; +static AFX_EXTENSION_MODULE libictranslateDLL = { 0 }; extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) Index: src/rc2lng/crc32.cpp =================================================================== diff -u -ra380f7b2ae7d8fe6121e2d0a026b98ee2248c8b5 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/rc2lng/crc32.cpp (.../crc32.cpp) (revision a380f7b2ae7d8fe6121e2d0a026b98ee2248c8b5) +++ src/rc2lng/crc32.cpp (.../crc32.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -102,7 +102,7 @@ */ inline void __crc32partial(char byte, unsigned int *pdwCrc32) { -// assert(pdwCrc32 != NULL); +// assert(pdwCrc32 != nullptr); *pdwCrc32 = ((*pdwCrc32) >> 8) ^ __crc32data__[byte ^ ((*pdwCrc32) & 0x000000FF)]; } Index: src/rc2lng/rc.cpp =================================================================== diff -u -r5446395d3925e49d3e4cba82044bdfd4dffb6ee9 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/rc2lng/rc.cpp (.../rc.cpp) (revision 5446395d3925e49d3e4cba82044bdfd4dffb6ee9) +++ src/rc2lng/rc.cpp (.../rc.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -105,7 +105,7 @@ for(group_map::iterator itGroup = m_mapOutputLanguage.begin(); itGroup != m_mapOutputLanguage.end(); ++itGroup) { // write section header - AddTranslationLine(eLine_Group, (*itGroup).first, NULL, vData); + AddTranslationLine(eLine_Group, (*itGroup).first, nullptr, vData); // and key=value assignment element_map& rElementMap = (*itGroup).second; @@ -582,15 +582,15 @@ CRCFile::element_map* CRCFile::GetElementMap(UINT uiGroup) { // insert menu if does not exist - element_map* pElementMap = NULL; + element_map* pElementMap = nullptr; group_map::iterator itGroup = m_mapOutputLanguage.find(uiGroup); if(itGroup == m_mapOutputLanguage.end()) { std::pair pairGroup = m_mapOutputLanguage.insert(std::make_pair(uiGroup, element_map())); if(!pairGroup.second) { _ASSERTE(false); - return NULL; + return nullptr; } pElementMap = &(*(pairGroup.first)).second; @@ -601,7 +601,7 @@ if(!pElementMap) { _ASSERTE(false); - return NULL; + return nullptr; } return pElementMap; Index: src/rc2lng/rc2lng.cpp =================================================================== diff -u -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/rc2lng/rc2lng.cpp (.../rc2lng.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) +++ src/rc2lng/rc2lng.cpp (.../rc2lng.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -36,10 +36,10 @@ int _tmain(int argc, TCHAR* argv[], TCHAR* /*envp*/[]) { // initialize MFC and print and error on failure - HMODULE hModule = ::GetModuleHandle(NULL); + HMODULE hModule = ::GetModuleHandle(nullptr); if(!hModule) return -1; - if (!AfxWinInit(hModule, NULL, ::GetCommandLine(), 0)) + if (!AfxWinInit(hModule, nullptr, ::GetCommandLine(), 0)) { cerr << _T("Fatal Error: MFC initialization failed") << endl; return 1;