Skip to content

Commit

Permalink
cleanup: Enable tokstyle's -Wlarge-struct-params.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Feb 18, 2022
1 parent 87c38ec commit 84a03bc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions auto_tests/onion_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static void test_basic(void)
uint64_t s;
memcpy(&s, sb_data, sizeof(uint64_t));
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_secret_key(onion1->dht),
zeroes,
Expand All @@ -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);
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);
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_secret_key(onion1->dht),
test_3_ping_id,
Expand Down
2 changes: 1 addition & 1 deletion other/bootstrap_daemon/docker/tox-bootstrapd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
06d4c48fbc0727ccfb6a48ff6784558f8e9c377f9d29786fbf206810e9b76788 /usr/local/bin/tox-bootstrapd
8dd3eb3834a2c60c834b073296189b8c91df36969388e23d58c0429402eb36f5 /usr/local/bin/tox-bootstrapd
1 change: 0 additions & 1 deletion testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ sh_test(
args = ["$(locations %s)" % f for f in CIMPLE_FILES] + [
"-Wno-callback-names",
"-Wno-enum-names",
"-Wno-large-struct-params",
"-Wno-memcpy-structs",
"+RTS",
"-N3",
Expand Down
8 changes: 4 additions & 4 deletions toxcore/onion_announce.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,21 @@ int create_data_request(uint8_t *packet, uint16_t max_packet_length, const uint8
* return -1 on failure.
* 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 *ping_id, const uint8_t *client_id,
const uint8_t *data_public_key, uint64_t sendback_data)
{
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,
data_public_key, sendback_data);
int len = create_announce_request(request, sizeof(request), dest->public_key, public_key, secret_key, ping_id,
client_id, data_public_key, sendback_data);

if (len != sizeof(request)) {
return -1;
}

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) {
return -1;
Expand Down
2 changes: 1 addition & 1 deletion toxcore/onion_announce.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ int create_data_request(uint8_t *packet, uint16_t max_packet_length, const uint8
* return 0 on success.
*/
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 *ping_id, const uint8_t *client_id,
const uint8_t *data_public_key, uint64_t sendback_data);
Expand Down

0 comments on commit 84a03bc

Please sign in to comment.