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/Weather/src/weather_http.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins/Weather/src/weather_http.cpp') diff --git a/plugins/Weather/src/weather_http.cpp b/plugins/Weather/src/weather_http.cpp index d2ffb09070..8b5995926b 100644 --- a/plugins/Weather/src/weather_http.cpp +++ b/plugins/Weather/src/weather_http.cpp @@ -47,7 +47,7 @@ static int findHeader(const NETLIBHTTPREQUEST *nlhrReply, const char *hdr) // int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **szData) { - if (userAgent == NULL || userAgent[0] == 0) + if (userAgent == nullptr || userAgent[0] == 0) userAgent = NETLIB_USER_AGENT; NETLIBHTTPHEADER headers[5]; @@ -71,17 +71,17 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **s nlhr.headers = headers; nlhr.headersCount = _countof(headers); - if (cookie == NULL || cookie[0] == 0) + if (cookie == nullptr || cookie[0] == 0) --nlhr.headersCount; // download the page NETLIBHTTPREQUEST *nlhrReply = Netlib_HttpTransaction(hNetlibUser, &nlhr); - if (nlhrReply == 0) { + if (nlhrReply == nullptr) { // if the data does not downloaded successfully (ie. disconnected), then return 1000 as error code *szData = (wchar_t*)mir_alloc(512); // store the error code in szData mir_wstrcpy(*szData, L"NetLib error occurred!!"); - hNetlibHttp = NULL; + hNetlibHttp = nullptr; return NLHRF_REDIRECT; } @@ -125,10 +125,10 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **s } } - wchar_t *retVal = NULL; + wchar_t *retVal = nullptr; if (bIsUtf) retVal = mir_utf8decodeW(nlhrReply->pData); - if (retVal == NULL) + if (retVal == nullptr) retVal = mir_a2u(nlhrReply->pData); *szData = retVal; } @@ -164,7 +164,7 @@ void NetlibHttpDisconnect(void) { if (hNetlibHttp) { HANDLE hConn = hNetlibHttp; - hNetlibHttp = NULL; + hNetlibHttp = nullptr; Netlib_CloseHandle(hConn); } } -- cgit v1.2.3