summaryrefslogtreecommitdiff
path: root/toxcore/onion.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-01-28 21:30:39 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-01-30 23:35:50 +0000
commit92ffad1a72bc8c422426d52ac408bd71242dd047 (patch)
treef592f353068dd2043525dd2cc04d6124a4ed4bc4 /toxcore/onion.c
parent623e9ac331df7323660e21c8a2226523a5ee713b (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/onion.c')
-rw-r--r--toxcore/onion.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/toxcore/onion.c b/toxcore/onion.c
index 2279d4e3..ffe99c2d 100644
--- a/toxcore/onion.c
+++ b/toxcore/onion.c
@@ -635,14 +635,14 @@ void set_callback_handle_recv_1(Onion *onion, int (*function)(void *, IP_Port, c
635 635
636Onion *new_onion(DHT *dht) 636Onion *new_onion(DHT *dht)
637{ 637{
638 if (dht == NULL) { 638 if (dht == nullptr) {
639 return NULL; 639 return nullptr;
640 } 640 }
641 641
642 Onion *onion = (Onion *)calloc(1, sizeof(Onion)); 642 Onion *onion = (Onion *)calloc(1, sizeof(Onion));
643 643
644 if (onion == NULL) { 644 if (onion == nullptr) {
645 return NULL; 645 return nullptr;
646 } 646 }
647 647
648 onion->dht = dht; 648 onion->dht = dht;
@@ -663,17 +663,17 @@ Onion *new_onion(DHT *dht)
663 663
664void kill_onion(Onion *onion) 664void kill_onion(Onion *onion)
665{ 665{
666 if (onion == NULL) { 666 if (onion == nullptr) {
667 return; 667 return;
668 } 668 }
669 669
670 networking_registerhandler(onion->net, NET_PACKET_ONION_SEND_INITIAL, NULL, NULL); 670 networking_registerhandler(onion->net, NET_PACKET_ONION_SEND_INITIAL, nullptr, nullptr);
671 networking_registerhandler(onion->net, NET_PACKET_ONION_SEND_1, NULL, NULL); 671 networking_registerhandler(onion->net, NET_PACKET_ONION_SEND_1, nullptr, nullptr);
672 networking_registerhandler(onion->net, NET_PACKET_ONION_SEND_2, NULL, NULL); 672 networking_registerhandler(onion->net, NET_PACKET_ONION_SEND_2, nullptr, nullptr);
673 673
674 networking_registerhandler(onion->net, NET_PACKET_ONION_RECV_3, NULL, NULL); 674 networking_registerhandler(onion->net, NET_PACKET_ONION_RECV_3, nullptr, nullptr);
675 networking_registerhandler(onion->net, NET_PACKET_ONION_RECV_2, NULL, NULL); 675 networking_registerhandler(onion->net, NET_PACKET_ONION_RECV_2, nullptr, nullptr);
676 networking_registerhandler(onion->net, NET_PACKET_ONION_RECV_1, NULL, NULL); 676 networking_registerhandler(onion->net, NET_PACKET_ONION_RECV_1, nullptr, nullptr);
677 677
678 free(onion); 678 free(onion);
679} 679}