summaryrefslogtreecommitdiff
path: root/toxcore/onion_announce.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/onion_announce.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/onion_announce.c')
-rw-r--r--toxcore/onion_announce.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c
index 42b3a635..acde04a7 100644
--- a/toxcore/onion_announce.c
+++ b/toxcore/onion_announce.c
@@ -309,7 +309,7 @@ static int add_to_entries(Onion_Announce *onion_a, IP_Port ret_ip_port, const ui
309 309
310static int handle_announce_request(void *object, IP_Port source, const uint8_t *packet, uint16_t length, void *userdata) 310static int handle_announce_request(void *object, IP_Port source, const uint8_t *packet, uint16_t length, void *userdata)
311{ 311{
312 Onion_Announce *onion_a = object; 312 Onion_Announce *onion_a = (Onion_Announce *)object;
313 313
314 if (length != ANNOUNCE_REQUEST_SIZE_RECV) { 314 if (length != ANNOUNCE_REQUEST_SIZE_RECV) {
315 return 1; 315 return 1;
@@ -408,7 +408,7 @@ static int handle_announce_request(void *object, IP_Port source, const uint8_t *
408 408
409static int handle_data_request(void *object, IP_Port source, const uint8_t *packet, uint16_t length, void *userdata) 409static int handle_data_request(void *object, IP_Port source, const uint8_t *packet, uint16_t length, void *userdata)
410{ 410{
411 Onion_Announce *onion_a = object; 411 Onion_Announce *onion_a = (Onion_Announce *)object;
412 412
413 if (length <= DATA_REQUEST_MIN_SIZE_RECV) { 413 if (length <= DATA_REQUEST_MIN_SIZE_RECV) {
414 return 1; 414 return 1;
@@ -442,7 +442,7 @@ Onion_Announce *new_onion_announce(DHT *dht)
442 return NULL; 442 return NULL;
443 } 443 }
444 444
445 Onion_Announce *onion_a = calloc(1, sizeof(Onion_Announce)); 445 Onion_Announce *onion_a = (Onion_Announce *)calloc(1, sizeof(Onion_Announce));
446 446
447 if (onion_a == NULL) { 447 if (onion_a == NULL) {
448 return NULL; 448 return NULL;