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/CloudFile/src/Services/yandex_service.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/CloudFile/src/Services/yandex_service.cpp')
-rw-r--r-- | plugins/CloudFile/src/Services/yandex_service.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp index d012dd3cc8..1e4d5749cb 100644 --- a/plugins/CloudFile/src/Services/yandex_service.cpp +++ b/plugins/CloudFile/src/Services/yandex_service.cpp @@ -26,7 +26,7 @@ bool CYandexService::IsLoggedIn() ptrA token(db_get_sa(NULL, GetModule(), "TokenSecret")); if (!token || token[0] == 0) return false; - time_t now = time(NULL); + time_t now = time(nullptr); time_t expiresIn = db_get_dw(NULL, GetModule(), "ExpiresIn"); return now < expiresIn; } @@ -45,7 +45,7 @@ void CYandexService::Login() db_set_s(NULL, GetModule(), "TokenSecret", node.as_string().c_str()); node = root.at("expires_in"); - time_t expiresIn = time(NULL) + node.as_int(); + time_t expiresIn = time(nullptr) + node.as_int(); db_set_dw(NULL, GetModule(), "ExpiresIn", expiresIn); node = root.at("refresh_token"); @@ -77,7 +77,7 @@ unsigned CYandexService::RequestAccessTokenThread(void *owner, void *param) YandexAPI::GetAccessTokenRequest request(requestToken); NLHR_PTR response(request.Send(service->hConnection)); - if (response == NULL || response->resultCode != HTTP_CODE_OK) { + if (response == nullptr || response->resultCode != HTTP_CODE_OK) { const char *error = response->dataLength ? response->pData : service->HttpStatusToError(response->resultCode); @@ -106,7 +106,7 @@ unsigned CYandexService::RequestAccessTokenThread(void *owner, void *param) db_set_s(NULL, service->GetModule(), "TokenSecret", node.as_string().c_str()); node = root.at("expires_in"); - time_t expiresIn = time(NULL) + node.as_int(); + time_t expiresIn = time(nullptr) + node.as_int(); db_set_dw(NULL, service->GetModule(), "ExpiresIn", expiresIn); node = root.at("refresh_token"); |