diff --git a/toxav/msi.c b/toxav/msi.c index 736f7acb..55ccfea5 100644 --- a/toxav/msi.c +++ b/toxav/msi.c @@ -457,7 +457,7 @@ static uint8_t *msg_parse_header_out(MSIHeaderID id, uint8_t *dest, const void * 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 */ } diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 90050f52..e26cdbad 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c @@ -2617,16 +2617,16 @@ uint32_t dht_size(const DHT *dht) } for (uint32_t i = 0; i < LCLIENT_LIST; ++i) { - numv4 += (dht->close_clientlist[i].assoc4.timestamp != 0); - numv6 += (dht->close_clientlist[i].assoc6.timestamp != 0); + numv4 += dht->close_clientlist[i].assoc4.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) { const DHT_Friend *const fr = &dht->friends_list[i]; for (uint32_t j = 0; j < MAX_FRIEND_CLIENTS; ++j) { - numv4 += (fr->client_list[j].assoc4.timestamp != 0); - numv6 += (fr->client_list[j].assoc6.timestamp != 0); + numv4 += fr->client_list[j].assoc4.timestamp != 0; + numv6 += fr->client_list[j].assoc6.timestamp != 0; } } diff --git a/toxcore/group.c b/toxcore/group.c index 2352b8ca..e6a0d715 100644 --- a/toxcore/group.c +++ b/toxcore/group.c @@ -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].peer_number = peer_number; 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; 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; // 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) { diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 4ce87015..1009aca6 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c @@ -2809,7 +2809,7 @@ static void send_crypto_packets(Net_Crypto *c) } 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) { c->current_sleep_time = sleep_time + 1; diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index 35d5f7b9..f72978a5 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c @@ -1630,7 +1630,7 @@ static void do_friend(Onion_Client *onion_c, uint16_t friendnum) uint16_t n = num_nodes; 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)) {