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/network.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'toxcore/network.c') diff --git a/toxcore/network.c b/toxcore/network.c index e5a58331..c448cb7e 100644 --- a/toxcore/network.c +++ b/toxcore/network.c @@ -1532,7 +1532,8 @@ size_t net_unpack_u16(const uint8_t *bytes, uint16_t *v) size_t net_unpack_u32(const uint8_t *bytes, uint32_t *v) { const uint8_t *p = bytes; - uint16_t lo, hi; + uint16_t hi; + uint16_t lo; p += net_unpack_u16(p, &hi); p += net_unpack_u16(p, &lo); *v = ((uint32_t)hi << 16) | lo; @@ -1542,7 +1543,8 @@ size_t net_unpack_u32(const uint8_t *bytes, uint32_t *v) size_t net_unpack_u64(const uint8_t *bytes, uint64_t *v) { const uint8_t *p = bytes; - uint32_t lo, hi; + uint32_t hi; + uint32_t lo; p += net_unpack_u32(p, &hi); p += net_unpack_u32(p, &lo); *v = ((uint64_t)hi << 32) | lo; -- cgit v1.2.3