summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-08-30 12:34:57 -0400
committerirungentoo <irungentoo@gmail.com>2013-08-30 12:34:57 -0400
commit41d4e02ca45008ad8b4e4a7a51a9c89b48c32e0a (patch)
tree7cafce68f7effb6bc2d451736abf64f9dec03c69
parentf124cfaf46dbe45547a850319c5c749ea1778e0e (diff)
Fixed possible compiling problems on some compilers.
-rw-r--r--toxcore/DHT.c4
-rw-r--r--toxcore/Lossless_UDP.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index c2a0377f..529456a2 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 = { .ip = {{0}}, .port = 0, .padding = 0 }; 678 IP_Port empty = {{{{0}}, 0, 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 */
@@ -1040,7 +1040,7 @@ static void punch_holes(DHT *dht, IP ip, uint16_t *port_list, uint16_t numports,
1040 for (i = dht->friends_list[friend_num].punching_index; i != top; i++) { 1040 for (i = dht->friends_list[friend_num].punching_index; i != top; i++) {
1041 /* TODO: improve port guessing algorithm */ 1041 /* TODO: improve port guessing algorithm */
1042 uint16_t port = port_list[(i / 2) % numports] + (i / (2 * numports)) * ((i % 2) ? -1 : 1); 1042 uint16_t port = port_list[(i / 2) % numports] + (i / (2 * numports)) * ((i % 2) ? -1 : 1);
1043 IP_Port pinging = {.ip = ip, .port = htons(port)}; 1043 IP_Port pinging = {{ip, htons(port)}};
1044 send_ping_request(dht->ping, dht->c, pinging, dht->friends_list[friend_num].client_id); 1044 send_ping_request(dht->ping, dht->c, pinging, dht->friends_list[friend_num].client_id);
1045 } 1045 }
1046 1046
diff --git a/toxcore/Lossless_UDP.c b/toxcore/Lossless_UDP.c
index b9987804..8f79990d 100644
--- a/toxcore/Lossless_UDP.c
+++ b/toxcore/Lossless_UDP.c
@@ -265,7 +265,7 @@ IP_Port connection_ip(Lossless_UDP *ludp, int connection_id)
265 if (connection_id >= 0 && connection_id < ludp->connections.len) 265 if (connection_id >= 0 && connection_id < ludp->connections.len)
266 return tox_array_get(&ludp->connections, connection_id, Connection).ip_port; 266 return tox_array_get(&ludp->connections, connection_id, Connection).ip_port;
267 267
268 IP_Port zero = { .ip = {{0}}, .port = 0, .padding = 0 }; 268 IP_Port zero = {{{{0}}, 0, 0}};
269 return zero; 269 return zero;
270} 270}
271 271