mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge pull request #554 from nurupo/master
Fixed missing field initializer warnings
This commit is contained in:
commit
25480852ac
|
@ -1070,7 +1070,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, htons(port)}};
|
||||
IP_Port pinging = {{ip, htons(port), 0}};
|
||||
send_ping_request(dht->ping, dht->c, pinging, dht->friends_list[friend_num].client_id);
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ int send_LANdiscovery(uint16_t port, Net_Crypto *c)
|
|||
uint8_t data[crypto_box_PUBLICKEYBYTES + 1];
|
||||
data[0] = NET_PACKET_LAN_DISCOVERY;
|
||||
memcpy(data + 1, c->self_public_key, crypto_box_PUBLICKEYBYTES);
|
||||
IP_Port ip_port = {{broadcast_ip(), port}};
|
||||
IP_Port ip_port = {{broadcast_ip(), port, 0}};
|
||||
return sendpacket(c->lossless_udp->net->sock, ip_port, data, 1 + crypto_box_PUBLICKEYBYTES);
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ int sendpacket(unsigned int sock, IP_Port ip_port, uint8_t *data, uint32_t lengt
|
|||
int sendpacket(int sock, IP_Port ip_port, uint8_t *data, uint32_t length)
|
||||
#endif
|
||||
{
|
||||
ADDR addr = {AF_INET, ip_port.port, ip_port.ip};
|
||||
ADDR addr = {AF_INET, ip_port.port, ip_port.ip, {0}};
|
||||
return sendto(sock, (char *) data, length, 0, (struct sockaddr *)&addr, sizeof(addr));
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ Networking_Core *new_networking(IP ip, uint16_t port)
|
|||
#endif
|
||||
|
||||
/* Bind our socket to port PORT and address 0.0.0.0 */
|
||||
ADDR addr = {AF_INET, htons(port), ip};
|
||||
ADDR addr = {AF_INET, htons(port), ip, {0}};
|
||||
bind(temp->sock, (struct sockaddr *)&addr, sizeof(addr));
|
||||
return temp;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user