diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-01-10 13:39:07 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-01-10 18:57:37 +0000 |
commit | 54ec162558f203242639b382eea6e0085300249c (patch) | |
tree | 5321d67bbc143ea3caa4e9e9048ffc71e40b0c14 /toxcore/net_crypto.c | |
parent | a3079e82ddda90055d7247f000a8e9afa7f8a5c5 (diff) |
Fix formatting in some C files.
Also replace &(x) with &x for consistency.
Diffstat (limited to 'toxcore/net_crypto.c')
-rw-r--r-- | toxcore/net_crypto.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 440db94a..99e6701b 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -1608,7 +1608,7 @@ static int create_crypto_connection(Net_Crypto *c) | |||
1608 | if (realloc_cryptoconnection(c, c->crypto_connections_length + 1) == 0) { | 1608 | if (realloc_cryptoconnection(c, c->crypto_connections_length + 1) == 0) { |
1609 | id = c->crypto_connections_length; | 1609 | id = c->crypto_connections_length; |
1610 | ++c->crypto_connections_length; | 1610 | ++c->crypto_connections_length; |
1611 | memset(&(c->crypto_connections[id]), 0, sizeof(Crypto_Connection)); | 1611 | memset(&c->crypto_connections[id], 0, sizeof(Crypto_Connection)); |
1612 | // Memsetting float/double to 0 is non-portable, so we explicitly set them to 0 | 1612 | // Memsetting float/double to 0 is non-portable, so we explicitly set them to 0 |
1613 | c->crypto_connections[id].packet_recv_rate = 0; | 1613 | c->crypto_connections[id].packet_recv_rate = 0; |
1614 | c->crypto_connections[id].packet_send_rate = 0; | 1614 | c->crypto_connections[id].packet_send_rate = 0; |
@@ -1641,7 +1641,7 @@ static int wipe_crypto_connection(Net_Crypto *c, int crypt_connection_id) | |||
1641 | 1641 | ||
1642 | /* Keep mutex, only destroy it when connection is realloced out. */ | 1642 | /* Keep mutex, only destroy it when connection is realloced out. */ |
1643 | pthread_mutex_t mutex = c->crypto_connections[crypt_connection_id].mutex; | 1643 | pthread_mutex_t mutex = c->crypto_connections[crypt_connection_id].mutex; |
1644 | crypto_memzero(&(c->crypto_connections[crypt_connection_id]), sizeof(Crypto_Connection)); | 1644 | crypto_memzero(&c->crypto_connections[crypt_connection_id], sizeof(Crypto_Connection)); |
1645 | c->crypto_connections[crypt_connection_id].mutex = mutex; | 1645 | c->crypto_connections[crypt_connection_id].mutex = mutex; |
1646 | 1646 | ||
1647 | for (i = c->crypto_connections_length; i != 0; --i) { | 1647 | for (i = c->crypto_connections_length; i != 0; --i) { |