mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
cleanup: Enable tokstyle's -Wlarge-struct-params
.
This commit is contained in:
parent
87c38ece30
commit
84a03bc2ed
|
@ -229,7 +229,7 @@ static void test_basic(void)
|
||||||
uint64_t s;
|
uint64_t s;
|
||||||
memcpy(&s, sb_data, sizeof(uint64_t));
|
memcpy(&s, sb_data, sizeof(uint64_t));
|
||||||
memcpy(test_3_pub_key, nodes[3].public_key, CRYPTO_PUBLIC_KEY_SIZE);
|
memcpy(test_3_pub_key, nodes[3].public_key, CRYPTO_PUBLIC_KEY_SIZE);
|
||||||
ret = send_announce_request(onion1->net, &path, nodes[3],
|
ret = send_announce_request(onion1->net, &path, &nodes[3],
|
||||||
dht_get_self_public_key(onion1->dht),
|
dht_get_self_public_key(onion1->dht),
|
||||||
dht_get_self_secret_key(onion1->dht),
|
dht_get_self_secret_key(onion1->dht),
|
||||||
zeroes,
|
zeroes,
|
||||||
|
@ -249,7 +249,7 @@ static void test_basic(void)
|
||||||
memcpy(onion_announce_entry_public_key(onion2_a, 1), dht_get_self_public_key(onion2->dht), CRYPTO_PUBLIC_KEY_SIZE);
|
memcpy(onion_announce_entry_public_key(onion2_a, 1), dht_get_self_public_key(onion2->dht), CRYPTO_PUBLIC_KEY_SIZE);
|
||||||
onion_announce_entry_set_time(onion2_a, 1, mono_time_get(mono_time2));
|
onion_announce_entry_set_time(onion2_a, 1, mono_time_get(mono_time2));
|
||||||
networking_registerhandler(onion1->net, NET_PACKET_ONION_DATA_RESPONSE, &handle_test_4, onion1);
|
networking_registerhandler(onion1->net, NET_PACKET_ONION_DATA_RESPONSE, &handle_test_4, onion1);
|
||||||
send_announce_request(onion1->net, &path, nodes[3],
|
send_announce_request(onion1->net, &path, &nodes[3],
|
||||||
dht_get_self_public_key(onion1->dht),
|
dht_get_self_public_key(onion1->dht),
|
||||||
dht_get_self_secret_key(onion1->dht),
|
dht_get_self_secret_key(onion1->dht),
|
||||||
test_3_ping_id,
|
test_3_ping_id,
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
06d4c48fbc0727ccfb6a48ff6784558f8e9c377f9d29786fbf206810e9b76788 /usr/local/bin/tox-bootstrapd
|
8dd3eb3834a2c60c834b073296189b8c91df36969388e23d58c0429402eb36f5 /usr/local/bin/tox-bootstrapd
|
||||||
|
|
|
@ -15,7 +15,6 @@ sh_test(
|
||||||
args = ["$(locations %s)" % f for f in CIMPLE_FILES] + [
|
args = ["$(locations %s)" % f for f in CIMPLE_FILES] + [
|
||||||
"-Wno-callback-names",
|
"-Wno-callback-names",
|
||||||
"-Wno-enum-names",
|
"-Wno-enum-names",
|
||||||
"-Wno-large-struct-params",
|
|
||||||
"-Wno-memcpy-structs",
|
"-Wno-memcpy-structs",
|
||||||
"+RTS",
|
"+RTS",
|
||||||
"-N3",
|
"-N3",
|
||||||
|
|
|
@ -161,21 +161,21 @@ int create_data_request(uint8_t *packet, uint16_t max_packet_length, const uint8
|
||||||
* return -1 on failure.
|
* return -1 on failure.
|
||||||
* return 0 on success.
|
* return 0 on success.
|
||||||
*/
|
*/
|
||||||
int send_announce_request(const Networking_Core *net, const Onion_Path *path, Node_format dest,
|
int send_announce_request(const Networking_Core *net, const Onion_Path *path, const Node_format *dest,
|
||||||
const uint8_t *public_key, const uint8_t *secret_key,
|
const uint8_t *public_key, const uint8_t *secret_key,
|
||||||
const uint8_t *ping_id, const uint8_t *client_id,
|
const uint8_t *ping_id, const uint8_t *client_id,
|
||||||
const uint8_t *data_public_key, uint64_t sendback_data)
|
const uint8_t *data_public_key, uint64_t sendback_data)
|
||||||
{
|
{
|
||||||
uint8_t request[ONION_ANNOUNCE_REQUEST_SIZE];
|
uint8_t request[ONION_ANNOUNCE_REQUEST_SIZE];
|
||||||
int len = create_announce_request(request, sizeof(request), dest.public_key, public_key, secret_key, ping_id, client_id,
|
int len = create_announce_request(request, sizeof(request), dest->public_key, public_key, secret_key, ping_id,
|
||||||
data_public_key, sendback_data);
|
client_id, data_public_key, sendback_data);
|
||||||
|
|
||||||
if (len != sizeof(request)) {
|
if (len != sizeof(request)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t packet[ONION_MAX_PACKET_SIZE];
|
uint8_t packet[ONION_MAX_PACKET_SIZE];
|
||||||
len = create_onion_packet(packet, sizeof(packet), path, &dest.ip_port, request, sizeof(request));
|
len = create_onion_packet(packet, sizeof(packet), path, &dest->ip_port, request, sizeof(request));
|
||||||
|
|
||||||
if (len == -1) {
|
if (len == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -83,7 +83,7 @@ int create_data_request(uint8_t *packet, uint16_t max_packet_length, const uint8
|
||||||
* return 0 on success.
|
* return 0 on success.
|
||||||
*/
|
*/
|
||||||
non_null()
|
non_null()
|
||||||
int send_announce_request(const Networking_Core *net, const Onion_Path *path, Node_format dest,
|
int send_announce_request(const Networking_Core *net, const Onion_Path *path, const Node_format *dest,
|
||||||
const uint8_t *public_key, const uint8_t *secret_key,
|
const uint8_t *public_key, const uint8_t *secret_key,
|
||||||
const uint8_t *ping_id, const uint8_t *client_id,
|
const uint8_t *ping_id, const uint8_t *client_id,
|
||||||
const uint8_t *data_public_key, uint64_t sendback_data);
|
const uint8_t *data_public_key, uint64_t sendback_data);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user