cleanup: Remove superfluous parentheses on the rhs of assignments.

This commit is contained in:
iphydf 2022-02-25 01:02:11 +00:00
parent aa72c47125
commit cad7cf8344
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
5 changed files with 9 additions and 9 deletions

View File

@ -457,7 +457,7 @@ static uint8_t *msg_parse_header_out(MSIHeaderID id, uint8_t *dest, const void *
memcpy(dest, value, value_len); memcpy(dest, value, value_len);
*length += (2 + value_len); *length += 2 + value_len;
return dest + value_len; /* Set to next position ready to be written */ return dest + value_len; /* Set to next position ready to be written */
} }

View File

@ -2617,16 +2617,16 @@ uint32_t dht_size(const DHT *dht)
} }
for (uint32_t i = 0; i < LCLIENT_LIST; ++i) { for (uint32_t i = 0; i < LCLIENT_LIST; ++i) {
numv4 += (dht->close_clientlist[i].assoc4.timestamp != 0); numv4 += dht->close_clientlist[i].assoc4.timestamp != 0;
numv6 += (dht->close_clientlist[i].assoc6.timestamp != 0); numv6 += dht->close_clientlist[i].assoc6.timestamp != 0;
} }
for (uint32_t i = 0; i < DHT_FAKE_FRIEND_NUMBER && i < dht->num_friends; ++i) { for (uint32_t i = 0; i < DHT_FAKE_FRIEND_NUMBER && i < dht->num_friends; ++i) {
const DHT_Friend *const fr = &dht->friends_list[i]; const DHT_Friend *const fr = &dht->friends_list[i];
for (uint32_t j = 0; j < MAX_FRIEND_CLIENTS; ++j) { for (uint32_t j = 0; j < MAX_FRIEND_CLIENTS; ++j) {
numv4 += (fr->client_list[j].assoc4.timestamp != 0); numv4 += fr->client_list[j].assoc4.timestamp != 0;
numv6 += (fr->client_list[j].assoc6.timestamp != 0); numv6 += fr->client_list[j].assoc6.timestamp != 0;
} }
} }

View File

@ -685,7 +685,7 @@ static int addpeer(Group_Chats *g_c, uint32_t groupnumber, const uint8_t *real_p
g->group[new_index].temp_pk_updated = true; g->group[new_index].temp_pk_updated = true;
g->group[new_index].peer_number = peer_number; g->group[new_index].peer_number = peer_number;
g->group[new_index].last_active = mono_time_get(g_c->mono_time); g->group[new_index].last_active = mono_time_get(g_c->mono_time);
g->group[new_index].is_friend = (getfriend_id(g_c->m, real_pk) != -1); g->group[new_index].is_friend = getfriend_id(g_c->m, real_pk) != -1;
++g->numpeers; ++g->numpeers;
add_to_closest(g, real_pk, temp_pk); add_to_closest(g, real_pk, temp_pk);
@ -3472,7 +3472,7 @@ static uint32_t load_group(Group_c *g, const Group_Chats *g_c, const uint8_t *da
data += peer->nick_len; data += peer->nick_len;
// NOTE: this relies on friends being loaded before conferences. // NOTE: this relies on friends being loaded before conferences.
peer->is_friend = (getfriend_id(g_c->m, peer->real_pk) != -1); peer->is_friend = getfriend_id(g_c->m, peer->real_pk) != -1;
} }
if (g->numfrozen > g->maxfrozen) { if (g->numfrozen > g->maxfrozen) {

View File

@ -2809,7 +2809,7 @@ static void send_crypto_packets(Net_Crypto *c)
} }
if (total_send_rate > CRYPTO_PACKET_MIN_RATE) { if (total_send_rate > CRYPTO_PACKET_MIN_RATE) {
sleep_time = (1000.0 / total_send_rate); sleep_time = 1000.0 / total_send_rate;
if (c->current_sleep_time > sleep_time) { if (c->current_sleep_time > sleep_time) {
c->current_sleep_time = sleep_time + 1; c->current_sleep_time = sleep_time + 1;

View File

@ -1630,7 +1630,7 @@ static void do_friend(Onion_Client *onion_c, uint16_t friendnum)
uint16_t n = num_nodes; uint16_t n = num_nodes;
if (num_nodes > (MAX_ONION_CLIENTS / 2)) { if (num_nodes > (MAX_ONION_CLIENTS / 2)) {
n = (MAX_ONION_CLIENTS / 2); n = MAX_ONION_CLIENTS / 2;
} }
if (count <= random_range_u32(MAX_ONION_CLIENTS)) { if (count <= random_range_u32(MAX_ONION_CLIENTS)) {