summaryrefslogtreecommitdiff
path: root/toxcore/ping.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-09-18 01:31:55 +0100
committeriphydf <iphydf@users.noreply.github.com>2016-09-24 21:53:50 +0100
commit15cb4261665bab4ef02a5b1b9db48b9477c9b87a (patch)
treed0c40a45afa19fff26ce1eb5bb703e18a9acdd4a /toxcore/ping.c
parent0d347c2b2e69aa09b079f6daaa00007fef4fe52f (diff)
Make toxcore code C++ compatible.
It is still C code, so still compatible with C compilers as well. This change lets us see more clearly where implicit conversions occur by making them explicit.
Diffstat (limited to 'toxcore/ping.c')
-rw-r--r--toxcore/ping.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/toxcore/ping.c b/toxcore/ping.c
index d15ccd47..052650e3 100644
--- a/toxcore/ping.c
+++ b/toxcore/ping.c
@@ -134,9 +134,9 @@ static int send_ping_response(PING *ping, IP_Port ipp, const uint8_t *public_key
134 return sendpacket(ping->dht->net, ipp, pk, sizeof(pk)); 134 return sendpacket(ping->dht->net, ipp, pk, sizeof(pk));
135} 135}
136 136
137static int handle_ping_request(void *_dht, IP_Port source, const uint8_t *packet, uint16_t length, void *userdata) 137static int handle_ping_request(void *object, IP_Port source, const uint8_t *packet, uint16_t length, void *userdata)
138{ 138{
139 DHT *dht = _dht; 139 DHT *dht = (DHT *)object;
140 int rc; 140 int rc;
141 141
142 if (length != DHT_PING_SIZE) { 142 if (length != DHT_PING_SIZE) {
@@ -177,9 +177,9 @@ static int handle_ping_request(void *_dht, IP_Port source, const uint8_t *packet
177 return 0; 177 return 0;
178} 178}
179 179
180static int handle_ping_response(void *_dht, IP_Port source, const uint8_t *packet, uint16_t length, void *userdata) 180static int handle_ping_response(void *object, IP_Port source, const uint8_t *packet, uint16_t length, void *userdata)
181{ 181{
182 DHT *dht = _dht; 182 DHT *dht = (DHT *)object;
183 int rc; 183 int rc;
184 184
185 if (length != DHT_PING_SIZE) { 185 if (length != DHT_PING_SIZE) {
@@ -353,7 +353,7 @@ void do_to_ping(PING *ping)
353 353
354PING *new_ping(DHT *dht) 354PING *new_ping(DHT *dht)
355{ 355{
356 PING *ping = calloc(1, sizeof(PING)); 356 PING *ping = (PING *)calloc(1, sizeof(PING));
357 357
358 if (ping == NULL) { 358 if (ping == NULL) {
359 return NULL; 359 return NULL;