diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-01-28 21:30:39 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-01-30 23:35:50 +0000 |
commit | 92ffad1a72bc8c422426d52ac408bd71242dd047 (patch) | |
tree | f592f353068dd2043525dd2cc04d6124a4ed4bc4 /toxcore/ping.c | |
parent | 623e9ac331df7323660e21c8a2226523a5ee713b (diff) |
Use nullptr as NULL pointer constant instead of NULL or 0.
This changes only code, no string literals or comments.
Diffstat (limited to 'toxcore/ping.c')
-rw-r--r-- | toxcore/ping.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/toxcore/ping.c b/toxcore/ping.c index 1e5892eb..bede07a1 100644 --- a/toxcore/ping.c +++ b/toxcore/ping.c | |||
@@ -355,15 +355,15 @@ Ping *ping_new(DHT *dht) | |||
355 | { | 355 | { |
356 | Ping *ping = (Ping *)calloc(1, sizeof(Ping)); | 356 | Ping *ping = (Ping *)calloc(1, sizeof(Ping)); |
357 | 357 | ||
358 | if (ping == NULL) { | 358 | if (ping == nullptr) { |
359 | return NULL; | 359 | return nullptr; |
360 | } | 360 | } |
361 | 361 | ||
362 | ping->ping_array = ping_array_new(PING_NUM_MAX, PING_TIMEOUT); | 362 | ping->ping_array = ping_array_new(PING_NUM_MAX, PING_TIMEOUT); |
363 | 363 | ||
364 | if (ping->ping_array == NULL) { | 364 | if (ping->ping_array == nullptr) { |
365 | free(ping); | 365 | free(ping); |
366 | return NULL; | 366 | return nullptr; |
367 | } | 367 | } |
368 | 368 | ||
369 | ping->dht = dht; | 369 | ping->dht = dht; |
@@ -375,8 +375,8 @@ Ping *ping_new(DHT *dht) | |||
375 | 375 | ||
376 | void ping_kill(Ping *ping) | 376 | void ping_kill(Ping *ping) |
377 | { | 377 | { |
378 | networking_registerhandler(dht_get_net(ping->dht), NET_PACKET_PING_REQUEST, NULL, NULL); | 378 | networking_registerhandler(dht_get_net(ping->dht), NET_PACKET_PING_REQUEST, nullptr, nullptr); |
379 | networking_registerhandler(dht_get_net(ping->dht), NET_PACKET_PING_RESPONSE, NULL, NULL); | 379 | networking_registerhandler(dht_get_net(ping->dht), NET_PACKET_PING_RESPONSE, nullptr, nullptr); |
380 | ping_array_kill(ping->ping_array); | 380 | ping_array_kill(ping->ping_array); |
381 | 381 | ||
382 | free(ping); | 382 | free(ping); |