mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed possible compiling problems on some compilers.
This commit is contained in:
parent
f124cfaf46
commit
41d4e02ca4
|
@ -675,7 +675,7 @@ IP_Port DHT_getfriendip(DHT *dht, uint8_t *client_id)
|
|||
{
|
||||
uint32_t i, j;
|
||||
uint64_t temp_time = unix_time();
|
||||
IP_Port empty = { .ip = {{0}}, .port = 0, .padding = 0 };
|
||||
IP_Port empty = {{{{0}}, 0, 0}};
|
||||
|
||||
for (i = 0; i < dht->num_friends; ++i) {
|
||||
/* Equal */
|
||||
|
@ -1040,7 +1040,7 @@ static void punch_holes(DHT *dht, IP ip, uint16_t *port_list, uint16_t numports,
|
|||
for (i = dht->friends_list[friend_num].punching_index; i != top; i++) {
|
||||
/* TODO: improve port guessing algorithm */
|
||||
uint16_t port = port_list[(i / 2) % numports] + (i / (2 * numports)) * ((i % 2) ? -1 : 1);
|
||||
IP_Port pinging = {.ip = ip, .port = htons(port)};
|
||||
IP_Port pinging = {{ip, htons(port)}};
|
||||
send_ping_request(dht->ping, dht->c, pinging, dht->friends_list[friend_num].client_id);
|
||||
}
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ IP_Port connection_ip(Lossless_UDP *ludp, int connection_id)
|
|||
if (connection_id >= 0 && connection_id < ludp->connections.len)
|
||||
return tox_array_get(&ludp->connections, connection_id, Connection).ip_port;
|
||||
|
||||
IP_Port zero = { .ip = {{0}}, .port = 0, .padding = 0 };
|
||||
IP_Port zero = {{{{0}}, 0, 0}};
|
||||
return zero;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user