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_server.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_server.c')
-rw-r--r-- | toxcore/TCP_server.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c index 0a347342..13e4da45 100644 --- a/toxcore/TCP_server.c +++ b/toxcore/TCP_server.c | |||
@@ -369,7 +369,7 @@ static int send_pending_data(TCP_Secure_Connection *con) | |||
369 | /* return 0 on failure (only if malloc fails) | 369 | /* return 0 on failure (only if malloc fails) |
370 | * return 1 on success | 370 | * return 1 on success |
371 | */ | 371 | */ |
372 | static _Bool add_priority(TCP_Secure_Connection *con, const uint8_t *packet, uint16_t size, uint16_t sent) | 372 | static bool add_priority(TCP_Secure_Connection *con, const uint8_t *packet, uint16_t size, uint16_t sent) |
373 | { | 373 | { |
374 | TCP_Priority_List *p = con->priority_queue_end, *new; | 374 | TCP_Priority_List *p = con->priority_queue_end, *new; |
375 | new = malloc(sizeof(TCP_Priority_List) + size); | 375 | new = malloc(sizeof(TCP_Priority_List) + size); |
@@ -398,13 +398,13 @@ static _Bool add_priority(TCP_Secure_Connection *con, const uint8_t *packet, uin | |||
398 | * return -1 on failure (connection must be killed). | 398 | * return -1 on failure (connection must be killed). |
399 | */ | 399 | */ |
400 | static int write_packet_TCP_secure_connection(TCP_Secure_Connection *con, const uint8_t *data, uint16_t length, | 400 | static int write_packet_TCP_secure_connection(TCP_Secure_Connection *con, const uint8_t *data, uint16_t length, |
401 | _Bool priority) | 401 | bool priority) |
402 | { | 402 | { |
403 | if (length + crypto_box_MACBYTES > MAX_PACKET_SIZE) { | 403 | if (length + crypto_box_MACBYTES > MAX_PACKET_SIZE) { |
404 | return -1; | 404 | return -1; |
405 | } | 405 | } |
406 | 406 | ||
407 | _Bool sendpriority = 1; | 407 | bool sendpriority = 1; |
408 | 408 | ||
409 | if (send_pending_data(con) == -1) { | 409 | if (send_pending_data(con) == -1) { |
410 | if (priority) { | 410 | if (priority) { |