summaryrefslogtreecommitdiff
path: root/toxcore/onion_client.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-09-13 22:01:45 +0100
committeriphydf <iphydf@users.noreply.github.com>2016-09-13 22:01:45 +0100
commit45d28904b92c825d1ac88be9edae8baabcd4bba1 (patch)
tree7b1b259ba09d35867c141cf072707e6a0891f97a /toxcore/onion_client.c
parenta8823830d39bdbde8d4f4f34bfcb26dc4bf79741 (diff)
Use <stdbool.h> and replace _Bool with bool.
This header is a requirement for the public API, therefore is assumed to exist. It is a C99 standard library header, and _Bool is not intended to be used directly, except in legacy code that defines bool (and true/false) itself. We don't use or depend on such code. None of our client code uses or depends on such code. There is no reason to not use bool.
Diffstat (limited to 'toxcore/onion_client.c')
-rw-r--r--toxcore/onion_client.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c
index 0dca8525..04822cc1 100644
--- a/toxcore/onion_client.c
+++ b/toxcore/onion_client.c
@@ -213,7 +213,7 @@ static int is_path_used(const Onion_Client_Paths *onion_paths, const Node_format
213} 213}
214 214
215/* is path timed out */ 215/* is path timed out */
216static _Bool path_timed_out(Onion_Client_Paths *onion_paths, uint32_t pathnum) 216static bool path_timed_out(Onion_Client_Paths *onion_paths, uint32_t pathnum)
217{ 217{
218 pathnum = pathnum % NUMBER_ONION_PATHS; 218 pathnum = pathnum % NUMBER_ONION_PATHS;
219 219
@@ -275,7 +275,7 @@ static int random_path(const Onion_Client *onion_c, Onion_Client_Paths *onion_pa
275} 275}
276 276
277/* Does path with path_num exist. */ 277/* Does path with path_num exist. */
278static _Bool path_exists(Onion_Client_Paths *onion_paths, uint32_t path_num) 278static bool path_exists(Onion_Client_Paths *onion_paths, uint32_t path_num)
279{ 279{
280 if (path_timed_out(onion_paths, path_num)) { 280 if (path_timed_out(onion_paths, path_num)) {
281 return 0; 281 return 0;
@@ -1577,7 +1577,7 @@ void do_onion_client(Onion_Client *onion_c)
1577 } 1577 }
1578 } 1578 }
1579 1579
1580 _Bool UDP_connected = DHT_non_lan_connected(onion_c->dht); 1580 bool UDP_connected = DHT_non_lan_connected(onion_c->dht);
1581 1581
1582 if (is_timeout(onion_c->first_run, ONION_CONNECTION_SECONDS * 2)) { 1582 if (is_timeout(onion_c->first_run, ONION_CONNECTION_SECONDS * 2)) {
1583 set_tcp_onion_status(onion_c->c->tcp_c, !UDP_connected); 1583 set_tcp_onion_status(onion_c->c->tcp_c, !UDP_connected);