Index: src/ch/MainWnd.cpp =================================================================== diff -u -N -r031c4e5f6be6ad9589ce5fea8292c990351f9a82 -r71c49ab6ac2e657dee997cb9129c7d0d4dde21b6 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 031c4e5f6be6ad9589ce5fea8292c990351f9a82) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 71c49ab6ac2e657dee997cb9129c7d0d4dde21b6) @@ -278,7 +278,6 @@ if (wParam != m_ctlTray.m_tnd.uID) return (LRESULT)FALSE; - TCHAR text[_MAX_PATH]; switch(LOWORD(lParam)) { case WM_LBUTTONDOWN: @@ -339,6 +338,8 @@ } case WM_MOUSEMOVE: { + TCHAR text[ _MAX_PATH ]; + if (m_spTasks->GetSize() != 0) { m_spTasks->GetStatsSnapshot(m_spTaskMgrStats); @@ -914,10 +915,9 @@ unsigned char *dec=new unsigned char[iCount+1]; dec[iCount]=0; - unsigned short sData; for (int i=0, j=0;i(msg[i] - _hash[j]); + unsigned short sData=static_cast(msg[i] - _hash[j]); sData >>= off[j]; dec[i]=static_cast(sData); Index: src/ch/MiniViewDlg.h =================================================================== diff -u -N -r8068e0c351055554340ac9755d1bc846893bf2b8 -r71c49ab6ac2e657dee997cb9129c7d0d4dde21b6 --- src/ch/MiniViewDlg.h (.../MiniViewDlg.h) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) +++ src/ch/MiniViewDlg.h (.../MiniViewDlg.h) (revision 71c49ab6ac2e657dee997cb9129c7d0d4dde21b6) @@ -22,6 +22,7 @@ ///////////////////////////////////////////////////////////////////////////// // CMiniViewDlg dialog #include "ProgressListBox.h" +#include namespace chcore { @@ -41,14 +42,16 @@ public: struct _BTNDATA_ { - void (*pfnCallbackFunc)(CMiniViewDlg*, UINT, _BTNDATA_*, CDC*); // callback - click - int iPosition; // button pos counting from right - bool bPressed; // is it pressed ? - bool bEnabled; // is it enabled ? + void (*pfnCallbackFunc)(CMiniViewDlg*, UINT, _BTNDATA_*, CDC*) = nullptr; // callback - click + int iPosition = 0; // button pos counting from right + bool bPressed = false; // is it pressed ? + bool bEnabled = false; // is it enabled ? CRect rcButton; // filled in OnNCPaint - } m_bdButtons[BTN_COUNT]; + }; + std::array<_BTNDATA_, BTN_COUNT> m_bdButtons; + // Construction public: CMiniViewDlg(chcore::TTaskManager* pArray, bool* pbHide, CWnd* pParent = nullptr); // standard constructor @@ -98,7 +101,6 @@ CBrush m_brBackground; int m_iLastHeight; bool m_bShown; - _PROGRESSITEM_ item; // cache bool m_bActive; Index: src/ch/UpdateVersionInfo.cpp =================================================================== diff -u -N -r4572f6cddf7dab06b1de99504a6bbd3680d11e6d -r71c49ab6ac2e657dee997cb9129c7d0d4dde21b6 --- src/ch/UpdateVersionInfo.cpp (.../UpdateVersionInfo.cpp) (revision 4572f6cddf7dab06b1de99504a6bbd3680d11e6d) +++ src/ch/UpdateVersionInfo.cpp (.../UpdateVersionInfo.cpp) (revision 71c49ab6ac2e657dee997cb9129c7d0d4dde21b6) @@ -21,8 +21,9 @@ #include #include #include +#include -UpdateVersionInfo::UpdateVersionInfo(std::wstring strNumericVersion, std::wstring strReadableVersion, boost::gregorian::date dateRelease, std::wstring strDownloadLink, std::wstring strReleaseNotes) : +UpdateVersionInfo::UpdateVersionInfo(const std::wstring& strNumericVersion, const std::wstring& strReadableVersion, boost::gregorian::date dateRelease, const std::wstring& strDownloadLink, const std::wstring& strReleaseNotes) : m_strNumericVersion(strNumericVersion), m_strReadableVersion(strReadableVersion), m_dateRelease(dateRelease), Index: src/ch/UpdateVersionInfo.h =================================================================== diff -u -N -r4572f6cddf7dab06b1de99504a6bbd3680d11e6d -r71c49ab6ac2e657dee997cb9129c7d0d4dde21b6 --- src/ch/UpdateVersionInfo.h (.../UpdateVersionInfo.h) (revision 4572f6cddf7dab06b1de99504a6bbd3680d11e6d) +++ src/ch/UpdateVersionInfo.h (.../UpdateVersionInfo.h) (revision 71c49ab6ac2e657dee997cb9129c7d0d4dde21b6) @@ -37,7 +37,7 @@ public: UpdateVersionInfo(); - UpdateVersionInfo(std::wstring strNumericVersion, std::wstring strReadableVersion, boost::gregorian::date dateRelease, std::wstring strDownloadLink, std::wstring strReleaseNotes); + UpdateVersionInfo(const std::wstring& strNumericVersion, const std::wstring& strReadableVersion, boost::gregorian::date dateRelease, const std::wstring& strDownloadLink, const std::wstring& strReleaseNotes); void Merge(const UpdateVersionInfo& vi); Index: src/libchcore/TBaseException.cpp =================================================================== diff -u -N -r8068e0c351055554340ac9755d1bc846893bf2b8 -r71c49ab6ac2e657dee997cb9129c7d0d4dde21b6 --- src/libchcore/TBaseException.cpp (.../TBaseException.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) +++ src/libchcore/TBaseException.cpp (.../TBaseException.cpp) (revision 71c49ab6ac2e657dee997cb9129c7d0d4dde21b6) @@ -30,7 +30,7 @@ m_stLineNumber(stLineNumber), m_pszFunction(pszFunction) { - ATLTRACE(_T("*** Base Exception is being thrown:\n\tMsg: %s\n\tError code: %ld\n\tFile: %s\n\tLine number: %ld\n\tFunction: %s\n"), pszMsg, eErrorCode, pszFile, stLineNumber, pszFunction); + ATLTRACE(_T("*** Base Exception is being thrown:\n\tMsg: %s\n\tError code: %d\n\tFile: %s\n\tLine number: %ld\n\tFunction: %s\n"), pszMsg, eErrorCode, pszFile, stLineNumber, pszFunction); } TBaseException::TBaseException(EGeneralErrors eErrorCode, const char* pszMsg, const wchar_t* pszFile, size_t stLineNumber, const wchar_t* pszFunction) : @@ -41,7 +41,7 @@ m_stLineNumber(stLineNumber), m_pszFunction(pszFunction) { - ATLTRACE(_T("*** Base Exception is being thrown:\n\tMsg: %S\n\tError code: %ld\n\tFile: %s\n\tLine number: %ld\n\tFunction: %s\n"), pszMsg, eErrorCode, pszFile, stLineNumber, pszFunction); + ATLTRACE(_T("*** Base Exception is being thrown:\n\tMsg: %S\n\tError code: %d\n\tFile: %s\n\tLine number: %ld\n\tFunction: %s\n"), pszMsg, eErrorCode, pszFile, stLineNumber, pszFunction); if (pszMsg) { size_t stMsgLen = strlen(pszMsg); @@ -60,14 +60,14 @@ void TBaseException::GetErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const { - _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s (error code: %ld)"), + _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s (error code: %d)"), m_pszMsg, m_eErrorCode); pszBuffer[stMaxBuffer - 1] = _T('\0'); } void TBaseException::GetDetailedErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const { - _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s\r\nError code: %ld\r\nFile: %s\r\nFunction: %s\r\nLine no: %lu"), + _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s\r\nError code: %d\r\nFile: %s\r\nFunction: %s\r\nLine no: %lu"), m_pszMsg, m_eErrorCode, m_pszFile, m_pszFunction, (unsigned long)m_stLineNumber); pszBuffer[stMaxBuffer - 1] = _T('\0'); } Index: src/libchcore/TCoreWin32Exception.cpp =================================================================== diff -u -N -r8aaaa0a6febeeeb6dc7d93b859b58488c54ba5e6 -r71c49ab6ac2e657dee997cb9129c7d0d4dde21b6 --- src/libchcore/TCoreWin32Exception.cpp (.../TCoreWin32Exception.cpp) (revision 8aaaa0a6febeeeb6dc7d93b859b58488c54ba5e6) +++ src/libchcore/TCoreWin32Exception.cpp (.../TCoreWin32Exception.cpp) (revision 71c49ab6ac2e657dee997cb9129c7d0d4dde21b6) @@ -48,13 +48,13 @@ // ============================================================================ void TCoreWin32Exception::GetErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const { - _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s (error code: %ld, win32 error code: %lu)"), m_pszMsg, m_eErrorCode, m_dwWin32ErrorCode); + _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s (error code: %d, win32 error code: %lu)"), m_pszMsg, m_eErrorCode, m_dwWin32ErrorCode); pszBuffer[stMaxBuffer - 1] = _T('\0'); } void TCoreWin32Exception::GetDetailedErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const { - _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s\r\nError code: %ld\r\nWin32 error code: %lu\r\nFile: %s\r\nFunction: %s\r\nLine no: %lu"), m_pszMsg, m_eErrorCode, m_dwWin32ErrorCode, m_pszFile, m_pszFunction, (unsigned long)m_stLineNumber); + _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s\r\nError code: %d\r\nWin32 error code: %lu\r\nFile: %s\r\nFunction: %s\r\nLine no: %lu"), m_pszMsg, m_eErrorCode, m_dwWin32ErrorCode, m_pszFile, m_pszFunction, (unsigned long)m_stLineNumber); pszBuffer[stMaxBuffer - 1] = _T('\0'); } } Index: src/libchcore/TFileException.cpp =================================================================== diff -u -N -r8aaaa0a6febeeeb6dc7d93b859b58488c54ba5e6 -r71c49ab6ac2e657dee997cb9129c7d0d4dde21b6 --- src/libchcore/TFileException.cpp (.../TFileException.cpp) (revision 8aaaa0a6febeeeb6dc7d93b859b58488c54ba5e6) +++ src/libchcore/TFileException.cpp (.../TFileException.cpp) (revision 71c49ab6ac2e657dee997cb9129c7d0d4dde21b6) @@ -30,13 +30,13 @@ void TFileException::GetErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const { - _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s (error code: %ld, win32 error code: %lu, path: %s)"), m_pszMsg, m_eErrorCode, m_dwNativeErrorCode, m_path.ToString()); + _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s (error code: %d, win32 error code: %lu, path: %s)"), m_pszMsg, m_eErrorCode, m_dwNativeErrorCode, m_path.ToString()); pszBuffer[stMaxBuffer - 1] = _T('\0'); } void TFileException::GetDetailedErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const { - _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s\r\nError code: %ld\r\nWin32 error code: %lu\r\nFile: %s\r\nSource file: %s\r\nFunction: %s\r\nLine no: %lu"), + _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("%s\r\nError code: %d\r\nWin32 error code: %lu\r\nFile: %s\r\nSource file: %s\r\nFunction: %s\r\nLine no: %lu"), m_pszMsg, m_eErrorCode, m_dwNativeErrorCode, m_path.ToString(), m_pszFile, m_pszFunction, (unsigned long)m_stLineNumber); pszBuffer[stMaxBuffer - 1] = _T('\0'); } Index: src/liblogger/TLoggerLocationConfig.cpp =================================================================== diff -u -N --- src/liblogger/TLoggerLocationConfig.cpp (revision cca174e74e108de1f5729e4cc6c46d2b9a5e25a7) +++ src/liblogger/TLoggerLocationConfig.cpp (revision 0) @@ -1,32 +0,0 @@ -// ============================================================================ -// Copyright (C) 2001-2016 by Jozef Starosczyk -// ixen@copyhandler.com -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU Library General Public License -// (version 2) as published by the Free Software Foundation; -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this program; if not, write to the -// Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// ============================================================================ -#include "stdafx.h" -#include "TLoggerLocationConfig.h" - -namespace chcore -{ - TLoggerLocationConfig::TLoggerLocationConfig(const TSmartPath& pathLog) : m_pathLog(pathLog) - { - } - - chcore::TSmartPath TLoggerLocationConfig::GetLogPath() const - { - return m_pathLog; - } -} Index: src/liblogger/TLoggerLocationConfig.h =================================================================== diff -u -N --- src/liblogger/TLoggerLocationConfig.h (revision cca174e74e108de1f5729e4cc6c46d2b9a5e25a7) +++ src/liblogger/TLoggerLocationConfig.h (revision 0) @@ -1,40 +0,0 @@ -// ============================================================================ -// Copyright (C) 2001-2016 by Jozef Starosczyk -// ixen@copyhandler.com -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU Library General Public License -// (version 2) as published by the Free Software Foundation; -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this program; if not, write to the -// Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// ============================================================================ -#ifndef __TLOGGERLOCATIONCONFIG_H__ -#define __TLOGGERLOCATIONCONFIG_H__ - -#include "..\libchcore\TPath.h" - -namespace chcore -{ - class TLoggerLocationConfig - { - public: - TLoggerLocationConfig(const TSmartPath& pathLog); - - TSmartPath GetLogPath() const; - - private: - TSmartPath m_pathLog; - }; - - using TLoggerLocationConfigPtr = std::shared_ptr; -} - -#endif