From 84a03bc2edc25d264995a327b428309dff8b3ae3 Mon Sep 17 00:00:00 2001 From: iphydf Date: Fri, 18 Feb 2022 01:41:17 +0000 Subject: [PATCH] cleanup: Enable tokstyle's `-Wlarge-struct-params`. --- auto_tests/onion_test.c | 4 ++-- other/bootstrap_daemon/docker/tox-bootstrapd.sha256 | 2 +- testing/BUILD.bazel | 1 - toxcore/onion_announce.c | 8 ++++---- toxcore/onion_announce.h | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/auto_tests/onion_test.c b/auto_tests/onion_test.c index 22d87ddc..c245f756 100644 --- a/auto_tests/onion_test.c +++ b/auto_tests/onion_test.c @@ -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, @@ -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, diff --git a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 index 013609f7..83006619 100644 --- a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 +++ b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 @@ -1 +1 @@ -06d4c48fbc0727ccfb6a48ff6784558f8e9c377f9d29786fbf206810e9b76788 /usr/local/bin/tox-bootstrapd +8dd3eb3834a2c60c834b073296189b8c91df36969388e23d58c0429402eb36f5 /usr/local/bin/tox-bootstrapd diff --git a/testing/BUILD.bazel b/testing/BUILD.bazel index 69c61665..5d4c4ed0 100644 --- a/testing/BUILD.bazel +++ b/testing/BUILD.bazel @@ -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", diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c index c663a638..26e76cf5 100644 --- a/toxcore/onion_announce.c +++ b/toxcore/onion_announce.c @@ -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; diff --git a/toxcore/onion_announce.h b/toxcore/onion_announce.h index 1ffd6852..9b9bf238 100644 --- a/toxcore/onion_announce.h +++ b/toxcore/onion_announce.h @@ -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);