Index: src/ch/AsyncHttpFile.cpp =================================================================== diff -u -r16ea740ddcaeb5a99dc90061ae0f0a2f89aa0d74 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/AsyncHttpFile.cpp (.../AsyncHttpFile.cpp) (revision 16ea740ddcaeb5a99dc90061ae0f0a2f89aa0d74) +++ src/ch/AsyncHttpFile.cpp (.../AsyncHttpFile.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -100,7 +100,7 @@ ATLTRACE(L"InternetOpen failed with error: %lu\n", dwError); SetErrorCode(dwError); - ::CloseHandle(m_hFinishedEvent); + CloseHandle(m_hFinishedEvent); m_hFinishedEvent = nullptr; return E_FAIL; @@ -112,8 +112,8 @@ ATLTRACE(L"InternetSetStatusCallback failed with error: %lu\n", dwError); SetErrorCode(dwError); - ::InternetCloseHandle(m_hInternet); - ::CloseHandle(m_hFinishedEvent); + InternetCloseHandle(m_hInternet); + CloseHandle(m_hFinishedEvent); m_hFinishedEvent = nullptr; return E_FAIL; @@ -128,9 +128,9 @@ SetErrorCode(dwError); if(GetErrorCode() != ERROR_IO_PENDING) { - ::InternetSetStatusCallback(m_hInternet, nullptr); - ::InternetCloseHandle(m_hInternet); - ::CloseHandle(m_hFinishedEvent); + InternetSetStatusCallback(m_hInternet, nullptr); + InternetCloseHandle(m_hInternet); + CloseHandle(m_hFinishedEvent); m_hInternet = nullptr; m_hFinishedEvent = nullptr; @@ -141,7 +141,7 @@ else { SetUrlHandle(hOpenUrl); - ::SetEvent(m_hFinishedEvent); + SetEvent(m_hFinishedEvent); } return hOpenUrl ? S_OK : S_FALSE; @@ -199,7 +199,7 @@ SetErrorCode(ERROR_SUCCESS); - if(!::ResetEvent(m_hFinishedEvent)) + if(!ResetEvent(m_hFinishedEvent)) { SetErrorCode(GetLastError()); return E_FAIL; @@ -213,19 +213,18 @@ // #WinXP #workaround - in bare WinXP SP3 (i.e. without additional updates), InternetReadFileExW returns // error 120 (not implemented); it was implemented with some later update - if(!::InternetReadFileExA(m_hOpenUrl, &m_internetBuffers, IRF_NO_WAIT, (DWORD_PTR)&m_tReadRequest)) + if(!InternetReadFileExA(m_hOpenUrl, &m_internetBuffers, IRF_NO_WAIT, (DWORD_PTR)&m_tReadRequest)) { DWORD dwError = GetLastError(); ATLTRACE(L"InternetReadFileExA failed with error: %lu\n", dwError); SetErrorCode(dwError); if(GetErrorCode() == ERROR_IO_PENDING) return S_FALSE; - else - return E_FAIL; + return E_FAIL; } - if(!::SetEvent(m_hFinishedEvent)) + if(!SetEvent(m_hFinishedEvent)) { SetErrorCode(GetLastError()); return E_FAIL; @@ -269,13 +268,13 @@ if(m_hInternet != nullptr) { - ::InternetCloseHandle(m_hInternet); + InternetCloseHandle(m_hInternet); m_hInternet = nullptr; } if(m_hFinishedEvent) { - ::CloseHandle(m_hFinishedEvent); + CloseHandle(m_hFinishedEvent); m_hFinishedEvent = nullptr; } @@ -302,9 +301,9 @@ HANDLE hHandles[] = { m_hFinishedEvent }; DWORD dwEffect = WaitForMultipleObjects(1, hHandles, FALSE, 0); if(dwEffect == WAIT_OBJECT_0 + 0 || dwEffect == WAIT_ABANDONED_0 + 0) - return GetErrorCode() == ERROR_SUCCESS ? CAsyncHttpFile::eFinished : CAsyncHttpFile::eError; - else - return CAsyncHttpFile::ePending; + return GetErrorCode() == ERROR_SUCCESS ? eFinished : eError; + + return ePending; } // ============================================================================ @@ -325,14 +324,14 @@ ATLTRACE(L"WaitForMultipleObjects failed with error: %lu\n", dwError); SetErrorCode(dwError); - return CAsyncHttpFile::eError; + return eError; } - else if(dwEffect == WAIT_OBJECT_0 + 0 || dwEffect == WAIT_ABANDONED_0 + 0) - return CAsyncHttpFile::eKilled; - else if(dwEffect == WAIT_OBJECT_0 + 1 || dwEffect == WAIT_ABANDONED_0 + 1) - return GetErrorCode() == ERROR_SUCCESS ? CAsyncHttpFile::eFinished : CAsyncHttpFile::eError; - else - return CAsyncHttpFile::eTimeout; + if(dwEffect == WAIT_OBJECT_0 + 0 || dwEffect == WAIT_ABANDONED_0 + 0) + return eKilled; + if(dwEffect == WAIT_OBJECT_0 + 1 || dwEffect == WAIT_ABANDONED_0 + 1) + return GetErrorCode() == ERROR_SUCCESS ? eFinished : eError; + + return eTimeout; } // ============================================================================ @@ -353,7 +352,7 @@ if(!pRequest || !pRequest->pHttpFile) return; - logger::TLoggerPtr spLog = logger::MakeLogger(GetLogFileData(), L"AsyncHttpFile"); + logger::TLoggerPtr spLog = MakeLogger(GetLogFileData(), L"AsyncHttpFile"); CString strMsg; strMsg.Format(_T("InternetStatusCallback - hInternet: %p, dwContext: %Iu (operation: %lu), dwInternetStatus: %lu, lpvStatusInformation: %p, dwStatusInformationLength: %lu"), hInternet, (size_t)dwContext, pRequest->eOperationType, dwInternetStatus, lpvStatusInformation, dwStatusInformationLength); @@ -411,7 +410,7 @@ void CAsyncHttpFile::SetUrlHandle(HANDLE hOpenUrl) { if(m_hOpenUrl && m_hOpenUrl != hOpenUrl) - ::InternetCloseHandle(m_hOpenUrl); + InternetCloseHandle(m_hOpenUrl); m_hOpenUrl = hOpenUrl; } @@ -444,6 +443,6 @@ return E_FAIL; if(dwCurrentState == INTERNET_STATUS_REQUEST_COMPLETE) - return ::SetEvent(m_hFinishedEvent) ? S_OK : E_FAIL; + return SetEvent(m_hFinishedEvent) ? S_OK : E_FAIL; return S_FALSE; } Index: src/ch/ClipboardMonitor.cpp =================================================================== diff -u -r3921d82d9605d98b2281f3f42d9f9c8385b89a3e -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision 3921d82d9605d98b2281f3f42d9f9c8385b89a3e) +++ src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -174,13 +174,11 @@ BOOL bExit=ExitWindowsEx(EWX_POWEROFF | EWX_SHUTDOWN | (GetPropValue(GetConfig()) ? EWX_FORCE : 0), 0); if (bExit) return 1; - else - { - // some kind of error - ictranslate::CFormat fmt(GetResManager().LoadString(IDS_SHUTDOWNERROR_STRING)); - fmt.SetParam(_T("%errno"), GetLastError()); - AfxMessageBox(fmt.ToString(), MB_ICONERROR | MB_OK | MB_SYSTEMMODAL); - } + + // some kind of error + ictranslate::CFormat fmt(GetResManager().LoadString(IDS_SHUTDOWNERROR_STRING)); + fmt.SetParam(_T("%errno"), GetLastError()); + AfxMessageBox(fmt.ToString(), MB_ICONERROR | MB_OK | MB_SYSTEMMODAL); } } } Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -r3921d82d9605d98b2281f3f42d9f9c8385b89a3e -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 3921d82d9605d98b2281f3f42d9f9c8385b89a3e) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -431,11 +431,9 @@ pos = m_ctlFiles.GetFirstSelectedItemPosition(); if (pos == nullptr) break; - else - { - iItem=m_ctlFiles.GetNextSelectedItem(pos); - m_ctlFiles.DeleteItem(iItem); - } + + iItem=m_ctlFiles.GetNextSelectedItem(pos); + m_ctlFiles.DeleteItem(iItem); } } @@ -709,12 +707,10 @@ pos=m_ctlFilters.GetFirstSelectedItemPosition(); if (pos == nullptr) break; - else - { - iItem=m_ctlFilters.GetNextSelectedItem(pos); - m_ctlFilters.DeleteItem(iItem); - afFilters.RemoveAt(iItem); - } + + iItem=m_ctlFilters.GetNextSelectedItem(pos); + m_ctlFilters.DeleteItem(iItem); + afFilters.RemoveAt(iItem); } } Index: src/ch/DirTreeCtrl.cpp =================================================================== diff -u -r3921d82d9605d98b2281f3f42d9f9c8385b89a3e -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/DirTreeCtrl.cpp (.../DirTreeCtrl.cpp) (revision 3921d82d9605d98b2281f3f42d9f9c8385b89a3e) +++ src/ch/DirTreeCtrl.cpp (.../DirTreeCtrl.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -589,8 +589,8 @@ lpsf->Release(); return true; } - else - return false; + + return false; } //////////////////////////////////////////////////////////////////////////// @@ -611,14 +611,12 @@ if (!bNetwork) return SetLocalPath(lpszPath); - else - { - // we don't look in net neighborhood for speed reasons - EnsureVisible(m_hNetwork); + + // we don't look in net neighborhood for speed reasons + EnsureVisible(m_hNetwork); // SelectItem(m_hNetwork); // ExpandItem(m_hNetwork, TVE_EXPAND); - return true; - } + return true; } @@ -706,8 +704,8 @@ return strSrc == strFnd; } - else - return false; + + return false; } //////////////////////////////////////////////////////////////////////////// Index: src/ch/FolderDialog.cpp =================================================================== diff -u -r3921d82d9605d98b2281f3f42d9f9c8385b89a3e -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision 3921d82d9605d98b2281f3f42d9f9c8385b89a3e) +++ src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -574,8 +574,8 @@ { if (!InitModalIndirect((LPCDLGTEMPLATE)__g_DlgTemplate)) return -1; - else - return ictranslate::CLanguageDialog::DoModal(); + + return ictranslate::CLanguageDialog::DoModal(); } /////////////////////////////////////////////////////////////////////////// Index: src/ch/MainWnd.cpp =================================================================== diff -u -r3921d82d9605d98b2281f3f42d9f9c8385b89a3e -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 3921d82d9605d98b2281f3f42d9f9c8385b89a3e) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -539,10 +539,10 @@ GetPropValue(rConfig, dlg.m_vRecent); - INT_PTR iModalResult; - if((iModalResult = dlg.DoModal()) == IDCANCEL) + INT_PTR iModalResult = dlg.DoModal(); + if(iModalResult == IDCANCEL) return CWnd::OnCopyData(pWnd, pCopyDataStruct); - else if(iModalResult == -1) // windows has been closed by a parent + if(iModalResult == -1) // windows has been closed by a parent return TRUE; TRecentPathsTools::AddNewPath(dlg.m_vRecent, dlg.m_tTaskDefinition.GetDestinationPath().ToString()); Index: src/ch/ProgressListBox.cpp =================================================================== diff -u -re98c03b108baad889dfd7c7fbb1a49f5ea5a55d8 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/ProgressListBox.cpp (.../ProgressListBox.cpp) (revision e98c03b108baad889dfd7c7fbb1a49f5ea5a55d8) +++ src/ch/ProgressListBox.cpp (.../ProgressListBox.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -173,13 +173,11 @@ { if(boost::numeric_cast(m_vItems.size()) > iIndex) return m_vItems.at(iIndex); - else - { - _PROGRESSITEM_* pItem=new _PROGRESSITEM_; - pItem->m_uiRange=100; - m_vItems.push_back(pItem); - return pItem; - } + + _PROGRESSITEM_* pItem=new _PROGRESSITEM_; + pItem->m_uiRange=100; + m_vItems.push_back(pItem); + return pItem; } void CProgressListBox::UpdateItems(int nLimit, bool bUpdateSize) Index: src/ch/PropertyListCtrl.cpp =================================================================== diff -u -r8068e0c351055554340ac9755d1bc846893bf2b8 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) +++ src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -271,8 +271,8 @@ if(m_pBkPropertyBrush) return (HBRUSH)(m_pBkPropertyBrush->GetSafeHandle() ); - else - return hbr; + + return hbr; } void CPropertyListCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) { Index: src/ch/StatusDlg.cpp =================================================================== diff -u -r3921d82d9605d98b2281f3f42d9f9c8385b89a3e -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision 3921d82d9605d98b2281f3f42d9f9c8385b89a3e) +++ src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -111,25 +111,25 @@ lvc.mask=LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; lvc.fmt=LVCFMT_LEFT; - lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSTATUS_STRING); /*_T("Status")*/; + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSTATUS_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=-1; m_ctlStatusList.InsertColumn(1, &lvc); - lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSOURCE_STRING);/*_T("File");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSOURCE_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.3*iWidth); lvc.iSubItem=0; m_ctlStatusList.InsertColumn(2, &lvc); - lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNDESTINATION_STRING);/*_T("To:");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNDESTINATION_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=1; m_ctlStatusList.InsertColumn(3, &lvc); - lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNPROGRESS_STRING);/*_T("Progress");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNPROGRESS_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.15*iWidth); lvc.iSubItem=2; @@ -811,25 +811,25 @@ lvc.mask=LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; lvc.fmt=LVCFMT_LEFT; - lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSTATUS_STRING); /*_T("Status")*/; + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSTATUS_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=-1; m_ctlStatusList.InsertColumn(1, &lvc); - lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSOURCE_STRING);/*_T("File");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSOURCE_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.3*iWidth); lvc.iSubItem=0; m_ctlStatusList.InsertColumn(2, &lvc); - lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNDESTINATION_STRING);/*_T("To:");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNDESTINATION_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=1; m_ctlStatusList.InsertColumn(3, &lvc); - lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNPROGRESS_STRING);/*_T("Progress");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNPROGRESS_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.15*iWidth); lvc.iSubItem=2; @@ -1043,14 +1043,14 @@ { if(eSubtask == chengine::eSubOperation_Deleting) return GetResManager().LoadString(IDS_STATUS_DELETING_STRING); - else if(eSubtask == chengine::eSubOperation_Scanning) + if(eSubtask == chengine::eSubOperation_Scanning) return GetResManager().LoadString(IDS_STATUS_SEARCHING_STRING); - else if(eSubtask == chengine::eSubOperation_FastMove) + if(eSubtask == chengine::eSubOperation_FastMove) return GetResManager().LoadString(IDS_STATUS_FASTMOVE_STRING); - else if(eSubtask == chengine::eSubOperation_Copying) + if(eSubtask == chengine::eSubOperation_Copying) return GetResManager().LoadString(IDS_STATUS_COPYING_STRING); - else - return GetResManager().LoadString(IDS_STATUS_UNKNOWN_STRING); + + return GetResManager().LoadString(IDS_STATUS_UNKNOWN_STRING); } void CStatusDlg::SetTaskListEntry(size_t stPos, const chengine::TTaskStatsSnapshotPtr& spTaskStats) @@ -1078,7 +1078,7 @@ if(strCurrentPath.IsEmpty()) strCurrentPath = GetResManager().LoadString(IDS_NONEINPUTFILE_STRING); - lvi.pszText = (PTSTR)strCurrentPath.c_str();; + lvi.pszText = (PTSTR)strCurrentPath.c_str(); lvi.cchTextMax = lstrlen(lvi.pszText); m_ctlStatusList.SetItem(&lvi); Index: src/ch/TShellExtensionClient.cpp =================================================================== diff -u -rd9527df01ee91b35d9a5fdccb80ded25a9c8265f -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/TShellExtensionClient.cpp (.../TShellExtensionClient.cpp) (revision d9527df01ee91b35d9a5fdccb80ded25a9c8265f) +++ src/ch/TShellExtensionClient.cpp (.../TShellExtensionClient.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -168,7 +168,7 @@ int iTries = 3; do { - LOG_DEBUG(GetLogger()) << L"Trying to enable native shell extension";; + LOG_DEBUG(GetLogger()) << L"Trying to enable native shell extension"; hResult = EnableExtensionIfCompatible(lClientVersion, rlExtensionVersion, rstrExtensionStringVersion); if(hResult == REGDB_E_CLASSNOTREG) { @@ -180,7 +180,7 @@ if(FAILED(hResult)) { - LOG_INFO(GetLogger()) << L"Shell Extension requires system restart";; + LOG_INFO(GetLogger()) << L"Shell Extension requires system restart"; eResult = eSuccessNeedRestart; } } Index: src/ch/Theme Helpers.cpp =================================================================== diff -u -r8068e0c351055554340ac9755d1bc846893bf2b8 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/Theme Helpers.cpp (.../Theme Helpers.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) +++ src/ch/Theme Helpers.cpp (.../Theme Helpers.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -44,8 +44,8 @@ if (pfnProc) return (*pfnProc)(hwnd, pszClassList); - else - return nullptr; + + return nullptr; } HRESULT CUxThemeSupport::CloseThemeData(HTHEME hTheme) @@ -58,8 +58,8 @@ if (pfnProc) return (*pfnProc)(hTheme); - else - return E_UNEXPECTED; + + return E_UNEXPECTED; } HRESULT CUxThemeSupport::DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pDestRect, UINT uEdge, UINT uFlags, RECT* pContentRect) @@ -72,8 +72,8 @@ if (pfnProc) return (*pfnProc)(hTheme, hdc, iPartId, iStateId, pDestRect, uEdge, uFlags, pContentRect); - else - return E_UNEXPECTED; + + return E_UNEXPECTED; } HRESULT CUxThemeSupport::DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect) @@ -86,8 +86,8 @@ if (pfnProc) return (*pfnProc)(hTheme, hdc, iPartId, iStateId, pRect, pClipRect); - else - return E_UNEXPECTED; + + return E_UNEXPECTED; } HRESULT CUxThemeSupport::DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc) @@ -100,8 +100,8 @@ if (pfnProc) return (*pfnProc)(hwnd, hdc, prc); - else - return E_UNEXPECTED; + + return E_UNEXPECTED; } BOOL CUxThemeSupport::IsAppThemed() @@ -114,6 +114,6 @@ if (pfnProc) return (*pfnProc)(); - else - return FALSE; + + return FALSE; } Index: src/ch/UpdateChecker.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/UpdateChecker.cpp (.../UpdateChecker.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/ch/UpdateChecker.cpp (.../UpdateChecker.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -41,7 +41,7 @@ { m_hKillEvent = ::CreateEvent(nullptr, FALSE, FALSE, nullptr); BOOST_ASSERT(m_hKillEvent); - ::InitializeCriticalSection(&m_cs); + InitializeCriticalSection(&m_cs); } // ============================================================================ @@ -61,9 +61,9 @@ } if(m_hKillEvent) - ::CloseHandle(m_hKillEvent); + CloseHandle(m_hKillEvent); - ::DeleteCriticalSection(&m_cs); + DeleteCriticalSection(&m_cs); } bool CUpdateChecker::AsyncCheckForUpdates(const wchar_t* pszSite, const wchar_t* pszLanguage, UpdateVersionInfo::EVersionType eUpdateChannel, bool bOnlyIfConnected, bool bSendHeaders) @@ -78,17 +78,17 @@ if(bOnlyIfConnected && !InternetGetConnectedState(&dwConnectionFlags, 0)) return false; - ::EnterCriticalSection(&m_cs); + EnterCriticalSection(&m_cs); m_strSite = pszSite; m_eResult = eResult_Undefined; m_eUpdateChannel = eUpdateChannel; m_strLanguage = pszLanguage; m_bSendHeaders = bSendHeaders; - ::LeaveCriticalSection(&m_cs); + LeaveCriticalSection(&m_cs); - ::ResetEvent(m_hKillEvent); + ResetEvent(m_hKillEvent); m_hThread = CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)&CUpdateChecker::UpdateCheckThread, (void*)this, 0, nullptr); if(!m_hThread) @@ -111,19 +111,19 @@ if(m_hThread) { if(m_hKillEvent) - ::SetEvent(m_hKillEvent); + SetEvent(m_hKillEvent); DWORD dwResult = WaitForSingleObject(m_hThread, 5000); if (dwResult == WAIT_TIMEOUT || dwResult == WAIT_FAILED) throw std::exception("Failed to stop update checker thread."); m_hThread = nullptr; } - ::ResetEvent(m_hKillEvent); + ResetEvent(m_hKillEvent); m_httpFile.Close(); - ::EnterCriticalSection(&m_cs); + EnterCriticalSection(&m_cs); m_strSite.Empty(); m_eUpdateChannel = UpdateVersionInfo::eStable; @@ -134,10 +134,10 @@ m_strReleaseDate.Empty(); m_strDownloadAddress.Empty(); m_strReleaseNotes.Empty(); - m_eResult = CUpdateChecker::eResult_Undefined; + m_eResult = eResult_Undefined; m_bSendHeaders = true; - ::LeaveCriticalSection(&m_cs); + LeaveCriticalSection(&m_cs); } // ============================================================================ @@ -154,12 +154,12 @@ if(eCheckResult == eResult_Error && dwError != 0) strError = chcore::TWin32ErrorFormatter::FormatWin32ErrorCodeWithFallback(dwError, _T("wininet.dll"), true); - ::EnterCriticalSection(&m_cs); + EnterCriticalSection(&m_cs); m_eResult = eCheckResult; m_strLastError = strError.c_str(); - ::LeaveCriticalSection(&m_cs); + LeaveCriticalSection(&m_cs); } // ============================================================================ @@ -171,9 +171,9 @@ // ============================================================================ void CUpdateChecker::SetLastError(PCTSTR pszError) { - ::EnterCriticalSection(&m_cs); + EnterCriticalSection(&m_cs); m_strLastError = pszError; - ::LeaveCriticalSection(&m_cs); + LeaveCriticalSection(&m_cs); } // ============================================================================ @@ -187,27 +187,27 @@ // ============================================================================ void CUpdateChecker::SetVersionsAndAddress(PCTSTR pszAddress, PCTSTR pszNumericVersion, PCTSTR pszReadableVersion, PCTSTR pszReleaseDate, PCTSTR pszReleaseNotes) { - ::EnterCriticalSection(&m_cs); + EnterCriticalSection(&m_cs); m_strDownloadAddress = pszAddress; m_strNumericVersion = pszNumericVersion; m_strReadableVersion = pszReadableVersion; m_strReleaseDate = pszReleaseDate; m_strReleaseNotes = pszReleaseNotes; - ::LeaveCriticalSection(&m_cs); + LeaveCriticalSection(&m_cs); } void CUpdateChecker::SetSendHeaders(bool bSendHeaders) { - ::EnterCriticalSection(&m_cs); + EnterCriticalSection(&m_cs); m_bSendHeaders = bSendHeaders; - ::LeaveCriticalSection(&m_cs); + LeaveCriticalSection(&m_cs); } CString CUpdateChecker::GetSiteAddress() const { - ::EnterCriticalSection(&m_cs); + EnterCriticalSection(&m_cs); CString strAddress = m_strSite; - ::LeaveCriticalSection(&m_cs); + LeaveCriticalSection(&m_cs); return strAddress; } @@ -221,9 +221,9 @@ // ============================================================================ UpdateVersionInfo::EVersionType CUpdateChecker::GetUpdateChannel() { - ::EnterCriticalSection(&m_cs); + EnterCriticalSection(&m_cs); UpdateVersionInfo::EVersionType eUpdateChannel = m_eUpdateChannel; - ::LeaveCriticalSection(&m_cs); + LeaveCriticalSection(&m_cs); return eUpdateChannel; } @@ -237,9 +237,9 @@ // ============================================================================ CUpdateChecker::ECheckResult CUpdateChecker::GetResult() const { - ::EnterCriticalSection(&m_cs); + EnterCriticalSection(&m_cs); ECheckResult eResult = m_eResult; - ::LeaveCriticalSection(&m_cs); + LeaveCriticalSection(&m_cs); return eResult; } Index: src/ch/ch.cpp =================================================================== diff -u -r3921d82d9605d98b2281f3f42d9f9c8385b89a3e -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/ch.cpp (.../ch.cpp) (revision 3921d82d9605d98b2281f3f42d9f9c8385b89a3e) +++ src/ch/ch.cpp (.../ch.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -130,7 +130,7 @@ return tCfg; } -int MsgBox(UINT uiID, UINT nType, UINT nIDHelp) +int CCopyHandlerApp::MsgBox(UINT uiID, UINT nType, UINT nIDHelp) { return AfxMessageBox(GetResManager().LoadString(uiID), nType, nIDHelp); } @@ -368,12 +368,10 @@ return FALSE; } - else - { - LOG_WARNING(m_spLog) << _T("Other instance of Copy Handler is already running. Exiting."); - MsgBox(IDS_ONECOPY_STRING, MB_OK | MB_ICONWARNING); - return FALSE; - } + + LOG_WARNING(m_spLog) << _T("Other instance of Copy Handler is already running. Exiting."); + MsgBox(IDS_ONECOPY_STRING, MB_OK | MB_ICONWARNING); + return FALSE; } // ================================= Common controls ======================================== @@ -704,8 +702,8 @@ strAdd += pszFile; return ::HtmlHelp(hwndCaller, strAdd, uCommand, dwData); } - else - return ::HtmlHelp(hwndCaller, pszPath, uCommand, dwData); + + return ::HtmlHelp(hwndCaller, pszPath, uCommand, dwData); } void CCopyHandlerApp::HtmlHelp(DWORD_PTR dwData, UINT nCmd) Index: src/ch/ch.h =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/ch.h (.../ch.h) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/ch/ch.h (.../ch.h) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -41,7 +41,7 @@ PCTSTR GetHelpPath() const { return m_pszHelpFilePath; } - friend int MsgBox(UINT uiID, UINT nType=MB_OK, UINT nIDHelp=0); + static int MsgBox(UINT uiID, UINT nType=MB_OK, UINT nIDHelp=0); friend CCopyHandlerApp& GetApplication(); static ictranslate::CResourceManager& GetResManager(); @@ -113,4 +113,9 @@ return GetApp().GetShellExtensionConfig(); } +inline int MsgBox(UINT uiID, UINT nType = MB_OK, UINT nIDHelp = 0) +{ + return GetApp().MsgBox(uiID, nType, nIDHelp); +} + #endif Index: src/ch/shortcuts.cpp =================================================================== diff -u -r3921d82d9605d98b2281f3f42d9f9c8385b89a3e -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ch/shortcuts.cpp (.../shortcuts.cpp) (revision 3921d82d9605d98b2281f3f42d9f9c8385b89a3e) +++ src/ch/shortcuts.cpp (.../shortcuts.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -33,8 +33,8 @@ return true; } - else - return false; + + return false; } CShortcut::CShortcut(const CString& strText) @@ -46,6 +46,6 @@ { if (m_strPath.IsEmpty()) return _T(""); - else - return m_strName+_T("|")+m_strPath; + + return m_strName+_T("|")+m_strPath; } Index: src/chext/DropMenuExt.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/chext/DropMenuExt.cpp (.../DropMenuExt.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/chext/DropMenuExt.cpp (.../DropMenuExt.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -230,7 +230,7 @@ HRESULT hResult = ShellExtensionVerifier::IsShellExtEnabled(m_piShellExtControl); if(FAILED(hResult)) return hResult; - else if(hResult == S_FALSE) + if(hResult == S_FALSE) return S_OK; TShellMenuItemPtr spSelectedItem = m_tContextMenuHandler.GetCommandByMenuItemOffset(LOWORD(idCmd)); Index: src/chext/MenuExt.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -425,7 +425,7 @@ HRESULT hResult = ShellExtensionVerifier::IsShellExtEnabled(m_piShellExtControl); if(FAILED(hResult)) return hResult; - else if(hResult == S_FALSE) + if(hResult == S_FALSE) return S_OK; TShellMenuItemPtr spSelectedItem = m_tContextMenuHandler.GetCommandByMenuItemOffset(LOWORD(idCmd)); Index: src/chext/TContextMenuHandler.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/chext/TContextMenuHandler.cpp (.../TContextMenuHandler.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/chext/TContextMenuHandler.cpp (.../TContextMenuHandler.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -158,6 +158,6 @@ std::map::iterator iter = m_mapMenuItems.find(uiID); if(iter != m_mapMenuItems.end()) return (*iter).second; - else - return TShellMenuItemPtr(); + + return TShellMenuItemPtr(); } Index: src/ictranslate/ICTranslateDlg.cpp =================================================================== diff -u -r12ee49f6bf1f8921500ee2078e0a8c2d7b6d2a45 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/ictranslate/ICTranslateDlg.cpp (.../ICTranslateDlg.cpp) (revision 12ee49f6bf1f8921500ee2078e0a8c2d7b6d2a45) +++ src/ictranslate/ICTranslateDlg.cpp (.../ICTranslateDlg.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -584,10 +584,10 @@ if(uiID1 < uiID2) return -1; - else if(uiID1 == uiID2) + if(uiID1 == uiID2) return 0; - else - return 1; + + return 1; } void CICTranslateDlg::OnBnClickedCopyButton() @@ -789,8 +789,8 @@ int iRes = AfxMessageBox(_T("You have modified the translation file. If you continue, the changes might be lost. Do you want to continue ?"), MB_YESNO | MB_ICONQUESTION); return iRes == IDYES; } - else - return true; + + return true; } void CICTranslateDlg::OnCancel() Index: src/libchcore/TPath.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchcore/TPath.cpp (.../TPath.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchcore/TPath.cpp (.../TPath.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -243,8 +243,8 @@ { if (bCaseSensitive) return m_strPath.Compare(rPath.m_strPath); - else - return m_strPath.CompareNoCase(rPath.m_strPath); + + return m_strPath.CompareNoCase(rPath.m_strPath); } // ============================================================================ @@ -299,8 +299,8 @@ { if (bCaseSensitive) return m_strPath.StartsWith(rPath.m_strPath.c_str()); - else - return m_strPath.StartsWithNoCase(rPath.m_strPath.c_str()); + + return m_strPath.StartsWithNoCase(rPath.m_strPath.c_str()); } // ============================================================================ @@ -325,8 +325,8 @@ m_strPath.Delete(0, rReferenceBasePath.m_strPath.GetLength()); return true; } - else - return false; + + return false; } bool TSmartPath::MakeAbsolutePath(const TSmartPath& rReferenceBasePath) @@ -445,8 +445,8 @@ { if (m_strPath.GetLength() == 2) return *this; - else - return PathFromWString(m_strPath.Left(2)); // c: for c:\windows\test.cpp + + return PathFromWString(m_strPath.Left(2)); // c: for c:\windows\test.cpp } return TSmartPath(); @@ -689,8 +689,8 @@ size_t stIndex = m_strPath.FindLastOf(_T("\\/")); if (stIndex == TString::npos) // no path separator? return true; - else - return (stIndex != TString::npos && stIndex != m_strPath.GetLength() - 1); + + return (stIndex != TString::npos && stIndex != m_strPath.GetLength() - 1); } // ============================================================================ @@ -705,8 +705,8 @@ size_t stIndex = m_strPath.FindLastOf(_T("\\/")); if (stIndex != TString::npos) return PathFromWString(m_strPath.MidRange(stIndex + 1, m_strPath.GetLength())); // "test.txt" for "c:\windows\test.txt" - else - return *this; + + return *this; } // ============================================================================ Index: src/libchcore/TSimpleTimer.cpp =================================================================== diff -u -rd9527df01ee91b35d9a5fdccb80ded25a9c8265f -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchcore/TSimpleTimer.cpp (.../TSimpleTimer.cpp) (revision d9527df01ee91b35d9a5fdccb80ded25a9c8265f) +++ src/libchcore/TSimpleTimer.cpp (.../TSimpleTimer.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -79,8 +79,8 @@ return ullCurrentTotal; } - else - return 0; + + return 0; } void TSimpleTimer::Reset() Index: src/libchcore/TWorkerThreadController.cpp =================================================================== diff -u -ra4635addad389b9e117679437a3e1b64a739ea96 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchcore/TWorkerThreadController.cpp (.../TWorkerThreadController.cpp) (revision a4635addad389b9e117679437a3e1b64a739ea96) +++ src/libchcore/TWorkerThreadController.cpp (.../TWorkerThreadController.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -59,16 +59,16 @@ throw TCoreException(eErr_ThreadAlreadyStarted, L"Thread was already started", LOCATION); // just in case reset the kill event to avoid early death of the thread to be created - if (!::ResetEvent(m_hKillThread)) + if (!ResetEvent(m_hKillThread)) throw TCoreWin32Exception(eErr_CannotResetEvent, GetLastError(), L"Failed to reset event", LOCATION); boost::upgrade_to_unique_lock lock_upgraded(lock); - m_hThread = ::CreateThread(nullptr, 0, pThreadFunction, pThreadParam, CREATE_SUSPENDED, nullptr); + m_hThread = CreateThread(nullptr, 0, pThreadFunction, pThreadParam, CREATE_SUSPENDED, nullptr); if (!m_hThread) throw TCoreWin32Exception(eErr_CannotCreateThread, GetLastError(), L"Failed to create thread", LOCATION); - if (!::SetThreadPriority(m_hThread, iPriority)) + if (!SetThreadPriority(m_hThread, iPriority)) { DWORD dwLastError = GetLastError(); @@ -78,7 +78,7 @@ throw TCoreWin32Exception(eErr_CannotChangeThreadPriority, dwLastError, L"Failed to set thread priority", LOCATION); } - if (::ResumeThread(m_hThread) == (DWORD)-1) + if (ResumeThread(m_hThread) == (DWORD)-1) { DWORD dwLastError = GetLastError(); @@ -103,7 +103,7 @@ DWORD dwRes = WaitForSingleObject(m_hThread, dwMiliseconds); if (dwRes == WAIT_OBJECT_0) { - if (!::ResetEvent(m_hKillThread)) + if (!ResetEvent(m_hKillThread)) throw TCoreWin32Exception(eErr_CannotResetEvent, GetLastError(), L"Failed to reset event", LOCATION); boost::upgrade_to_unique_lock lock_upgraded(lock); @@ -135,22 +135,22 @@ if (m_hThread != nullptr) { - if (::SuspendThread(m_hThread) == (DWORD)-1) + if (SuspendThread(m_hThread) == (DWORD)-1) throw TCoreWin32Exception(eErr_CannotSuspendThread, GetLastError(), L"Failed to suspend thread", LOCATION); - if (!::SetThreadPriority(m_hThread, iPriority)) + if (!SetThreadPriority(m_hThread, iPriority)) { DWORD dwLastError = GetLastError(); // try to resume thread priority cannot be changed - DWORD dwResult = ::ResumeThread(m_hThread); + DWORD dwResult = ResumeThread(m_hThread); dwResult; // to avoid warnings in release builds BOOST_ASSERT(dwResult != (DWORD)-1); throw TCoreWin32Exception(eErr_CannotChangeThreadPriority, dwLastError, L"Failed to set thread priority", LOCATION); } - if (::ResumeThread(m_hThread) == (DWORD)-1) + if (ResumeThread(m_hThread) == (DWORD)-1) throw TCoreWin32Exception(eErr_CannotResumeThread, GetLastError(), L"Failed to resume thread", LOCATION); } } @@ -179,7 +179,7 @@ // thread already stopped? if (WaitForSingleObject(m_hThread, 0) == WAIT_OBJECT_0) { - if (!::ResetEvent(m_hKillThread)) + if (!ResetEvent(m_hKillThread)) throw TCoreWin32Exception(eErr_CannotResetEvent, GetLastError(), L"Failed to reset event", LOCATION); boost::upgrade_to_unique_lock lock_upgraded(rUpgradeLock); @@ -195,7 +195,7 @@ if (!m_hThread) return; - if (!::SetEvent(m_hKillThread)) + if (!SetEvent(m_hKillThread)) throw TCoreWin32Exception(eErr_CannotSetEvent, GetLastError(), L"Failed to set event", LOCATION); } @@ -207,7 +207,7 @@ DWORD dwRes = WaitForSingleObject(m_hThread, dwMiliseconds); if (dwRes == WAIT_OBJECT_0) { - if (!::ResetEvent(m_hKillThread)) + if (!ResetEvent(m_hKillThread)) throw TCoreWin32Exception(eErr_CannotResetEvent, GetLastError(), L"Failed to reset event", LOCATION); boost::upgrade_to_unique_lock lock_upgraded(rUpgradeLock); Index: src/libchengine/ConfigNodeContainer.h =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchengine/ConfigNodeContainer.h (.../ConfigNodeContainer.h) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/ConfigNodeContainer.h (.../ConfigNodeContainer.h) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -184,11 +184,9 @@ m_mic.modify(iterFnd, std::ref(tChange)); return tChange.WasModified(); } - else - { - m_mic.insert(ConfigNode(++m_oidLastObjectID, pszPropName, 0, boost::lexical_cast(rValue).c_str())); - return true; - } + + m_mic.insert(ConfigNode(++m_oidLastObjectID, pszPropName, 0, boost::lexical_cast(rValue).c_str())); + return true; } template<> @@ -203,11 +201,9 @@ m_mic.modify(iterFnd, std::ref(tChange)); return tChange.WasModified(); } - else - { - m_mic.insert(ConfigNode(++m_oidLastObjectID, pszPropName, 0, bValue ? _T("true") : _T("false"))); - return true; - } + + m_mic.insert(ConfigNode(++m_oidLastObjectID, pszPropName, 0, bValue ? _T("true") : _T("false"))); + return true; } // vector-based values Index: src/libchengine/TFileFiltersArray.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchengine/TFileFiltersArray.cpp (.../TFileFiltersArray.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TFileFiltersArray.cpp (.../TFileFiltersArray.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -103,17 +103,17 @@ rFilter.SetData(rNewFilter); return true; } - else - return false; + + return false; } const TFileFilter* TFileFiltersArray::GetAt(size_t stIndex) const { BOOST_ASSERT(stIndex < m_vFilters.size()); if (stIndex < m_vFilters.size()) return &m_vFilters.at(stIndex); - else - return nullptr; + + return nullptr; } bool TFileFiltersArray::RemoveAt(size_t stIndex) @@ -126,8 +126,8 @@ m_vFilters.erase(m_vFilters.begin() + stIndex); return true; } - else - return false; + + return false; } size_t TFileFiltersArray::GetSize() const Index: src/libchengine/TFileInfo.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchengine/TFileInfo.cpp (.../TFileInfo.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TFileInfo.cpp (.../TFileInfo.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -126,8 +126,8 @@ pathCombined += m_pathFile; return pathCombined; } - else - return m_pathFile; + + return m_pathFile; } object_id_t TFileInfo::GetSrcObjectID() const Index: src/libchengine/TLocalFilesystemFind.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchengine/TLocalFilesystemFind.cpp (.../TLocalFilesystemFind.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TLocalFilesystemFind.cpp (.../TLocalFilesystemFind.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -78,7 +78,8 @@ wfd.ftLastAccessTime, wfd.ftLastWriteTime, 0); return true; } - else if (wfd.cFileName[0] != _T('.') || (wfd.cFileName[1] != _T('\0') && (wfd.cFileName[1] != _T('.') || wfd.cFileName[2] != _T('\0')))) + + if (wfd.cFileName[0] != _T('.') || (wfd.cFileName[1] != _T('\0') && (wfd.cFileName[1] != _T('.') || wfd.cFileName[2] != _T('\0')))) { LOG_TRACE(m_spLog) << "Found file: " << wfd.cFileName << L", attrs: " << wfd.dwFileAttributes << Index: src/libchengine/TSpeedTracker.cpp =================================================================== diff -u -r1019bc9df4e044491b7102c37c8cac33cf56fb4a -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchengine/TSpeedTracker.cpp (.../TSpeedTracker.cpp) (revision 1019bc9df4e044491b7102c37c8cac33cf56fb4a) +++ src/libchengine/TSpeedTracker.cpp (.../TSpeedTracker.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -63,7 +63,8 @@ m_ullZeroIntervalData += ullValue; return; } - else if (ullInterval >= m_ullSampleTime * m_stRequiredSamples) // special case 1: interval is bigger than what we track + + if (ullInterval >= m_ullSampleTime * m_stRequiredSamples) // special case 1: interval is bigger than what we track { m_stNextSamplePos = 0; m_dPartialSpeedNotInSamples = 0.0; @@ -74,13 +75,11 @@ std::fill(m_vSamples.begin(), m_vSamples.end(), dSpeed); return; } - else - { - // append the data from previous zero-interval samples - ullValue += m_ullZeroIntervalData; - m_ullZeroIntervalData = 0; - } + // append the data from previous zero-interval samples + ullValue += m_ullZeroIntervalData; + m_ullZeroIntervalData = 0; + // calculate speed double dSpeed = NormalizeValueByTime(ullValue, ullInterval, m_ullSampleTime); Index: src/libchengine/TSubTaskArray.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchengine/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -32,8 +32,10 @@ #include "TTaskStatsSnapshot.h" #include #include "TTaskConfiguration.h" +#include "../libchcore/TCoreException.h" using namespace serializer; +using namespace chcore; namespace chengine { Index: src/libchengine/TSubTaskCopyMove.h =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchengine/TSubTaskCopyMove.h (.../TSubTaskCopyMove.h) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TSubTaskCopyMove.h (.../TSubTaskCopyMove.h) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -27,8 +27,6 @@ #include "TBufferSizes.h" #include "../liblogger/TLogger.h" #include "TOverlappedMemoryPool.h" -#include "TOverlappedReaderFB.h" -#include "TOverlappedWriterFB.h" namespace chengine { Index: src/libchengine/TSubTaskFastMove.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchengine/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -111,9 +111,9 @@ m_tSubTaskStats.SetTotalCount(0); return eSubResult_Continue; } - else - m_tSubTaskStats.SetTotalCount(spBasePaths->GetCount()); + m_tSubTaskStats.SetTotalCount(spBasePaths->GetCount()); + TDestinationPathProvider tDstPathProvider(spFilesystem, pathDestination, bIgnoreDirs, bForceDirectories, GetTaskPropValue(GetContext().GetConfig()), @@ -149,7 +149,7 @@ spBasePath->SetSkipFurtherProcessing(true); continue; } - else if (eResult != TSubTaskBase::eSubResult_Continue) + if (eResult != TSubTaskBase::eSubResult_Continue) return eResult; // does it match the input filter? Index: src/libchengine/TSubTaskScanDirectory.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchengine/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -139,7 +139,7 @@ ESubOperationResult eResult = tFilesystemFBWrapper.GetFileInfoFB(pathCurrent, spFileInfo, spBasePath); if (eResult == TSubTaskBase::eSubResult_SkipFile) continue; - else if (eResult != TSubTaskBase::eSubResult_Continue) + if (eResult != TSubTaskBase::eSubResult_Continue) return eResult; // log Index: src/libchengine/TSubTaskStatsSnapshot.cpp =================================================================== diff -u -r3921d82d9605d98b2281f3f42d9f9c8385b89a3e -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchengine/TSubTaskStatsSnapshot.cpp (.../TSubTaskStatsSnapshot.cpp) (revision 3921d82d9605d98b2281f3f42d9f9c8385b89a3e) +++ src/libchengine/TSubTaskStatsSnapshot.cpp (.../TSubTaskStatsSnapshot.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -78,17 +78,17 @@ if (ullTotal != 0) return Math::Div64(ullProcessed, ullTotal); - else - return 0.0; + + return 0.0; } unsigned long long TSubTaskStatsSnapshot::GetEstimatedTotalTime() const { double dProgress = CalculateProgress(); if (dProgress == 0.0) return std::numeric_limits::max(); - else - return (unsigned long long)(m_timeElapsed * (1.0 / dProgress)); + + return (unsigned long long)(m_timeElapsed * (1.0 / dProgress)); } void TSubTaskStatsSnapshot::SetSizeSpeed(double dSizeSpeed) @@ -120,8 +120,8 @@ { if (m_timeElapsed) return Math::Div64(m_ullProcessedSize, m_timeElapsed / 1000.0); - else - return 0.0; + + return 0.0; } double TSubTaskStatsSnapshot::GetAvgCountSpeed() const Index: src/libchengine/TTaskStatsSnapshot.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libchengine/TTaskStatsSnapshot.cpp (.../TTaskStatsSnapshot.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TTaskStatsSnapshot.cpp (.../TTaskStatsSnapshot.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -198,8 +198,8 @@ if (m_ullTimeElapsed) return Math::Div64(m_ullProcessedCount, m_ullTimeElapsed / 1000.0); - else - return 0.0; + + return 0.0; } double TTaskStatsSnapshot::GetAvgSizeSpeed() const @@ -209,8 +209,8 @@ if (m_ullTimeElapsed) return Math::Div64(m_ullProcessedSize, m_ullTimeElapsed / 1000.0); - else - return 0.0; + + return 0.0; } unsigned long long TTaskStatsSnapshot::GetEstimatedTotalTime() const @@ -220,7 +220,7 @@ if (m_dCombinedProgress == 0.0) return std::numeric_limits::max(); - else - return (unsigned long long)(m_ullTimeElapsed / m_dCombinedProgress); + + return (unsigned long long)(m_ullTimeElapsed / m_dCombinedProgress); } } Index: src/libictranslate/LanguageDialog.cpp =================================================================== diff -u -r19b135b50b55b75d008526a799344bda9a62dc22 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libictranslate/LanguageDialog.cpp (.../LanguageDialog.cpp) (revision 19b135b50b55b75d008526a799344bda9a62dc22) +++ src/libictranslate/LanguageDialog.cpp (.../LanguageDialog.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -233,19 +233,16 @@ return pBuffer + 4; } - else - { - *pwData = 0xffff; - DWORD dwLen = (DWORD)wcslen((wchar_t*)pBuffer); - *ppszStr = new TCHAR[ dwLen + 1 ]; + + *pwData = 0xffff; + DWORD dwLen = (DWORD)wcslen((wchar_t*)pBuffer); + *ppszStr = new TCHAR[ dwLen + 1 ]; #ifdef _UNICODE - _tcscpy(*ppszStr, (wchar_t*)pBuffer); + _tcscpy(*ppszStr, (wchar_t*)pBuffer); #else - WideCharToMultiByte(CP_ACP, 0, (wchar_t*)pBuffer, dwLen + 1, *ppszStr, dwLen + 1, nullptr, nullptr); + WideCharToMultiByte(CP_ACP, 0, (wchar_t*)pBuffer, dwLen + 1, *ppszStr, dwLen + 1, nullptr, nullptr); #endif - return pBuffer + (dwLen + 1) * sizeof(wchar_t); - } - + return pBuffer + (dwLen + 1) * sizeof(wchar_t); } ///////////////////////////////////////////////////////////////////////////// @@ -484,12 +481,10 @@ return TRUE; } - else - { - m_bLockChanged = false; - Cleanup(); - return FALSE; - } + + m_bLockChanged = false; + Cleanup(); + return FALSE; } /////////////////////////////////////////////////////////////// @@ -791,8 +786,8 @@ AfxGetApp()->HtmlHelp((DWORD_PTR)pHelpInfo, HH_DISPLAY_TEXT_POPUP); return true; } - else - return false; + + return false; } void CLanguageDialog::OnContextMenu(CWnd* pWnd, CPoint point) Index: src/libictranslate/ResourceManager.cpp =================================================================== diff -u -r19b135b50b55b75d008526a799344bda9a62dc22 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision 19b135b50b55b75d008526a799344bda9a62dc22) +++ src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -704,8 +704,8 @@ translation_map::const_iterator it = m_mapTranslation.find((wHiID << 16) | wLoID); if(it != m_mapTranslation.end()) return (*it).second.GetText(); - else - return EMPTY_STRING; + + return EMPTY_STRING; } void CLangData::EnumStrings(PFNENUMCALLBACK pfnCallback, void* pData) @@ -721,16 +721,14 @@ translation_map::iterator iterTranslation = m_mapTranslation.find(uiTranslationKey); if(iterTranslation != m_mapTranslation.end()) return &(*iterTranslation).second; - else + + if(bCreate) { - if(bCreate) + std::pair pairTranslation = m_mapTranslation.insert(std::make_pair(uiTranslationKey, CTranslationItem())); + if(pairTranslation.second) { - std::pair pairTranslation = m_mapTranslation.insert(std::make_pair(uiTranslationKey, CTranslationItem())); - if(pairTranslation.second) - { - m_bModified = true; - return &(*pairTranslation.first).second; - } + m_bModified = true; + return &(*pairTranslation.first).second; } } @@ -774,17 +772,15 @@ { if(bFullPath) return m_pszFilename; - else - { - if(m_pszFilename) - { - TCHAR *pszFnd = _tcsrchr(m_pszFilename, _T('\\')); - if(pszFnd) - return pszFnd + 1; - } - return m_pszFilename; + if(m_pszFilename) + { + TCHAR *pszFnd = _tcsrchr(m_pszFilename, _T('\\')); + if(pszFnd) + return pszFnd + 1; } + + return m_pszFilename; } void CLangData::SetLangName(PCTSTR psz) Index: src/libictranslate/cfg.cpp =================================================================== diff -u -rb26ced3298e3e7e51d91f3ac70b56746786da83b -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libictranslate/cfg.cpp (.../cfg.cpp) (revision b26ced3298e3e7e51d91f3ac70b56746786da83b) +++ src/libictranslate/cfg.cpp (.../cfg.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -641,8 +641,8 @@ m_pCfgBase->find_close(pFind); return true; } - else - return false; + + return false; } /** Function sets the property value from string. Index: src/libictranslate/cfg_ini.cpp =================================================================== diff -u -rb26ced3298e3e7e51d91f3ac70b56746786da83b -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libictranslate/cfg_ini.cpp (.../cfg_ini.cpp) (revision b26ced3298e3e7e51d91f3ac70b56746786da83b) +++ src/libictranslate/cfg_ini.cpp (.../cfg_ini.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -260,38 +260,36 @@ return pHandle; } - else - { - // parse the path - std::wstring strSection; - std::wstring strAttr; - if(!parse_property_name(pszName, strSection, strAttr)) - return nullptr; - ini_storage::iterator iterSection = m_pMainNode->find(strSection); - if(iterSection == m_pMainNode->end()) - return nullptr; + // parse the path + std::wstring strSection; + std::wstring strAttr; + if(!parse_property_name(pszName, strSection, strAttr)) + return nullptr; - std::pair pairRange; - if(strAttr == _T("*")) - { - pairRange.first = (*iterSection).second.begin(); - pairRange.second = (*iterSection).second.end(); - } - else - pairRange = (*iterSection).second.equal_range(strAttr); - if(pairRange.first != (*iterSection).second.end() && pairRange.first != pairRange.second) - { - INIFINDHANDLE* pHandle = new INIFINDHANDLE; - pHandle->bSection = false; - pHandle->bOnlyAttributes = true; - pHandle->itAttr = pairRange.first; - pHandle->itAttrEnd = pairRange.second; + ini_storage::iterator iterSection = m_pMainNode->find(strSection); + if(iterSection == m_pMainNode->end()) + return nullptr; - return pHandle; - } + std::pair pairRange; + if(strAttr == _T("*")) + { + pairRange.first = (*iterSection).second.begin(); + pairRange.second = (*iterSection).second.end(); } + else + pairRange = (*iterSection).second.equal_range(strAttr); + if(pairRange.first != (*iterSection).second.end() && pairRange.first != pairRange.second) + { + INIFINDHANDLE* pHandle = new INIFINDHANDLE; + pHandle->bSection = false; + pHandle->bOnlyAttributes = true; + pHandle->itAttr = pairRange.first; + pHandle->itAttrEnd = pairRange.second; + return pHandle; + } + return nullptr; } @@ -318,47 +316,41 @@ ++pfh->itAttr; return true; } - else - return false; + + return false; } - else + + if(pfh->bSection) { - if(pfh->bSection) - { - if(pfh->itSection == pfh->itSectionEnd) - return false; - pfh->bSection = false; - pfh->itAttr = (*pfh->itSection).second.begin(); - pfh->itAttrEnd = (*pfh->itSection).second.end(); + if(pfh->itSection == pfh->itSectionEnd) + return false; + pfh->bSection = false; + pfh->itAttr = (*pfh->itSection).second.begin(); + pfh->itAttrEnd = (*pfh->itSection).second.end(); - // section name - pi.bGroup = true; - pi.pszName = (*pfh->itSection++).first.c_str(); - pi.pszValue = nullptr; - return true; - } - else - { - if(pfh->itAttr != pfh->itAttrEnd) - { - pi.bGroup = false; - pi.pszName = (*pfh->itAttr).first.c_str(); - pi.pszValue = (*pfh->itAttr).second.c_str(); + // section name + pi.bGroup = true; + pi.pszName = (*pfh->itSection++).first.c_str(); + pi.pszValue = nullptr; + return true; + } - ++pfh->itAttr; - if(pfh->itAttr == pfh->itAttrEnd) - pfh->bSection = true; - return true; + if(pfh->itAttr != pfh->itAttrEnd) + { + pi.bGroup = false; + pi.pszName = (*pfh->itAttr).first.c_str(); + pi.pszValue = (*pfh->itAttr).second.c_str(); - } - else - { - // should not happen - assert(false); - return false; - } - } + ++pfh->itAttr; + if(pfh->itAttr == pfh->itAttrEnd) + pfh->bSection = true; + return true; + } + + // should not happen + assert(false); + return false; } /** Closes the find handle. Index: src/libictranslate/config_property.cpp =================================================================== diff -u -r8068e0c351055554340ac9755d1bc846893bf2b8 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libictranslate/config_property.cpp (.../config_property.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) +++ src/libictranslate/config_property.cpp (.../config_property.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -445,8 +445,8 @@ assert(stIndex < m_paStrings->size()); return m_paStrings->at(stIndex).c_str(); } - else - return m_val.pszVal; + + return m_val.pszVal; } /** Sets a signed number property value. @@ -524,8 +524,8 @@ assert(stIndex < m_paSigneds->size()); return m_paSigneds->at(stIndex); } - else - return m_val.llVal; + + return m_val.llVal; } /** Sets an unsigned number property value. @@ -603,8 +603,8 @@ assert(stIndex < m_paUnsigneds->size()); return m_paUnsigneds->at(stIndex); } - else - return m_val.ullVal; + + return m_val.ullVal; } /** Sets a bool property value. @@ -663,8 +663,8 @@ assert(stIndex < m_paBools->size()); return m_paBools->at(stIndex); } - else - return m_val.bVal; + + return m_val.bVal; } /** Retrieves the property count for this property. @@ -690,8 +690,8 @@ return 0; } } - else - return 1; + + return 1; } /** Removes a property value at a given index. @@ -887,8 +887,8 @@ _tcscpy(psz, pszSrc); return psz; } - else - return nullptr; + + return nullptr; } /** Converts a string to a boolean value. Index: src/libserializer/TSQLiteSerializerRowData.cpp =================================================================== diff -u -r3921d82d9605d98b2281f3f42d9f9c8385b89a3e -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libserializer/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision 3921d82d9605d98b2281f3f42d9f9c8385b89a3e) +++ src/libserializer/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -301,7 +301,8 @@ return strQuery; } - else if (HasAnyData()) + + if (HasAnyData()) { // prepare update query TString strQuery = boost::str(boost::wformat(L"UPDATE %1% SET ") % strContainerName).c_str(); @@ -326,8 +327,8 @@ return strQuery; } - else - return TString(); + + return TString(); } unsigned long long TSQLiteSerializerRowData::GetChangeIdentification() const Index: src/libstring/TString.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libstring/TString.cpp (.../TString.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libstring/TString.cpp (.../TString.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -262,8 +262,8 @@ if (tLen >= stThisLen) return *this; - else - return TString(m_pszData, tLen); + + return TString(m_pszData, tLen); } /** Returns a new TString object with the Right part of this TString object. @@ -279,8 +279,8 @@ if (tLen >= stThisLen) return *this; - else - return TString(m_pszData + stThisLen - tLen, tLen); + + return TString(m_pszData + stThisLen - tLen, tLen); } /** Returns a new TString object with the middle part of this TString object. @@ -528,8 +528,8 @@ if (rangeFind.begin() != rangeText.end()) return rangeFind.begin() - rangeText.begin() + stStartPos; - else - return TString::npos; + + return TString::npos; } void TString::Replace(const wchar_t* pszWhat, const wchar_t* pszWithWhat) @@ -599,19 +599,17 @@ wch = m_pszData[tPos]; return true; } - else - { - wch = L'\0'; - return false; - } + + wch = L'\0'; + return false; } wchar_t TString::GetAt(size_t tPos) const { if (tPos < GetLength()) return m_pszData[tPos]; - else - return L'\0'; + + return L'\0'; } /** Returns a pointer to the unicode internal buffer. If the buffer is in ansi format Index: src/libstring/TStringPattern.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- src/libstring/TStringPattern.cpp (.../TStringPattern.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libstring/TStringPattern.cpp (.../TStringPattern.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -79,7 +79,8 @@ } lpszMask++; } - while (*lpszMask == _T('*') && bMatch) lpszMask++; + while (*lpszMask == _T('*') && bMatch) + lpszMask++; return bMatch && *lpszString == _T('\0') && *lpszMask == _T('\0'); } @@ -94,28 +95,27 @@ // if lpszString is empty and lpszMask has more characters or, // lpszMask is empty, return - if (*lpszString == _T('\0') && *lpszMask != _T('\0')) return false; - if (*lpszString == _T('\0') && *lpszMask == _T('\0')) return true; + if (*lpszString == _T('\0') && *lpszMask != _T('\0')) + return false; + if (*lpszString == _T('\0') && *lpszMask == _T('\0')) + return true; // else search substring - else + LPCTSTR wdsCopy = lpszMask; + LPCTSTR lpszStringCopy = lpszString; + bool bMatch = true; + do { - LPCTSTR wdsCopy = lpszMask; - LPCTSTR lpszStringCopy = lpszString; - bool bMatch = true; - do - { - if (!MatchMask(lpszMask, lpszString)) lpszStringCopy++; - lpszMask = wdsCopy; - lpszString = lpszStringCopy; - while (!(_tcicmp(*lpszMask, *lpszString)) && (*lpszString != '\0')) lpszString++; - wdsCopy = lpszMask; - lpszStringCopy = lpszString; - } while ((*lpszString != _T('\0')) ? !MatchMask(lpszMask, lpszString) : (bMatch = false) != false); + if (!MatchMask(lpszMask, lpszString)) lpszStringCopy++; + lpszMask = wdsCopy; + lpszString = lpszStringCopy; + while (!(_tcicmp(*lpszMask, *lpszString)) && (*lpszString != '\0')) lpszString++; + wdsCopy = lpszMask; + lpszStringCopy = lpszString; + } while ((*lpszString != _T('\0')) ? !MatchMask(lpszMask, lpszString) : (bMatch = false) != false); - if (*lpszString == _T('\0') && *lpszMask == _T('\0')) return true; + if (*lpszString == _T('\0') && *lpszMask == _T('\0')) return true; - return bMatch; - } + return bMatch; } bool TStringPattern::Matches(const TString& strTextToMatch) const Index: tests/tests_shared/TestsExports.cpp =================================================================== diff -u -rd9527df01ee91b35d9a5fdccb80ded25a9c8265f -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af --- tests/tests_shared/TestsExports.cpp (.../TestsExports.cpp) (revision d9527df01ee91b35d9a5fdccb80ded25a9c8265f) +++ tests/tests_shared/TestsExports.cpp (.../TestsExports.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) @@ -6,18 +6,18 @@ #include #include -class TFailedOutputPrinter : public ::testing::EmptyTestEventListener +class TFailedOutputPrinter : public testing::EmptyTestEventListener { - virtual void OnTestStart(const ::testing::TestInfo& test_info) + void OnTestStart(const testing::TestInfo& test_info) override { m_strTestName = str(boost::format("%1%.%2%") % test_info.test_case_name() % test_info.name()); } - virtual void OnTestPartResult(const ::testing::TestPartResult& test_part_result) + void OnTestPartResult(const testing::TestPartResult& test_part_result) override { if(test_part_result.failed()) { - char* pszFailureText = NULL; + char* pszFailureText = nullptr; if(test_part_result.fatally_failed()) pszFailureText = "FATAL"; else @@ -35,7 +35,7 @@ } } - virtual void OnTestProgramEnd(const ::testing::UnitTest& unit_test) + void OnTestProgramEnd(const testing::UnitTest& unit_test) override { if(unit_test.Failed()) { @@ -65,8 +65,8 @@ #endif { testing::InitGoogleMock(&argc, argv); - ::testing::FLAGS_gtest_death_test_style = "fast"; - ::testing::FLAGS_gtest_print_time = 1; + testing::FLAGS_gtest_death_test_style = "fast"; + testing::FLAGS_gtest_print_time = true; bool bUseStdFormat = false; for(int iIndex = 1; iIndex < argc; ++iIndex) @@ -80,7 +80,7 @@ if(!bUseStdFormat) { - ::testing::TestEventListeners& listeners = ::testing::UnitTest::GetInstance()->listeners(); + testing::TestEventListeners& listeners = testing::UnitTest::GetInstance()->listeners(); delete listeners.Release(listeners.default_result_printer()); listeners.Append(new TFailedOutputPrinter); }