diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/Weather/src/weather_http.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/Weather/src/weather_http.cpp')
-rw-r--r-- | plugins/Weather/src/weather_http.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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);
}
}
|