summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-08-26 18:41:34 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-08-26 20:58:37 +0000
commit9a70a2c1856a2b1a63aa1e938ddee56bb98308ca (patch)
tree6b66864a12e24a256194d1a64525e576e86d1b32 /toxcore/DHT.c
parent5352f483016949073556a1f9ac488051fe96c308 (diff)
Use `bool` in place of 0/1 int values.
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r--toxcore/DHT.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index 46db6e76..dc21575e 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -281,7 +281,7 @@ void get_shared_key(const Mono_Time *mono_time, Shared_Keys *shared_keys, uint8_
281 281
282 if (num != UINT32_MAX) { 282 if (num != UINT32_MAX) {
283 Shared_Key *const key = &shared_keys->keys[curr]; 283 Shared_Key *const key = &shared_keys->keys[curr];
284 key->stored = 1; 284 key->stored = true;
285 key->times_requested = 1; 285 key->times_requested = 1;
286 memcpy(key->public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE); 286 memcpy(key->public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
287 memcpy(key->shared_key, shared_key, CRYPTO_SHARED_KEY_SIZE); 287 memcpy(key->shared_key, shared_key, CRYPTO_SHARED_KEY_SIZE);
@@ -491,7 +491,7 @@ static int dht_create_packet(const uint8_t public_key[CRYPTO_PUBLIC_KEY_SIZE],
491 * Return size of unpacked ip_port on success. 491 * Return size of unpacked ip_port on success.
492 * Return -1 on failure. 492 * Return -1 on failure.
493 */ 493 */
494int unpack_ip_port(IP_Port *ip_port, const uint8_t *data, uint16_t length, uint8_t tcp_enabled) 494int unpack_ip_port(IP_Port *ip_port, const uint8_t *data, uint16_t length, bool tcp_enabled)
495{ 495{
496 if (data == nullptr) { 496 if (data == nullptr) {
497 return -1; 497 return -1;
@@ -589,7 +589,7 @@ int pack_nodes(uint8_t *data, uint16_t length, const Node_format *nodes, uint16_
589 * return -1 on failure. 589 * return -1 on failure.
590 */ 590 */
591int unpack_nodes(Node_format *nodes, uint16_t max_num_nodes, uint16_t *processed_data_len, const uint8_t *data, 591int unpack_nodes(Node_format *nodes, uint16_t max_num_nodes, uint16_t *processed_data_len, const uint8_t *data,
592 uint16_t length, uint8_t tcp_enabled) 592 uint16_t length, bool tcp_enabled)
593{ 593{
594 uint32_t num = 0, len_processed = 0; 594 uint32_t num = 0, len_processed = 0;
595 595