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/group.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/group.c')
-rw-r--r-- | toxcore/group.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/toxcore/group.c b/toxcore/group.c index 02ca3cfe..e0be6ac0 100644 --- a/toxcore/group.c +++ b/toxcore/group.c | |||
@@ -1933,7 +1933,8 @@ static void handle_friend_invite_packet(Messenger *m, uint32_t friendnumber, con | |||
1933 | return; | 1933 | return; |
1934 | } | 1934 | } |
1935 | 1935 | ||
1936 | uint16_t other_groupnum, groupnum; | 1936 | uint16_t other_groupnum; |
1937 | uint16_t groupnum; | ||
1937 | net_unpack_u16(data + 1, &other_groupnum); | 1938 | net_unpack_u16(data + 1, &other_groupnum); |
1938 | net_unpack_u16(data + 1 + sizeof(uint16_t), &groupnum); | 1939 | net_unpack_u16(data + 1 + sizeof(uint16_t), &groupnum); |
1939 | 1940 | ||
@@ -2883,7 +2884,9 @@ static int handle_lossy(void *object, int friendcon_id, const uint8_t *data, uin | |||
2883 | return -1; | 2884 | return -1; |
2884 | } | 2885 | } |
2885 | 2886 | ||
2886 | uint16_t groupnumber, peer_number, message_number; | 2887 | uint16_t groupnumber; |
2888 | uint16_t peer_number; | ||
2889 | uint16_t message_number; | ||
2887 | memcpy(&groupnumber, data + 1, sizeof(uint16_t)); | 2890 | memcpy(&groupnumber, data + 1, sizeof(uint16_t)); |
2888 | memcpy(&peer_number, data + 1 + sizeof(uint16_t), sizeof(uint16_t)); | 2891 | memcpy(&peer_number, data + 1 + sizeof(uint16_t), sizeof(uint16_t)); |
2889 | memcpy(&message_number, data + 1 + sizeof(uint16_t) * 2, sizeof(uint16_t)); | 2892 | memcpy(&message_number, data + 1 + sizeof(uint16_t) * 2, sizeof(uint16_t)); |