From 8c0fd40356e4a7724b556e17b15b0d14f7d25b4d Mon Sep 17 00:00:00 2001 From: iphydf Date: Tue, 5 May 2020 22:56:03 +0100 Subject: 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). --- toxcore/DHT.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'toxcore/DHT.c') 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) static int cmp_dht_entry(const void *a, const void *b) { - DHT_Cmp_data cmp1, cmp2; + DHT_Cmp_data cmp1; + DHT_Cmp_data cmp2; memcpy(&cmp1, a, sizeof(DHT_Cmp_data)); memcpy(&cmp2, b, sizeof(DHT_Cmp_data)); const Client_data entry1 = cmp1.entry; @@ -2418,7 +2419,8 @@ static int handle_hardening(void *object, IP_Port source, const uint8_t *source_ return 1; } - Node_format node, tocheck_node; + Node_format node; + Node_format tocheck_node; node.ip_port = source; memcpy(node.public_key, source_pubkey, CRYPTO_PUBLIC_KEY_SIZE); memcpy(&tocheck_node, packet + 1, sizeof(Node_format)); -- cgit v1.2.3