diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-09-13 22:01:45 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-09-13 22:01:45 +0100 |
commit | 45d28904b92c825d1ac88be9edae8baabcd4bba1 (patch) | |
tree | 7b1b259ba09d35867c141cf072707e6a0891f97a /toxcore/TCP_client.c | |
parent | a8823830d39bdbde8d4f4f34bfcb26dc4bf79741 (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/TCP_client.c')
-rw-r--r-- | toxcore/TCP_client.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/TCP_client.c b/toxcore/TCP_client.c index d825cf38..6c5ea0e1 100644 --- a/toxcore/TCP_client.c +++ b/toxcore/TCP_client.c | |||
@@ -330,7 +330,7 @@ static int send_pending_data(TCP_Client_Connection *con) | |||
330 | /* return 0 on failure (only if malloc fails) | 330 | /* return 0 on failure (only if malloc fails) |
331 | * return 1 on success | 331 | * return 1 on success |
332 | */ | 332 | */ |
333 | static _Bool add_priority(TCP_Client_Connection *con, const uint8_t *packet, uint16_t size, uint16_t sent) | 333 | static bool add_priority(TCP_Client_Connection *con, const uint8_t *packet, uint16_t size, uint16_t sent) |
334 | { | 334 | { |
335 | TCP_Priority_List *p = con->priority_queue_end, *new; | 335 | TCP_Priority_List *p = con->priority_queue_end, *new; |
336 | new = malloc(sizeof(TCP_Priority_List) + size); | 336 | new = malloc(sizeof(TCP_Priority_List) + size); |
@@ -370,13 +370,13 @@ static void wipe_priority_list(TCP_Client_Connection *con) | |||
370 | * return -1 on failure (connection must be killed). | 370 | * return -1 on failure (connection must be killed). |
371 | */ | 371 | */ |
372 | static int write_packet_TCP_secure_connection(TCP_Client_Connection *con, const uint8_t *data, uint16_t length, | 372 | static int write_packet_TCP_secure_connection(TCP_Client_Connection *con, const uint8_t *data, uint16_t length, |
373 | _Bool priority) | 373 | bool priority) |
374 | { | 374 | { |
375 | if (length + crypto_box_MACBYTES > MAX_PACKET_SIZE) { | 375 | if (length + crypto_box_MACBYTES > MAX_PACKET_SIZE) { |
376 | return -1; | 376 | return -1; |
377 | } | 377 | } |
378 | 378 | ||
379 | _Bool sendpriority = 1; | 379 | bool sendpriority = 1; |
380 | 380 | ||
381 | if (send_pending_data(con) == -1) { | 381 | if (send_pending_data(con) == -1) { |
382 | if (priority) { | 382 | if (priority) { |