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/Tox/src/tox_bootstrap.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'protocols/Tox/src/tox_bootstrap.cpp')
-rw-r--r-- | protocols/Tox/src/tox_bootstrap.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/Tox/src/tox_bootstrap.cpp b/protocols/Tox/src/tox_bootstrap.cpp index 6617044e73..5f1ae93dc1 100644 --- a/protocols/Tox/src/tox_bootstrap.cpp +++ b/protocols/Tox/src/tox_bootstrap.cpp @@ -5,7 +5,7 @@ void CToxProto::BootstrapUdpNode(Tox *tox, const char *address, int port, const if (!toxThread) return; - if (address == NULL || hexKey == NULL) + if (address == nullptr || hexKey == nullptr) return; ToxBinAddress binKey(hexKey, TOX_PUBLIC_KEY_SIZE * 2); @@ -19,7 +19,7 @@ void CToxProto::BootstrapTcpRelay(Tox *tox, const char *address, int port, const if (!toxThread) return; - if (address == NULL || hexKey == NULL) + if (address == nullptr || hexKey == nullptr) return; ToxBinAddress binKey(hexKey, TOX_PUBLIC_KEY_SIZE * 2); @@ -65,7 +65,7 @@ void CToxProto::BootstrapNodesFromJson(Tox *tox, bool isIPv6) if (IsFileExists(path)) { FILE *hFile = _wfopen(path, L"r"); - if (hFile != NULL) { + if (hFile != nullptr) { _fseeki64(hFile, 0, SEEK_END); size_t size = _ftelli64(hFile); json = (char*)mir_calloc(size); @@ -141,8 +141,8 @@ void CToxProto::UpdateNodes() ptrW path(mir_wstrdup((wchar_t*)VARSW(_A2W(TOX_JSON_PATH)))); if (!IsFileExists(path)) { - HANDLE hProfile = CreateFile(path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); - if (hProfile == NULL) { + HANDLE hProfile = CreateFile(path, GENERIC_READ | GENERIC_WRITE, 0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr); + if (hProfile == nullptr) { debugLogA(__FUNCTION__": failed to create tox.json"); return; } |