diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-02-24 20:32:38 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-02-24 20:35:57 +0000 |
commit | afc80922e720f5d2a93bdfb3745da058e5ddf81b (patch) | |
tree | 69c00a0d1d6e6217e443dfc8e344af78e6cc8dd0 /toxcore/net_crypto.c | |
parent | 25debce85074f6f0883905fa496829125ddad713 (diff) |
Some minor cleanups suggested by cppcheck.
DETECTED=cppcheck
Diffstat (limited to 'toxcore/net_crypto.c')
-rw-r--r-- | toxcore/net_crypto.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index f0d701fe..fbdbaab8 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -2517,7 +2517,6 @@ static void send_crypto_packets(Net_Crypto *c) | |||
2517 | conn->last_sendqueue_size[pos] = num_packets_array(&conn->send_array); | 2517 | conn->last_sendqueue_size[pos] = num_packets_array(&conn->send_array); |
2518 | ++conn->last_sendqueue_counter; | 2518 | ++conn->last_sendqueue_counter; |
2519 | 2519 | ||
2520 | unsigned int j; | ||
2521 | long signed int sum = 0; | 2520 | long signed int sum = 0; |
2522 | sum = (long signed int)conn->last_sendqueue_size[(pos) % CONGESTION_QUEUE_ARRAY_SIZE] - | 2521 | sum = (long signed int)conn->last_sendqueue_size[(pos) % CONGESTION_QUEUE_ARRAY_SIZE] - |
2523 | (long signed int)conn->last_sendqueue_size[(pos - (CONGESTION_QUEUE_ARRAY_SIZE - 1)) % CONGESTION_QUEUE_ARRAY_SIZE]; | 2522 | (long signed int)conn->last_sendqueue_size[(pos - (CONGESTION_QUEUE_ARRAY_SIZE - 1)) % CONGESTION_QUEUE_ARRAY_SIZE]; |
@@ -2542,7 +2541,7 @@ static void send_crypto_packets(Net_Crypto *c) | |||
2542 | delay = packets_set_rem_array; | 2541 | delay = packets_set_rem_array; |
2543 | } | 2542 | } |
2544 | 2543 | ||
2545 | for (j = 0; j < CONGESTION_QUEUE_ARRAY_SIZE; ++j) { | 2544 | for (unsigned j = 0; j < CONGESTION_QUEUE_ARRAY_SIZE; ++j) { |
2546 | unsigned int ind = (j + (packets_set_rem_array - delay) + n_p_pos) % CONGESTION_LAST_SENT_ARRAY_SIZE; | 2545 | unsigned int ind = (j + (packets_set_rem_array - delay) + n_p_pos) % CONGESTION_LAST_SENT_ARRAY_SIZE; |
2547 | total_sent += conn->last_num_packets_sent[ind]; | 2546 | total_sent += conn->last_num_packets_sent[ind]; |
2548 | total_resent += conn->last_num_packets_resent[ind]; | 2547 | total_resent += conn->last_num_packets_resent[ind]; |