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/GmailNotifier/src/check.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/GmailNotifier/src/check.cpp')
-rw-r--r-- | plugins/GmailNotifier/src/check.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/GmailNotifier/src/check.cpp b/plugins/GmailNotifier/src/check.cpp index fbcdc83e57..e2d5af213a 100644 --- a/plugins/GmailNotifier/src/check.cpp +++ b/plugins/GmailNotifier/src/check.cpp @@ -7,7 +7,7 @@ void CheckMailInbox(Account *curAcc) {
// internet connection handle
// internet request handle
- HINTERNET hHTTPConnection = 0, hHTTPRequest = 0;
+ HINTERNET hHTTPConnection = nullptr, hHTTPRequest = nullptr;
DBVARIANT dbv;
static char *contentType = "Content-Type: application/x-www-form-urlencoded";
@@ -49,8 +49,8 @@ void CheckMailInbox(Account *curAcc) hHTTPConnection = InternetConnectA(hHTTPOpen,
"www.google.com",
INTERNET_DEFAULT_HTTPS_PORT,
- NULL,
- NULL,
+ nullptr,
+ nullptr,
INTERNET_SERVICE_HTTP,
0,
0);
@@ -62,7 +62,7 @@ void CheckMailInbox(Account *curAcc) mir_strcpy(str, "/a/");
mir_strcat(str, curAcc->hosted);
mir_strcat(str, "/LoginAction");
- hHTTPRequest = HttpOpenRequestA(hHTTPConnection, "POST", str, HTTP_VERSIONA, NULL, NULL, INTERNET_FLAG_SECURE, 0);
+ hHTTPRequest = HttpOpenRequestA(hHTTPConnection, "POST", str, HTTP_VERSIONA, nullptr, nullptr, INTERNET_FLAG_SECURE, 0);
mir_strcat(requestBuffer, curAcc->hosted);
mir_strcat(requestBuffer, "%2Ffeed%2Fatom&service=mail&userName=");
mir_strcat(requestBuffer, curAcc->name);
@@ -77,10 +77,10 @@ void CheckMailInbox(Account *curAcc) InternetCloseHandle(hHTTPConnection);
InternetCloseHandle(hHTTPRequest);
- hHTTPRequest = 0;
+ hHTTPRequest = nullptr;
}
- hHTTPConnection = InternetConnectA(hHTTPOpen, "mail.google.com", INTERNET_DEFAULT_HTTPS_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
+ hHTTPConnection = InternetConnectA(hHTTPOpen, "mail.google.com", INTERNET_DEFAULT_HTTPS_PORT, nullptr, nullptr, INTERNET_SERVICE_HTTP, 0, 0);
if (!hHTTPConnection) {
mir_strcat(curAcc->results.content, Translate("Can't reach server!"));
goto error_handle;
@@ -92,10 +92,10 @@ void CheckMailInbox(Account *curAcc) }
else mir_strcpy(str, "/mail/feed/atom");
- hHTTPRequest = HttpOpenRequest(hHTTPConnection, L"GET", _A2T(str), NULL, NULL, NULL, INTERNET_FLAG_SECURE | INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_RELOAD, 0);
+ hHTTPRequest = HttpOpenRequest(hHTTPConnection, L"GET", _A2T(str), nullptr, nullptr, nullptr, INTERNET_FLAG_SECURE | INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_RELOAD, 0);
InternetSetOption(hHTTPRequest, INTERNET_OPTION_USERNAME, _A2T(curAcc->name), (int)mir_strlen(curAcc->name) + 1);
InternetSetOption(hHTTPRequest, INTERNET_OPTION_PASSWORD, _A2T(curAcc->pass), (int)mir_strlen(curAcc->pass) + 1);
- if (!HttpSendRequest(hHTTPRequest, NULL, 0, NULL, 0)) {
+ if (!HttpSendRequest(hHTTPRequest, nullptr, 0, nullptr, 0)) {
mir_strcat(curAcc->results.content, Translate("Can't get RSS feed!"));
goto error_handle;
}
@@ -154,7 +154,7 @@ int ParsePage(char *page, resultLink *prst) int num = 0;
wchar_t str[64];
- prst->next = NULL;
+ prst->next = nullptr;
if (strstr(page, "Unauthorized"))
return -1;
if (!(str_head = strstr(page, "<entry>")))
@@ -180,9 +180,9 @@ int ParsePage(char *page, resultLink *prst) mir_strcpy(prst->content, name);
mir_strcat(prst->content, title);
MultiByteToWideChar(CP_UTF8, 0, prst->content, -1, str, 64);
- WideCharToMultiByte(CP_ACP, 0, str, -1, prst->content, 64, NULL, NULL);
+ WideCharToMultiByte(CP_ACP, 0, str, -1, prst->content, 64, nullptr, nullptr);
num++;
}
- prst->next = NULL;
+ prst->next = nullptr;
return num;
}
|