diff options
author | iphydf <iphydf@users.noreply.github.com> | 2020-05-05 22:56:03 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2020-05-05 23:22:29 +0100 |
commit | 8c0fd40356e4a7724b556e17b15b0d14f7d25b4d (patch) | |
tree | 489599830b083d5705c0b5d2c8fb31a43242f90c /toxcore/DHT.c | |
parent | fd2bb77923b68ec50e4812c9663eab42314d4557 (diff) |
refactor: Remove multi-declarators entirely.
We no longer allow `int a, b;`. In the few cases where we used it, we
instead better
* limit the scope of the identifier (e.g. in a for-init-decl)
* split the line and have 2 separate declarators, because the
identifiers designate different types of things (e.g. friend numbers
and group numbers).
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r-- | toxcore/DHT.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 40f477fd..15f554e2 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -900,7 +900,8 @@ static bool incorrect_hardening(const IPPTsPng *assoc) | |||
900 | 900 | ||
901 | static int cmp_dht_entry(const void *a, const void *b) | 901 | static int cmp_dht_entry(const void *a, const void *b) |
902 | { | 902 | { |
903 | DHT_Cmp_data cmp1, cmp2; | 903 | DHT_Cmp_data cmp1; |
904 | DHT_Cmp_data cmp2; | ||
904 | memcpy(&cmp1, a, sizeof(DHT_Cmp_data)); | 905 | memcpy(&cmp1, a, sizeof(DHT_Cmp_data)); |
905 | memcpy(&cmp2, b, sizeof(DHT_Cmp_data)); | 906 | memcpy(&cmp2, b, sizeof(DHT_Cmp_data)); |
906 | const Client_data entry1 = cmp1.entry; | 907 | const Client_data entry1 = cmp1.entry; |
@@ -2418,7 +2419,8 @@ static int handle_hardening(void *object, IP_Port source, const uint8_t *source_ | |||
2418 | return 1; | 2419 | return 1; |
2419 | } | 2420 | } |
2420 | 2421 | ||
2421 | Node_format node, tocheck_node; | 2422 | Node_format node; |
2423 | Node_format tocheck_node; | ||
2422 | node.ip_port = source; | 2424 | node.ip_port = source; |
2423 | memcpy(node.public_key, source_pubkey, CRYPTO_PUBLIC_KEY_SIZE); | 2425 | memcpy(node.public_key, source_pubkey, CRYPTO_PUBLIC_KEY_SIZE); |
2424 | memcpy(&tocheck_node, packet + 1, sizeof(Node_format)); | 2426 | memcpy(&tocheck_node, packet + 1, sizeof(Node_format)); |