From a7c24ca48995cf2bf436156302f96b91bf135409 Mon Sep 17 00:00:00 2001 From: Goraf <22941576+Goraf@users.noreply.github.com> Date: Mon, 13 Nov 2017 15:03:31 +0100 Subject: Code modernize ... * replace 0/NULL with nullptr [using clang-tidy] --- plugins/Quotes/src/ComHelper.cpp | 4 +- plugins/Quotes/src/CommonOptionDlg.cpp | 2 +- plugins/Quotes/src/CurrencyConverter.cpp | 12 +++--- plugins/Quotes/src/DBUtils.cpp | 8 ++-- plugins/Quotes/src/ExtraImages.cpp | 2 +- plugins/Quotes/src/Forex.cpp | 20 ++++----- plugins/Quotes/src/HTMLParserMS.cpp | 8 ++-- plugins/Quotes/src/HTTPSession.cpp | 12 +++--- plugins/Quotes/src/IconLib.cpp | 4 +- plugins/Quotes/src/ImportExport.cpp | 6 +-- plugins/Quotes/src/Locale.cpp | 6 +-- plugins/Quotes/src/ModuleInfo.cpp | 6 +-- plugins/Quotes/src/OptionDukasCopy.cpp | 4 +- plugins/Quotes/src/QuoteInfoDlg.cpp | 10 ++--- plugins/Quotes/src/QuotesProviderBase.cpp | 10 ++--- plugins/Quotes/src/QuotesProviderGoogle.cpp | 2 +- plugins/Quotes/src/QuotesProviderGoogleFinance.cpp | 2 +- .../Quotes/src/QuotesProviderVisitorDbSettings.cpp | 48 +++++++++++----------- plugins/Quotes/src/QuotesProviders.cpp | 2 +- plugins/Quotes/src/SettingsDlg.cpp | 6 +-- plugins/Quotes/src/XMLEngineMI.cpp | 6 +-- 21 files changed, 90 insertions(+), 90 deletions(-) (limited to 'plugins/Quotes/src') diff --git a/plugins/Quotes/src/ComHelper.cpp b/plugins/Quotes/src/ComHelper.cpp index 6228ae9526..0dc689133f 100644 --- a/plugins/Quotes/src/ComHelper.cpp +++ b/plugins/Quotes/src/ComHelper.cpp @@ -11,7 +11,7 @@ tstring ComException2Msg(_com_error& e, const tstring& rsAdditionalInfo) IErrorInfo* p = e.ErrorInfo(); CComPtr pErrorInfo(p); - if (NULL != p) + if (nullptr != p) p->Release(); if (pErrorInfo) @@ -24,5 +24,5 @@ void ShowComError(_com_error& e, const tstring& rsAdditionalInfo) { tstring sErrorMsg = ComException2Msg(e, rsAdditionalInfo); LogIt(sErrorMsg); - Quotes_MessageBox(NULL, sErrorMsg.c_str(), MB_OK | MB_ICONERROR); + Quotes_MessageBox(nullptr, sErrorMsg.c_str(), MB_OK | MB_ICONERROR); } diff --git a/plugins/Quotes/src/CommonOptionDlg.cpp b/plugins/Quotes/src/CommonOptionDlg.cpp index d2edc48c16..4429ff1aa3 100644 --- a/plugins/Quotes/src/CommonOptionDlg.cpp +++ b/plugins/Quotes/src/CommonOptionDlg.cpp @@ -17,7 +17,7 @@ CAdvProviderSettings* get_adv_settings(const IQuotesProvider* pProvider, bool bC return pAdvSet.get(); } - return NULL; + return nullptr; } void remove_adv_settings(const IQuotesProvider *pProvider) diff --git a/plugins/Quotes/src/CurrencyConverter.cpp b/plugins/Quotes/src/CurrencyConverter.cpp index faf1d09a3d..f2917ad03c 100644 --- a/plugins/Quotes/src/CurrencyConverter.cpp +++ b/plugins/Quotes/src/CurrencyConverter.cpp @@ -18,12 +18,12 @@ static CQuotesProviderGoogle* get_google_provider() } assert(!"We should never get here!"); - return NULL; + return nullptr; } -CQuotesProviderGoogle::CQuoteSection get_quotes(const CQuotesProviderGoogle* pProvider = NULL) +CQuotesProviderGoogle::CQuoteSection get_quotes(const CQuotesProviderGoogle* pProvider = nullptr) { - if (NULL == pProvider) + if (nullptr == pProvider) pProvider = get_google_provider(); if (pProvider) { @@ -242,7 +242,7 @@ INT_PTR CALLBACK CurrencyConverterDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM case NM_CLICK: if (IDC_SYSLINK_PROVIDER == wp) { PNMLINK pNMLink = reinterpret_cast(pNMHDR); - ::ShellExecute(hDlg, L"open", pNMLink->item.szUrl, NULL, NULL, SW_SHOWNORMAL); + ::ShellExecute(hDlg, L"open", pNMLink->item.szUrl, nullptr, nullptr, SW_SHOWNORMAL); } break; } @@ -255,11 +255,11 @@ INT_PTR QuotesMenu_CurrencyConverter(WPARAM, LPARAM) { MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX, true); HWND hWnd = WindowList_Find(hWL, NULL); - if (NULL != hWnd) { + if (nullptr != hWnd) { SetForegroundWindow(hWnd); SetFocus(hWnd); } - else CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_CURRENCY_CONVERTER), NULL, CurrencyConverterDlgProc, 0); + else CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_CURRENCY_CONVERTER), nullptr, CurrencyConverterDlgProc, 0); return 0; } diff --git a/plugins/Quotes/src/DBUtils.cpp b/plugins/Quotes/src/DBUtils.cpp index dffcb18c5d..19e8088286 100644 --- a/plugins/Quotes/src/DBUtils.cpp +++ b/plugins/Quotes/src/DBUtils.cpp @@ -4,11 +4,11 @@ std::string Quotes_DBGetStringA(MCONTACT hContact, const char* szModule, const c { std::string sResult; char* pszSymbol = db_get_sa(hContact, szModule, szSetting); - if (NULL != pszSymbol) { + if (nullptr != pszSymbol) { sResult = pszSymbol; mir_free(pszSymbol); } - else if (NULL != pszDefValue) + else if (nullptr != pszDefValue) sResult = pszDefValue; return sResult; @@ -18,11 +18,11 @@ std::wstring Quotes_DBGetStringW(MCONTACT hContact, const char* szModule, const { std::wstring sResult; wchar_t* pszSymbol = db_get_wsa(hContact, szModule, szSetting); - if (NULL != pszSymbol) { + if (nullptr != pszSymbol) { sResult = pszSymbol; mir_free(pszSymbol); } - else if (NULL != pszDefValue) + else if (nullptr != pszDefValue) sResult = pszDefValue; return sResult; diff --git a/plugins/Quotes/src/ExtraImages.cpp b/plugins/Quotes/src/ExtraImages.cpp index ce5b7ded1c..5fdff8d004 100644 --- a/plugins/Quotes/src/ExtraImages.cpp +++ b/plugins/Quotes/src/ExtraImages.cpp @@ -24,7 +24,7 @@ bool SetContactExtraImage(MCONTACT hContact, EImageIndex nIndex) hIcolib = Quotes_GetIconHandle(IDI_ICON_NOTCHANGED); break; default: - hIcolib = NULL; + hIcolib = nullptr; } return ExtraIcon_SetIcon(hExtraIcon, hContact, hIcolib) == 0; } diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 32ffb684a8..0a56404ca4 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -4,16 +4,16 @@ #include "stdafx.h" int hLangpack; -HINSTANCE g_hInstance = NULL; +HINSTANCE g_hInstance = nullptr; HANDLE g_hEventWorkThreadStop; //int g_nStatus = ID_STATUS_OFFLINE; bool g_bAutoUpdate = true; -HGENMENU g_hMenuEditSettings = NULL; -HGENMENU g_hMenuOpenLogFile = NULL; +HGENMENU g_hMenuEditSettings = nullptr; +HGENMENU g_hMenuOpenLogFile = nullptr; #ifdef CHART_IMPLEMENT -HGENMENU g_hMenuChart = NULL; +HGENMENU g_hMenuChart = nullptr; #endif -HGENMENU g_hMenuRefresh = NULL, g_hMenuRoot = NULL; +HGENMENU g_hMenuRefresh = nullptr, g_hMenuRoot = nullptr; #define DB_STR_AUTO_UPDATE "AutoUpdate" @@ -137,7 +137,7 @@ void InitMenu() SET_UID(mi, 0x19a16fa2, 0xf370, 0x4201, 0x92, 0x9, 0x25, 0xde, 0x4e, 0x55, 0xf9, 0x1a); mi.name.w = LPGENW("Open Log File..."); - mi.hIcolibItem = NULL; + mi.hIcolibItem = nullptr; mi.pszService = "Quotes/OpenLogFile"; g_hMenuOpenLogFile = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME); Menu_ConfigureItem(g_hMenuOpenLogFile, MCI_OPT_EXECPARAM, 1); @@ -146,7 +146,7 @@ void InitMenu() #ifdef CHART_IMPLEMENT SET_UID(mi, 0x65da7256, 0x43a2, 0x4857, 0xac, 0x52, 0x1c, 0xb7, 0xff, 0xd7, 0x96, 0xfa); mi.name.w = LPGENW("Chart..."); - mi.hIcolibItem = NULL; + mi.hIcolibItem = nullptr; mi.pszService = "Quotes/Chart"; g_hMenuChart = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME); CreateServiceFunction(mi.pszService, QuotesMenu_Chart); @@ -154,7 +154,7 @@ void InitMenu() SET_UID(mi, 0xac5fc17, 0x5640, 0x4f81, 0xa3, 0x44, 0x8c, 0xb6, 0x9a, 0x5c, 0x98, 0xf); mi.name.w = LPGENW("Edit Settings..."); - mi.hIcolibItem = NULL; + mi.hIcolibItem = nullptr; mi.pszService = "Quotes/EditSettings"; g_hMenuEditSettings = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME); #ifdef CHART_IMPLEMENT @@ -167,7 +167,7 @@ void InitMenu() int Quotes_OnToolbarLoaded(WPARAM, LPARAM) { - TTBButton ttb = { 0 }; + TTBButton ttb = {}; ttb.name = LPGEN("Enable/Disable Quotes Auto Update"); ttb.pszService = g_pszAutoUpdateCmd; ttb.pszTooltipUp = LPGEN("Quotes Auto Update Enabled"); @@ -202,7 +202,7 @@ int QuotesEventFunc_OnModulesLoaded(WPARAM, LPARAM) { CHTTPSession::Init(); - g_hEventWorkThreadStop = ::CreateEvent(NULL, TRUE, FALSE, NULL); + g_hEventWorkThreadStop = ::CreateEvent(nullptr, TRUE, FALSE, nullptr); HookEvent(ME_USERINFO_INITIALISE, QuotesEventFunc_OnUserInfoInit); HookEvent(ME_CLIST_DOUBLECLICKED, Quotes_OnContactDoubleClick); diff --git a/plugins/Quotes/src/HTMLParserMS.cpp b/plugins/Quotes/src/HTMLParserMS.cpp index c79c32ed5d..c2f8962063 100644 --- a/plugins/Quotes/src/HTMLParserMS.cpp +++ b/plugins/Quotes/src/HTMLParserMS.cpp @@ -153,13 +153,13 @@ private: CHTMLParserMS::CHTMLParserMS() : m_bCallUninit(false) { try { - CheckError(::CoInitialize(NULL)); + CheckError(::CoInitialize(nullptr)); m_bCallUninit = true; _com_util::CheckError( ::CoCreateInstance(CLSID_HTMLDocument, - NULL, + nullptr, CLSCTX_INPROC_SERVER, IID_IHTMLDocument2, (LPVOID*)&m_pDoc) @@ -217,14 +217,14 @@ bool CHTMLParserMS::IsInstalled() bool bResult = true; bool bCallUninit = false; try { - CheckError(::CoInitialize(NULL)); + CheckError(::CoInitialize(nullptr)); bCallUninit = true; CComPtr pDoc; _com_util::CheckError( ::CoCreateInstance(CLSID_HTMLDocument, - NULL, + nullptr, CLSCTX_INPROC_SERVER, IID_IHTMLDocument2, reinterpret_cast(&pDoc)) diff --git a/plugins/Quotes/src/HTTPSession.cpp b/plugins/Quotes/src/HTTPSession.cpp index 7c9ea5a880..0dbfac3441 100644 --- a/plugins/Quotes/src/HTTPSession.cpp +++ b/plugins/Quotes/src/HTTPSession.cpp @@ -30,17 +30,17 @@ public: static bool Init() { - assert(NULL == g_hNetLib); + assert(nullptr == g_hNetLib); NETLIBUSER nlu = {}; nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_UNICODE; nlu.szSettingsModule = QUOTES_PROTOCOL_NAME; nlu.szDescriptiveName.w = TranslateT("Quotes HTTP connections"); g_hNetLib = Netlib_RegisterUser(&nlu); - return (NULL != g_hNetLib); + return (nullptr != g_hNetLib); } - static bool IsValid() { return NULL != g_hNetLib; } + static bool IsValid() { return nullptr != g_hNetLib; } virtual bool OpenURL(const tstring& rsURL) { @@ -80,7 +80,7 @@ public: // nlhr.headers[5].szValue = cookie; bool bResult = false; - NETLIBHTTPREQUEST* pReply = NULL; + NETLIBHTTPREQUEST* pReply = nullptr; { mir_cslock lck(m_mx); pReply = Netlib_HttpTransaction(g_hNetLib, &nlhr); @@ -94,7 +94,7 @@ public: char* pResult = &*(apBuffer.begin()); int nIndex = find_header(pReply, "Content-Type"); - if ((-1 != nIndex) && (NULL != strstr(_strlwr(pReply->headers[nIndex].szValue), "utf-8"))) { + if ((-1 != nIndex) && (nullptr != strstr(_strlwr(pReply->headers[nIndex].szValue), "utf-8"))) { wchar_t* p = mir_utf8decodeW(pResult); rsResponce = p; mir_free(p); @@ -123,7 +123,7 @@ private: mutable mir_cs m_mx; }; -HNETLIBUSER CImplMI::g_hNetLib = NULL; +HNETLIBUSER CImplMI::g_hNetLib = nullptr; CHTTPSession::CHTTPSession() : m_pImpl(new CImplMI) diff --git a/plugins/Quotes/src/IconLib.cpp b/plugins/Quotes/src/IconLib.cpp index d2ea08eee0..60a7880328 100644 --- a/plugins/Quotes/src/IconLib.cpp +++ b/plugins/Quotes/src/IconLib.cpp @@ -27,7 +27,7 @@ HICON Quotes_LoadIconEx(int iconId, bool bBig /*= false*/) if (iconList[i].defIconID == iconId) return IcoLib_GetIconByHandle(iconList[i].hIcolib, bBig); - return NULL; + return nullptr; } HANDLE Quotes_GetIconHandle(int iconId) @@ -36,5 +36,5 @@ HANDLE Quotes_GetIconHandle(int iconId) if (iconList[i].defIconID == iconId) return iconList[i].hIcolib; - return NULL; + return nullptr; } diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp index 468558b7be..89fbeec022 100644 --- a/plugins/Quotes/src/ImportExport.cpp +++ b/plugins/Quotes/src/ImportExport.cpp @@ -173,7 +173,7 @@ bool show_open_file_dialog(bool bOpen, tstring& rsFile) ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = NULL; + ofn.hwndOwner = nullptr; ofn.lpstrFilter = prepare_filter(szFilter, MAX_PATH); ofn.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_EXPLORER; ofn.lpstrDefExt = L"xml"; @@ -203,7 +203,7 @@ INT_PTR Quotes_Export(WPARAM wp, LPARAM lp) { tstring sFileName; const char* pszFile = reinterpret_cast(lp); - if (NULL == pszFile) { + if (nullptr == pszFile) { if (false == show_open_file_dialog(false, sFileName)) return -1; } @@ -626,7 +626,7 @@ INT_PTR Quotes_Import(WPARAM wp, LPARAM lp) tstring sFileName; const char* pszFile = reinterpret_cast(lp); - if (NULL == pszFile) { + if (nullptr == pszFile) { if (false == show_open_file_dialog(true, sFileName)) return -1; } diff --git a/plugins/Quotes/src/Locale.cpp b/plugins/Quotes/src/Locale.cpp index ae79f71eb6..43493fb127 100644 --- a/plugins/Quotes/src/Locale.cpp +++ b/plugins/Quotes/src/Locale.cpp @@ -8,10 +8,10 @@ const std::locale GetSystemLocale() tstring get_int_registry_value(LPCTSTR pszValueName) { tstring sResult; - HKEY hKey = NULL; + HKEY hKey = nullptr; LONG lResult = ::RegOpenKeyEx(HKEY_CURRENT_USER, L"Control Panel\\International", 0, KEY_QUERY_VALUE, &hKey); - if ((ERROR_SUCCESS == lResult) && (NULL != hKey)) { + if ((ERROR_SUCCESS == lResult) && (nullptr != hKey)) { DWORD dwType = 0; DWORD dwSize = 0; lResult = ::RegQueryValueEx(hKey, pszValueName, nullptr, &dwType, nullptr, &dwSize); @@ -23,7 +23,7 @@ tstring get_int_registry_value(LPCTSTR pszValueName) } } - if (NULL != hKey) { + if (nullptr != hKey) { lResult = ::RegCloseKey(hKey); assert(ERROR_SUCCESS == lResult); } diff --git a/plugins/Quotes/src/ModuleInfo.cpp b/plugins/Quotes/src/ModuleInfo.cpp index a362bf9133..7a72063270 100644 --- a/plugins/Quotes/src/ModuleInfo.cpp +++ b/plugins/Quotes/src/ModuleInfo.cpp @@ -20,7 +20,7 @@ CModuleInfo& CModuleInfo::GetInstance() MWindowList CModuleInfo::GetWindowList(const std::string& rsKey, bool bAllocateIfNonExist /*= true*/) { - MWindowList hResult = NULL; + MWindowList hResult = nullptr; THandles::const_iterator i = m_ahWindowLists.find(rsKey); if (i != m_ahWindowLists.end()) { hResult = i->second; @@ -84,12 +84,12 @@ bool CModuleInfo::Verify() return false; if (!GetXMLEnginePtr()) { - Quotes_MessageBox(NULL, TranslateT("Miranda could not load Quotes plugin. XML parser is missing."), MB_OK | MB_ICONERROR); + Quotes_MessageBox(nullptr, TranslateT("Miranda could not load Quotes plugin. XML parser is missing."), MB_OK | MB_ICONERROR); return false; } if (!g_pHTMLEngine && (false == CHTMLParserMS::IsInstalled())) { - Quotes_MessageBox(NULL, + Quotes_MessageBox(nullptr, TranslateT("Miranda could not load Quotes plugin. Microsoft HTML parser is missing."), MB_YESNO | MB_ICONQUESTION); return false; diff --git a/plugins/Quotes/src/OptionDukasCopy.cpp b/plugins/Quotes/src/OptionDukasCopy.cpp index 12c53f1753..d8ff58068c 100644 --- a/plugins/Quotes/src/OptionDukasCopy.cpp +++ b/plugins/Quotes/src/OptionDukasCopy.cpp @@ -42,7 +42,7 @@ bool add_quote_to_tree(const CQuotesProviderDukasCopy::CQuote& q, HWND hwndTree, ::PostMessage(hDlg, TREE_VIEW_CHECK_STATE_CHANGE, MAKEWPARAM(0, TCBS_CHECKED), reinterpret_cast(hti)); } - return (NULL != hti && bChecked); + return (nullptr != hti && bChecked); } void add_section_to_tree(const CQuotesProviderDukasCopy::CQuoteSection& qs, @@ -220,7 +220,7 @@ CQuotesProviderDukasCopy* get_dukas_copy_provider() } assert(!"We should never get here!"); - return NULL; + return nullptr; } INT_PTR CALLBACK EconomicRatesDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp index 14e2cd8ae7..4a9922e76b 100644 --- a/plugins/Quotes/src/QuoteInfoDlg.cpp +++ b/plugins/Quotes/src/QuoteInfoDlg.cpp @@ -15,7 +15,7 @@ MCONTACT g_hContact; inline bool IsMyContact(MCONTACT hContact) { CQuotesProviders::TQuotesProviderPtr pProvider = CModuleInfo::GetQuoteProvidersPtr()->GetContactProviderPtr(hContact); - return (NULL != pProvider); + return (nullptr != pProvider); } inline MCONTACT get_contact(HWND hWnd) @@ -82,7 +82,7 @@ INT_PTR CALLBACK QuoteInfoDlgProcImpl(MCONTACT hContact, HWND hdlg, UINT msg, WP case NM_CLICK: if (IDC_SYSLINK_PROVIDER == wParam) { PNMLINK pNMLink = reinterpret_cast(pNMHDR); - ::ShellExecute(hdlg, L"open", pNMLink->item.szUrl, NULL, NULL, SW_SHOWNORMAL); + ::ShellExecute(hdlg, L"open", pNMLink->item.szUrl, nullptr, nullptr, SW_SHOWNORMAL); } break; } @@ -143,7 +143,7 @@ INT_PTR QuotesMenu_OpenLogFile(WPARAM wp, LPARAM) tstring sLogFileName; if ((true == get_log_file(hContact, sLogFileName)) && (false == sLogFileName.empty())) - ::ShellExecute(NULL, L"open", sLogFileName.c_str(), NULL, NULL, SW_SHOWNORMAL); + ::ShellExecute(nullptr, L"open", sLogFileName.c_str(), nullptr, nullptr, SW_SHOWNORMAL); return 0; } @@ -216,12 +216,12 @@ int Quotes_OnContactDoubleClick(WPARAM wp, LPARAM/* lp*/) MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_INFO, true); assert(hWL); HWND hWnd = WindowList_Find(hWL, hContact); - if (NULL != hWnd) { + if (nullptr != hWnd) { SetForegroundWindow(hWnd); SetFocus(hWnd); } else if (true == IsMyContact(hContact)) - CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_DIALOG_QUOTE_INFO_1), NULL, QuoteInfoDlgProc1, LPARAM(hContact)); + CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_DIALOG_QUOTE_INFO_1), nullptr, QuoteInfoDlgProc1, LPARAM(hContact)); return 1; } diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp index f90f90e462..86f2cedecf 100644 --- a/plugins/Quotes/src/QuotesProviderBase.cpp +++ b/plugins/Quotes/src/QuotesProviderBase.cpp @@ -138,8 +138,8 @@ CQuotesProviderBase::CXMLFileInfo init_xml_info(LPCTSTR pszFileName, bool& rbSuc } CQuotesProviderBase::CQuotesProviderBase() - : m_hEventSettingsChanged(::CreateEvent(NULL, FALSE, FALSE, NULL)), - m_hEventRefreshContact(::CreateEvent(NULL, FALSE, FALSE, NULL)), + : m_hEventSettingsChanged(::CreateEvent(nullptr, FALSE, FALSE, nullptr)), + m_hEventRefreshContact(::CreateEvent(nullptr, FALSE, FALSE, nullptr)), m_bRefreshInProgress(false) { } @@ -152,7 +152,7 @@ CQuotesProviderBase::~CQuotesProviderBase() bool CQuotesProviderBase::Init() { - bool bSucceded = m_pXMLInfo != NULL; + bool bSucceded = m_pXMLInfo != nullptr; if (!m_pXMLInfo) { CQuotesProviderVisitorDbSettings visitor; Accept(visitor); @@ -510,7 +510,7 @@ bool show_popup(const IQuotesProvider* pProvider, const tstring& sTitle = visitor.GetResult(); mir_wstrncpy(ppd.lptzContactName, sTitle.c_str(), MAX_CONTACTNAME); { - ptrW ss(variables_parsedup((wchar_t*)rsFormat.c_str(), 0, hContact)); + ptrW ss(variables_parsedup((wchar_t*)rsFormat.c_str(), nullptr, hContact)); tstring sText = format_rate(pProvider, hContact, tstring(ss)); mir_wstrncpy(ppd.lptzText, sText.c_str(), MAX_SECONDLINE); } @@ -547,7 +547,7 @@ bool show_popup(const IQuotesProvider* pProvider, void CQuotesProviderBase::WriteContactRate(MCONTACT hContact, double dRate, const tstring& rsSymbol/* = ""*/) { - time_t nTime = ::time(NULL); + time_t nTime = ::time(nullptr); if (false == rsSymbol.empty()) db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_SYMBOL, rsSymbol.c_str()); diff --git a/plugins/Quotes/src/QuotesProviderGoogle.cpp b/plugins/Quotes/src/QuotesProviderGoogle.cpp index 94d39e5d46..d63ac57a46 100644 --- a/plugins/Quotes/src/QuotesProviderGoogle.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogle.cpp @@ -183,7 +183,7 @@ static CQuotesProviderGoogle* get_google_provider() } assert(!"We should never get here!"); - return NULL; + return nullptr; } CQuotesProviderGoogle::CQuoteSection get_quotes() diff --git a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp index 09d4546573..dcda584269 100644 --- a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp @@ -178,7 +178,7 @@ bool get_dif_value(const IHTMLNode::THTMLNodePtr& pNode, CGoogleInfo& rInfo, int ++i; } - double* pValue = NULL; + double* pValue = nullptr; switch (nItem) { case CGoogleInfo::giPercentChangeAfterHours: pValue = &rInfo.m_dPercentChangeAfterHours; diff --git a/plugins/Quotes/src/QuotesProviderVisitorDbSettings.cpp b/plugins/Quotes/src/QuotesProviderVisitorDbSettings.cpp index c1cd208545..51f4fab953 100644 --- a/plugins/Quotes/src/QuotesProviderVisitorDbSettings.cpp +++ b/plugins/Quotes/src/QuotesProviderVisitorDbSettings.cpp @@ -1,30 +1,30 @@ #include "StdAfx.h" CQuotesProviderVisitorDbSettings::CQuotesProviderVisitorDbSettings() - : m_pszDbRefreshRateType(NULL), - m_pszDbRefreshRateValue(NULL), - m_pszDbDisplayNameFormat(NULL), - m_pszDefDisplayFormat(NULL), - m_pszDefLogFileFormat(NULL), - m_pszDefHistoryFormat(NULL), - m_pszXMLIniFileName(NULL), - m_pszDbStatusMsgFormat(NULL), - m_pszDefStatusMsgFormat(NULL), - m_pszDbLogMode(NULL), - m_pszDbHistoryFormat(NULL), - m_pszDbHistoryCondition(NULL), - m_pszDbLogFile(NULL), - m_pszDbLogFormat(NULL), - m_pszDbLogCondition(NULL), - m_pszDbPopupFormat(NULL), - m_pszDefPopupFormat(NULL), - m_pszDbPopupCondition(NULL), - m_pszDbPopupColourMode(NULL), - m_pszDbPopupBkColour(NULL), - m_pszDbPopupTextColour(NULL), - m_pszDbPopupDelayMode(NULL), - m_pszDbPopupDelayTimeout(NULL), - m_pszDbPopupHistoryFlag(NULL), + : m_pszDbRefreshRateType(nullptr), + m_pszDbRefreshRateValue(nullptr), + m_pszDbDisplayNameFormat(nullptr), + m_pszDefDisplayFormat(nullptr), + m_pszDefLogFileFormat(nullptr), + m_pszDefHistoryFormat(nullptr), + m_pszXMLIniFileName(nullptr), + m_pszDbStatusMsgFormat(nullptr), + m_pszDefStatusMsgFormat(nullptr), + m_pszDbLogMode(nullptr), + m_pszDbHistoryFormat(nullptr), + m_pszDbHistoryCondition(nullptr), + m_pszDbLogFile(nullptr), + m_pszDbLogFormat(nullptr), + m_pszDbLogCondition(nullptr), + m_pszDbPopupFormat(nullptr), + m_pszDefPopupFormat(nullptr), + m_pszDbPopupCondition(nullptr), + m_pszDbPopupColourMode(nullptr), + m_pszDbPopupBkColour(nullptr), + m_pszDbPopupTextColour(nullptr), + m_pszDbPopupDelayMode(nullptr), + m_pszDbPopupDelayTimeout(nullptr), + m_pszDbPopupHistoryFlag(nullptr), m_pszDbTendencyFormat(nullptr), m_pszDefTendencyFormat(L"%r>%p") { diff --git a/plugins/Quotes/src/QuotesProviders.cpp b/plugins/Quotes/src/QuotesProviders.cpp index 3a316df3d3..b097901502 100644 --- a/plugins/Quotes/src/QuotesProviders.cpp +++ b/plugins/Quotes/src/QuotesProviders.cpp @@ -66,7 +66,7 @@ void CQuotesProviders::InitProviders() CQuotesProviders::TQuotesProviderPtr CQuotesProviders::GetContactProviderPtr(MCONTACT hContact)const { char* szProto = GetContactProto(hContact); - if (NULL == szProto || 0 != ::_stricmp(szProto, QUOTES_PROTOCOL_NAME)) + if (nullptr == szProto || 0 != ::_stricmp(szProto, QUOTES_PROTOCOL_NAME)) return TQuotesProviderPtr(); tstring sProvider = Quotes_DBGetStringT(hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_PROVIDER); diff --git a/plugins/Quotes/src/SettingsDlg.cpp b/plugins/Quotes/src/SettingsDlg.cpp index 3a4d3daa52..e9595d65d6 100644 --- a/plugins/Quotes/src/SettingsDlg.cpp +++ b/plugins/Quotes/src/SettingsDlg.cpp @@ -122,7 +122,7 @@ void select_log_file(HWND hDlg) struct CSettingWindowParam { - CSettingWindowParam(MCONTACT hContact) : m_hContact(hContact), m_pPopupSettings(NULL) {} + CSettingWindowParam(MCONTACT hContact) : m_hContact(hContact), m_pPopupSettings(nullptr) {} ~CSettingWindowParam() { delete m_pPopupSettings; } MCONTACT m_hContact; @@ -466,11 +466,11 @@ void ShowSettingsDlg(MCONTACT hContact) MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_SETTINGS, true); assert(hWL); HWND hWnd = WindowList_Find(hWL, hContact); - if (NULL != hWnd) { + if (nullptr != hWnd) { SetForegroundWindow(hWnd); SetFocus(hWnd); } - else CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_CONTACT_SETTINGS), NULL, EditSettingsPerContactDlgProc, LPARAM(hContact)); + else CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_CONTACT_SETTINGS), nullptr, EditSettingsPerContactDlgProc, LPARAM(hContact)); } ////////////////////////////////////////////////////////////////////////// diff --git a/plugins/Quotes/src/XMLEngineMI.cpp b/plugins/Quotes/src/XMLEngineMI.cpp index ed63a63784..413ed619dd 100644 --- a/plugins/Quotes/src/XMLEngineMI.cpp +++ b/plugins/Quotes/src/XMLEngineMI.cpp @@ -72,12 +72,12 @@ public: virtual tstring GetAttributeValue(const tstring& rsAttrName) { LPCTSTR pszValue = xmlGetAttrValue(m_hXML, rsAttrName.c_str()); - return ((NULL != pszValue) ? tstring(pszValue) : tstring()); + return ((nullptr != pszValue) ? tstring(pszValue) : tstring()); } virtual void Write(tostream& o)const { - ptrW ss(xmlToString(m_hXML, NULL)); + ptrW ss(xmlToString(m_hXML, nullptr)); if (ss != NULL) o << (char*)T2Utf(ss); } @@ -111,7 +111,7 @@ IXMLNode::TXMLNodePtr CXMLEngineMI::LoadFile(const tstring& rsFileName)const int nLen = (int)cBytes; ptrW ss(mir_utf8decodeW(pBuffer)); if (ss) { - HXML h = xmlParseString(ss, &nLen, NULL); + HXML h = xmlParseString(ss, &nLen, nullptr); if (h) pResult = IXMLNode::TXMLNodePtr(new CXMLNodeMI(h, true)); } -- cgit v1.2.3