Squashed 'external/toxcore/c-toxcore/' changes from e29e185c03..f1df709b87

f1df709b87 feat: add ngc events
1b6c907235 refactor: Make event dispatch ordered by receive time.
b7f9367f6f test: Upgrade cppcheck, fix some warnings.
766e62bc89 chore: Use `pkg_search_module` directly in cmake.
00ff078f91 cleanup: Use target_link_libraries directly in cmake.
c58928cc89 chore: Add `IMPORTED_TARGET` to pkg-config packages.
895a6af122 cleanup: Remove NaCl support.
41dfb1c1c0 fix: unpack enum function names in event impl generator
447666d1a1 chore: Disable targets for cross-compilation.
572924e924 chore: Build a docker image with coverage info in it.
415cb78f5e cleanup: Some portability/warning fixes for Windows builds.
425216d9ec fix: Correct a use-after-free and fix some memory leaks.
4b1cfa3e08 refactor: Change all enum-like `#define` sequences into enums.
d3c2704fa9 chore: Fix make_single_file to support core-only.
0ce46b644e refactor: Change the `TCP_PACKET_*` defines into an enum.
22cd38ad50 adopt event impl generation tool to #2392
f31ea1088a add the event impl generation tool
4e603bb613 refactor: Use `enum-from-int` rule from tokstyle.
19d8f180d6 chore: Update github actions `uses`.
6a895be0c7 test: Make esp32 build actually try to instantiate tox.
65d09c9bfb cleanup: Remove test net support.
REVERT: e29e185c03 feat: add ngc events

git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: f1df709b8792da4c0e946d826b11df77d565064d
This commit is contained in:
2023-12-27 12:37:22 +01:00
parent 83e200df43
commit b2ae9530a4
173 changed files with 9191 additions and 5633 deletions

View File

@ -407,7 +407,7 @@ int get_random_tcp_onion_conn_number(const TCP_Connections *tcp_c)
* return -1 on failure.
*/
non_null()
static int get_conn_number_by_ip_port(TCP_Connections *tcp_c, const IP_Port *ip_port)
static int get_conn_number_by_ip_port(const TCP_Connections *tcp_c, const IP_Port *ip_port)
{
for (uint32_t i = 0; i < tcp_c->tcp_connections_length; ++i) {
const IP_Port conn_ip_port = tcp_con_ip_port(tcp_c->tcp_connections[i].connection);
@ -1059,7 +1059,7 @@ static int send_tcp_relay_routing_request(const TCP_Connections *tcp_c, int tcp_
non_null()
static int tcp_response_callback(void *object, uint8_t connection_id, const uint8_t *public_key)
{
TCP_Client_Connection *tcp_client_con = (TCP_Client_Connection *)object;
const TCP_Client_Connection *tcp_client_con = (const TCP_Client_Connection *)object;
const TCP_Connections *tcp_c = (const TCP_Connections *)tcp_con_custom_object(tcp_client_con);
const unsigned int tcp_connections_number = tcp_con_custom_uint(tcp_client_con);
@ -1256,7 +1256,7 @@ static int tcp_relay_on_online(TCP_Connections *tcp_c, int tcp_connections_numbe
bool sent_any = false;
for (uint32_t i = 0; i < tcp_c->connections_length; ++i) {
TCP_Connection_to *con_to = get_connection(tcp_c, i);
const TCP_Connection_to *con_to = get_connection(tcp_c, i);
if (con_to != nullptr) {
if (tcp_connection_in_conn(con_to, tcp_connections_number)) {