Index: src/ch/AppHelper.cpp =================================================================== diff -u -r44a2ec5f1eb0a435b56daef42ef5fe3b7a91da0d -r8dc649003961dad64b92da67426814fb5dd862e0 --- src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision 44a2ec5f1eb0a435b56daef42ef5fe3b7a91da0d) +++ src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision 8dc649003961dad64b92da67426814fb5dd862e0) @@ -151,7 +151,7 @@ if (_tcsnicmp(strPath, _T(""), 9) == 0) { // get windows path - _tcsncpy(szStr, m_pszProgramPath ? m_pszProgramPath : _t(""), _MAX_PATH); + _tcsncpy(szStr, m_pszProgramPath ? m_pszProgramPath : _T(""), _MAX_PATH); szStr[_MAX_PATH - 1] = _T('\0'); _tcsncat(szStr, strPath.Mid(9), _MAX_PATH - _tcslen(szStr)); szStr[_MAX_PATH - 1] = _T('\0'); Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -ra13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0 -r8dc649003961dad64b92da67426814fb5dd862e0 --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision a13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 8dc649003961dad64b92da67426814fb5dd862e0) @@ -27,7 +27,6 @@ #include "FilterDlg.h" #include "StringHelpers.h" #include "ch.h" -#include "../libicpf/file.h" #include "../libchcore/TTaskConfigBufferSizes.h" #ifdef _DEBUG @@ -481,25 +480,25 @@ chcore::TBufferSizes bsSizes = chcore::GetTaskPropBufferSizes(m_tTaskDefinition.GetConfiguration()); fmt.SetFormat(GetResManager().LoadString(IDS_BSEDEFAULT_STRING)); - fmt.SetParam(_t("%size"), GetSizeString(bsSizes.GetDefaultSize(), true)); + fmt.SetParam(_T("%size"), GetSizeString(bsSizes.GetDefaultSize(), true)); m_ctlBufferSizes.AddString(fmt); if (!bsSizes.IsOnlyDefault()) { fmt.SetFormat(GetResManager().LoadString(IDS_BSEONEDISK_STRING)); - fmt.SetParam(_t("%size"), GetSizeString(bsSizes.GetOneDiskSize(), true)); + fmt.SetParam(_T("%size"), GetSizeString(bsSizes.GetOneDiskSize(), true)); m_ctlBufferSizes.AddString(fmt); fmt.SetFormat(GetResManager().LoadString(IDS_BSETWODISKS_STRING)); - fmt.SetParam(_t("%size"), GetSizeString(bsSizes.GetTwoDisksSize(), true)); + fmt.SetParam(_T("%size"), GetSizeString(bsSizes.GetTwoDisksSize(), true)); m_ctlBufferSizes.AddString(fmt); fmt.SetFormat(GetResManager().LoadString(IDS_BSECD_STRING)); - fmt.SetParam(_t("%size"), GetSizeString(bsSizes.GetCDSize(), true)); + fmt.SetParam(_T("%size"), GetSizeString(bsSizes.GetCDSize(), true)); m_ctlBufferSizes.AddString(fmt); fmt.SetFormat(GetResManager().LoadString(IDS_BSELAN_STRING)); - fmt.SetParam(_t("%size"), GetSizeString(bsSizes.GetLANSize(), true)); + fmt.SetParam(_T("%size"), GetSizeString(bsSizes.GetLANSize(), true)); m_ctlBufferSizes.AddString(fmt); } } @@ -903,23 +902,22 @@ UINT uiCount=0; try { - icpf::file file; - file.open(dlg.GetPathName(), FA_READ); + CFile file(dlg.GetPathName(), CFile::modeRead); // load files max 1MB in size; - ll_t llSize = file.get_size(); - if(llSize > 1*1024*1024 || llSize < 2) + unsigned long long ullSize = file.GetLength(); + if(ullSize > 1*1024*1024 || ullSize < 2) { AfxMessageBox(GetResManager().LoadString(IDS_IMPORTERROR_STRING)); return; } - ulSize = boost::numeric_cast(llSize); + ulSize = boost::numeric_cast(ullSize); spBuffer.reset(new BYTE[ulSize + 3]); // guarantee that we have null at the end of the string (3 bytes to compensate for possible odd number of bytes and for unicode) memset(spBuffer.get(), 0, ulSize + 3); - ulSize = file.read(spBuffer.get(), ulSize); - file.close(); + ulSize = file.Read(spBuffer.get(), ulSize); + file.Close(); } catch(...) { @@ -977,7 +975,7 @@ // report ictranslate::CFormat fmt(GetResManager().LoadString(IDS_IMPORTREPORT_STRING)); - fmt.SetParam(_t("%count"), uiCount); + fmt.SetParam(_T("%count"), uiCount); AfxMessageBox(fmt); } } @@ -1025,7 +1023,7 @@ { ictranslate::CFormat fmt; fmt.SetFormat(GetResManager().LoadString(IDS_EXPORTING_TASK_FAILED)); - fmt.SetParam(_t("%reason"), strError); + fmt.SetParam(_T("%reason"), strError); AfxMessageBox(fmt, MB_OK | MB_ICONERROR); } Index: src/ch/FeedbackNotEnoughSpaceDlg.cpp =================================================================== diff -u -ra13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0 -r8dc649003961dad64b92da67426814fb5dd862e0 --- src/ch/FeedbackNotEnoughSpaceDlg.cpp (.../FeedbackNotEnoughSpaceDlg.cpp) (revision a13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0) +++ src/ch/FeedbackNotEnoughSpaceDlg.cpp (.../FeedbackNotEnoughSpaceDlg.cpp) (revision 8dc649003961dad64b92da67426814fb5dd862e0) @@ -34,7 +34,7 @@ // CFeedbackNotEnoughSpaceDlg dialog -CFeedbackNotEnoughSpaceDlg::CFeedbackNotEnoughSpaceDlg(ull_t ullSizeRequired, const tchar_t* pszSrcPath, const tchar_t* pszDstPath) +CFeedbackNotEnoughSpaceDlg::CFeedbackNotEnoughSpaceDlg(unsigned long long ullSizeRequired, const wchar_t* pszSrcPath, const wchar_t* pszDstPath) :ictranslate::CLanguageDialog(IDD_FEEDBACK_NOTENOUGHSPACE_DIALOG), m_bAllItems(FALSE), m_ullRequired(ullSizeRequired), @@ -69,7 +69,7 @@ { // format needed text ictranslate::CFormat fmt(GetResManager().LoadString(IDS_NERPATH_STRING)); - fmt.SetParam(_t("%path"), m_strDisk); + fmt.SetParam(_T("%path"), m_strDisk); CWnd* pWnd=GetDlgItem(IDC_HEADER_STATIC); if (pWnd) @@ -79,7 +79,7 @@ pWnd=GetDlgItem(IDC_REQUIRED_STATIC); if (pWnd) pWnd->SetWindowText(GetSizeString(m_ullRequired)); - ull_t ullFree; + unsigned long long ullFree; pWnd=GetDlgItem(IDC_AVAILABLE_STATIC); if (pWnd && GetDynamicFreeSpace(m_strDisk, &ullFree, NULL)) pWnd->SetWindowText(GetSizeString(ullFree)); @@ -128,7 +128,7 @@ if (nIDEvent == 1601) { // update free space - ull_t ullFree; + unsigned long long ullFree; CWnd *pWnd=GetDlgItem(IDC_AVAILABLE_STATIC); if (pWnd && GetDynamicFreeSpace(m_strDisk, &ullFree, NULL)) { Index: src/ch/FolderDialog.cpp =================================================================== diff -u -ra13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0 -r8dc649003961dad64b92da67426814fb5dd862e0 --- src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision a13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0) +++ src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision 8dc649003961dad64b92da67426814fb5dd862e0) @@ -656,7 +656,7 @@ if (!bSkipFreeSpace) { // get disk free space - ull_t ullFree, ullTotal; + unsigned long long ullFree, ullTotal; if (GetDynamicFreeSpace(strPath, &ullFree, &ullTotal)) { m_strTip += GetResManager().LoadString(IDS_BDFREESPACE_STRING) + GetSizeString(ullFree, false) + _T("\n"); @@ -695,7 +695,7 @@ m_strTip=sc.m_strName+_T("\r\n")+CString(GetResManager().LoadString(IDS_BDPATH2_STRING))+sc.m_strPath; // get disk free space - ull_t ullFree, ullTotal; + unsigned long long ullFree, ullTotal; if (GetDynamicFreeSpace(sc.m_strPath, &ullFree, &ullTotal)) { m_strTip+=CString(_T("\r\n"))+GetResManager().LoadString(IDS_BDFREESPACE_STRING) + GetSizeString(ullFree, false) + _T("\n"); Index: src/ch/MainWnd.cpp =================================================================== diff -u -ra13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0 -r8dc649003961dad64b92da67426814fb5dd862e0 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision a13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 8dc649003961dad64b92da67426814fb5dd862e0) @@ -39,7 +39,6 @@ #include "FileSupport.h" #include "StringHelpers.h" #include "../libchcore/TCoreException.h" -#include "../libicpf/exception.h" #include "../libchcore/TTaskManagerStatsSnapshot.h" #include "../libchcore/TSQLiteSerializerFactory.h" #include "TRecentPathsTools.h" @@ -574,10 +573,10 @@ spTask->Store(true); bImported = true; } - catch(icpf::exception& e) + catch(const chcore::TBaseException& e) { bImported = false; - e.get_info(szBuffer.get(), stBufferSize); + e.GetDetailedErrorInfo(szBuffer.get(), stBufferSize); } catch(...) { @@ -1031,7 +1030,7 @@ SetPropValue(rConfig, _time64(NULL)); rConfig.Write(); } - catch(icpf::exception& /*e*/) + catch(const std::exception& /*e*/) { LOG_ERROR(_T("Storing last update check timestamp in configuration failed")); } Index: src/ch/StatusDlg.cpp =================================================================== diff -u -ra13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0 -r8dc649003961dad64b92da67426814fb5dd862e0 --- src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision a13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0) +++ src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision 8dc649003961dad64b92da67426814fb5dd862e0) @@ -706,8 +706,8 @@ if(hResult < 32) { ictranslate::CFormat fmt(GetResManager().LoadString(IDS_SHELLEXECUTEERROR_STRING)); - fmt.SetParam(_t("%errno"), hResult); - fmt.SetParam(_t("%path"), spTask->GetLogPath().ToString()); + fmt.SetParam(_T("%errno"), hResult); + fmt.SetParam(_T("%path"), spTask->GetLogPath().ToString()); AfxMessageBox(fmt); } } Index: src/ch/StringHelpers.cpp =================================================================== diff -u -ra13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0 -r8dc649003961dad64b92da67426814fb5dd862e0 --- src/ch/StringHelpers.cpp (.../StringHelpers.cpp) (revision a13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0) +++ src/ch/StringHelpers.cpp (.../StringHelpers.cpp) (revision 8dc649003961dad64b92da67426814fb5dd862e0) @@ -27,33 +27,33 @@ CString GetSizeString(double dData) { - if(dData < 0.0) + if (dData < 0.0) dData = 0.0; CString strResult; - if(dData < 1200.0) + if (dData < 1200.0) strResult.Format(_T("%.2f %s"), dData, GetResManager().LoadString(IDS_BYTE_STRING)); - else if(dData < 1228800.0) + else if (dData < 1228800.0) strResult.Format(_T("%.2f %s"), static_cast(dData) / 1024.0, GetResManager().LoadString(IDS_KBYTE_STRING)); - else if(dData < 1258291200.0) + else if (dData < 1258291200.0) strResult.Format(_T("%.2f %s"), static_cast(dData) / 1048576.0, GetResManager().LoadString(IDS_MBYTE_STRING)); else strResult.Format(_T("%.2f %s"), static_cast(dData) / 1073741824.0, GetResManager().LoadString(IDS_GBYTE_STRING)); return strResult; } -CString GetSizeString(ull_t ullData, bool bStrict) +CString GetSizeString(unsigned long long ullData, bool bStrict) { - if(ullData < 0) + if (ullData < 0) ullData = 0; CString strResult; - if(ullData >= 1258291200 && (!bStrict || (ullData % 1073741824) == 0)) + if (ullData >= 1258291200 && (!bStrict || (ullData % 1073741824) == 0)) strResult.Format(_T("%.2f %s"), (double)(ullData / 1073741824.0), GetResManager().LoadString(IDS_GBYTE_STRING)); - else if(ullData >= 1228800 && (!bStrict || (ullData % 1048576) == 0)) + else if (ullData >= 1228800 && (!bStrict || (ullData % 1048576) == 0)) strResult.Format(_T("%.2f %s"), (double)(ullData / 1048576.0), GetResManager().LoadString(IDS_MBYTE_STRING)); - else if(ullData >= 1200 && (!bStrict || (ullData % 1024) == 0)) + else if (ullData >= 1200 && (!bStrict || (ullData % 1024) == 0)) strResult.Format(_T("%.2f %s"), (double)(ullData / 1024.0), GetResManager().LoadString(IDS_KBYTE_STRING)); else strResult.Format(_T("%I64u %s"), ullData, GetResManager().LoadString(IDS_BYTE_STRING)); Index: src/ch/StringHelpers.h =================================================================== diff -u -ra13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0 -r8dc649003961dad64b92da67426814fb5dd862e0 --- src/ch/StringHelpers.h (.../StringHelpers.h) (revision a13bee8e2ecd1e8f61be0aa9b51d99acdc43a5d0) +++ src/ch/StringHelpers.h (.../StringHelpers.h) (revision 8dc649003961dad64b92da67426814fb5dd862e0) @@ -20,6 +20,6 @@ #define __STRINGHELPERS_H__ CString GetSizeString(double dData); -CString GetSizeString(ull_t ullData, bool bStrict = false); +CString GetSizeString(unsigned long long ullData, bool bStrict = false); #endif Index: src/ch/ch.cpp =================================================================== diff -u -r44a2ec5f1eb0a435b56daef42ef5fe3b7a91da0d -r8dc649003961dad64b92da67426814fb5dd862e0 --- src/ch/ch.cpp (.../ch.cpp) (revision 44a2ec5f1eb0a435b56daef42ef5fe3b7a91da0d) +++ src/ch/ch.cpp (.../ch.cpp) (revision 8dc649003961dad64b92da67426814fb5dd862e0) @@ -85,7 +85,7 @@ // CCopyHandlerApp construction // main routing function - routes any message that comes from modules -void ResManCallback(uint_t uiMsg) +void ResManCallback(unsigned int uiMsg) { theApp.OnResManNotify(uiMsg); } @@ -173,7 +173,7 @@ GetLocalTime(&st); TCHAR szName[_MAX_PATH]; - _sntprintf(szName, _MAX_PATH, _T("%s\\ch_crashdump-%s-%I64u-%s.dmp"), (PCTSTR)strPath, _T(PRODUCT_VERSION), (ull_t)_time64(NULL), + _sntprintf(szName, _MAX_PATH, _T("%s\\ch_crashdump-%s-%I64u-%s.dmp"), (PCTSTR)strPath, _T(PRODUCT_VERSION), (unsigned long long)_time64(NULL), #ifdef _WIN64 _T("64") #else @@ -584,7 +584,7 @@ chcore::TString strError = chcore::TWin32ErrorFormatter::FormatWin32ErrorCode(hResult, true); ictranslate::CFormat fmt(GetResManager().LoadString(IDS_REGISTERERR_STRING)); - fmt.SetParam(_T("%errno"), (ulong_t)hResult); + fmt.SetParam(_T("%errno"), (unsigned long)hResult); fmt.SetParam(_T("%errdesc"), strError.c_str()); AfxMessageBox(fmt, MB_ICONERROR | MB_OK); } @@ -621,7 +621,7 @@ chcore::TString strError = chcore::TWin32ErrorFormatter::FormatWin32ErrorCode(hResult, true); ictranslate::CFormat fmt(GetResManager().LoadString(IDS_UNREGISTERERR_STRING)); - fmt.SetParam(_T("%errno"), (ulong_t)hResult); + fmt.SetParam(_T("%errno"), (unsigned long)hResult); fmt.SetParam(_T("%errdesc"), strError.c_str()); AfxMessageBox(fmt, MB_ICONERROR | MB_OK);