diff options
-rw-r--r-- | toxcore/DHT.c | 2 | ||||
-rw-r--r-- | toxcore/Lossless_UDP.c | 2 | ||||
-rw-r--r-- | toxcore/network.h | 13 |
3 files changed, 10 insertions, 7 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 937e6196..78ea5b8c 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -675,7 +675,7 @@ IP_Port DHT_getfriendip(DHT *dht, uint8_t *client_id) | |||
675 | { | 675 | { |
676 | uint32_t i, j; | 676 | uint32_t i, j; |
677 | uint64_t temp_time = unix_time(); | 677 | uint64_t temp_time = unix_time(); |
678 | IP_Port empty = {{{0}}, 0}; | 678 | IP_Port empty = { .ip = {0}, .port = 0, .padding = 0 }; |
679 | 679 | ||
680 | for (i = 0; i < dht->num_friends; ++i) { | 680 | for (i = 0; i < dht->num_friends; ++i) { |
681 | /* Equal */ | 681 | /* Equal */ |
diff --git a/toxcore/Lossless_UDP.c b/toxcore/Lossless_UDP.c index 6046c09b..b8279604 100644 --- a/toxcore/Lossless_UDP.c +++ b/toxcore/Lossless_UDP.c | |||
@@ -302,7 +302,7 @@ IP_Port connection_ip(Lossless_UDP *ludp, int connection_id) | |||
302 | if (connection_id >= 0 && connection_id < ludp->connections_length) | 302 | if (connection_id >= 0 && connection_id < ludp->connections_length) |
303 | return ludp->connections[connection_id].ip_port; | 303 | return ludp->connections[connection_id].ip_port; |
304 | 304 | ||
305 | IP_Port zero = {{{0}}, 0}; | 305 | IP_Port zero = { .ip = {0}, .port = 0, .padding = 0 }; |
306 | return zero; | 306 | return zero; |
307 | } | 307 | } |
308 | 308 | ||
diff --git a/toxcore/network.h b/toxcore/network.h index 0a0122be..685341ad 100644 --- a/toxcore/network.h +++ b/toxcore/network.h | |||
@@ -86,11 +86,14 @@ typedef union { | |||
86 | uint32_t i; | 86 | uint32_t i; |
87 | } IP; | 87 | } IP; |
88 | 88 | ||
89 | typedef struct { | 89 | typedef union { |
90 | IP ip; | 90 | struct { |
91 | uint16_t port; | 91 | IP ip; |
92 | /* Not used for anything right now. */ | 92 | uint16_t port; |
93 | uint16_t padding; | 93 | /* Not used for anything right now. */ |
94 | uint16_t padding; | ||
95 | }; | ||
96 | uint8_t uint8[8]; | ||
94 | } IP_Port; | 97 | } IP_Port; |
95 | 98 | ||
96 | typedef struct { | 99 | typedef struct { |