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 /protocols/Steam/src/steam_polling.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'protocols/Steam/src/steam_polling.cpp')
-rw-r--r-- | protocols/Steam/src/steam_polling.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp index 49407e4e59..ac768f09f7 100644 --- a/protocols/Steam/src/steam_polling.cpp +++ b/protocols/Steam/src/steam_polling.cpp @@ -4,7 +4,7 @@ void CSteamProto::ParsePollData(JSONNode *data) { - JSONNode *node, *item = NULL; + JSONNode *node, *item = nullptr; // FIXME: Temporary solution for receivng too many duplicated typing events; should be reworked better std::string typingUser; @@ -13,7 +13,7 @@ void CSteamProto::ParsePollData(JSONNode *data) for (size_t i = 0; i < json_size(data); i++) { item = json_at(data, i); - if (item == NULL) + if (item == nullptr) break; node = json_get(item, "steamid_from"); @@ -38,7 +38,7 @@ void CSteamProto::ParsePollData(JSONNode *data) PROTORECVEVENT recv = { 0 }; recv.timestamp = timestamp; recv.szMessage = szMessage; - if (wcsstr(type, L"my_") == NULL) + if (wcsstr(type, L"my_") == nullptr) { ProtoChainRecvMsg(hContact, &recv); } @@ -169,7 +169,7 @@ void CSteamProto::ParsePollData(JSONNode *data) dbei.cbBlob = 1; dbei.eventType = EVENTTYPE_STEAM_CHATSTATES; dbei.flags = DBEF_READ; - dbei.timestamp = time(NULL); + dbei.timestamp = time(nullptr); dbei.szModule = m_szModuleName; db_event_add(hContact, &dbei); } @@ -217,7 +217,7 @@ void CSteamProto::PollingThread(void*) ptrA body((char*)mir_calloc(response->dataLength + 2)); mir_strncpy(body, response->pData, response->dataLength + 1); JSONROOT root(body); - if (root == NULL) + if (root == nullptr) { errors++; } @@ -241,7 +241,7 @@ void CSteamProto::PollingThread(void*) node = json_get(root, "messages"); JSONNode *nroot = json_as_array(node); - if (nroot != NULL) + if (nroot != nullptr) { ParsePollData(nroot); json_delete(nroot); @@ -307,6 +307,6 @@ void CSteamProto::PollingThread(void*) SetStatus(ID_STATUS_OFFLINE); } - m_hPollingThread = NULL; + m_hPollingThread = nullptr; debugLogW(L"CSteamProto::PollingThread: leaving"); } |