iphydf
9592d590cf
refactor(test): Slightly nicer C++ interface to tox Random.
2024-01-10 21:56:34 +00:00
iphydf
c66e10fb7a
refactor: Minor refactoring of get_close_nodes functions.
...
Avoiding passing down the entire DHT struct pointer to the inner
functions makes it possible in the future to write unit tests without
having to construct a full DHT object.
2024-01-10 20:12:04 +00:00
jfreegman
ebc9643862
fix: don't pass garbage data buffer to packet send functions
...
This garbage data was never looked at due to passing
a zero length along with it, but it's still undesirable.
2024-01-10 12:37:21 -05:00
iphydf
32b68cffca
cleanup: Some more test cleanups, removing overly smart code.
2024-01-10 12:42:37 +00:00
iphydf
0426624dcb
refactor: Assign malloc return to a local variable first.
2024-01-10 11:46:41 +00:00
iphydf
afc38f2458
test: Add more unit tests for add_to_list
.
2024-01-10 02:58:13 +00:00
iphydf
05ce5c1ab9
test: Add "infer" CI check to github, remove from circle.
...
This now uses our own built image with the current master of infer.
2024-01-09 10:59:53 +00:00
iphydf
814c12a6f4
cleanup: Add dynamically derived array sizes to the API.
2024-01-07 14:43:57 +00:00
iphydf
226b23be12
cleanup: Add explicit array sizes to toxencryptsave.
...
Also mark arrays as `[]` instead of `*`.
2024-01-07 13:27:38 +00:00
iphydf
ef33cb4de0
cleanup: Add Toxav alias for ToxAV.
...
ToxAV does not comply with naming standards.
2024-01-07 00:27:39 +00:00
iphydf
1da723b34d
cleanup: Make Tox_Options a typedef.
...
In preparation for it becoming private in 0.3.0.
2024-01-06 20:52:18 +00:00
iphydf
b148a2afff
chore: Simplify msvc build using vcpkg.
2024-01-06 12:27:31 +00:00
iphydf
5cac6d7eb1
cleanup: Move tox_get_system
out of the public API.
...
It's not released, yet, and this function is a pain. We don't want it
going forward.
2024-01-05 19:29:59 +00:00
iphydf
c9ca4007e3
refactor: Align group message sending with other send functions.
...
None of the others use out parameters. Also no toxcore function uses out
parameters for anything other than arrays and errors. This would be a
first, for no good reason.
2024-01-05 19:20:01 +00:00
iphydf
6c6c0b1b1b
cleanup: Make setters take non-const Tox *
.
...
Also renamed the setter parameters to match the property being set..
2024-01-05 17:21:35 +00:00
iphydf
a76f758d70
cleanup: Mark arrays in the tox API as []
instead of *
.
...
This makes it clearer what is actually a pointer (i.e. the `this` pointer
or the `error` pointer) vs. what is an array.
2024-01-05 17:08:40 +00:00
iphydf
baf6d1f6cf
cleanup: Make array params in toxav []
instead of *
.
...
Similar to the toxcore PR. It's clearer and helps apigen understand what
the API means.
2024-01-05 16:39:03 +00:00
iphydf
79f55bd06a
cleanup: Put the size of fixed arrays into the API types.
...
These are ignored by C compilers, but can be used as documentation and
by bindings generators.
2024-01-05 07:44:35 +00:00
iphydf
1e73698db2
cleanup: Add typedefs for public API int identifiers.
...
These make it clearer which kinds of `uint32_t` can fit in which
functions. It also makes it easier to generate higher level bindings
without doing a lot of inference/heuristics.
2024-01-04 13:29:43 +00:00
iphydf
cac074c57f
chore: Add fetch-sha256 script to update bootstrap node hash.
...
This fetches it from github, so we don't need to build it locally.
Not super ideal, because devs are supposed to build it locally to prove
reproducibility, but we can keep that diligence on the dev to do once
when actually merging the PR.
2024-01-03 23:01:55 +00:00
Maxim Biro
32576656bb
Make the comment capitalization uniform
2024-01-02 19:07:39 -05:00
Maxim Biro
aff4dda17c
Spellcheck tox-bootstrapd
2024-01-02 19:07:37 -05:00
iphydf
40b5fbbe9d
chore: Remove settings.yml in favour of hs-github-tools.
...
Centralised settings means we can update them without having to pass all
the CI checks of each repo.
2024-01-02 21:38:33 +00:00
iphydf
ebafd51be7
chore: Use GPL license with https.
...
This aligns with the new zig-toxcore-c repo. It is a chore, but better
than changing the zig-toxcore-c license to not use https.
2024-01-01 11:43:27 +00:00
iphydf
0e42752f0f
cleanup: Move all vptr-to-ptr casts to the beginning of a function.
...
These casts are effectively part of the function type, so it makes sense
to have them at the beginning.
2023-12-30 01:45:23 +00:00
iphydf
5407384211
cleanup: Use github actions matrix to simplify CI.
2023-12-27 14:39:17 +00:00
iphydf
82d8265688
fix: Use QueryPerformanceCounter on windows for monotonic time.
...
This fixes time resolution issues and simplifies the code a bit. QPC can
in theory jump forward in time, but in practice not by enough to matter
in our use case.
2023-12-27 12:21:33 +00:00
iphydf
1224e656e3
chore: Add net_(new|kill)_strerror
to cppcheck's allocators.
...
This helps ensure strerrors are cleaned up everywhere.
2023-12-27 04:24:32 +00:00
iphydf
6a90ddfe4e
cleanup: Run clang-tidy on headers, as well.
2023-12-27 02:37:39 +00:00
iphydf
bd930cc80a
cleanup: Make TCP connection failures a warning instead of error.
...
It's not really bad, unless all connections fail. This is currently
erroring on FreeBSD tests, making them fail needlessly.
2023-12-27 02:08:09 +00:00
iphydf
fad6e4e173
cleanup: Make all .c files include the headers they need.
2023-12-27 01:21:47 +00:00
iphydf
ef4897a898
cleanup: Upgrade to clang-tidy-17 and fix some warnings.
2023-12-27 01:05:47 +00:00
iphydf
b7f9367f6f
test: Upgrade cppcheck, fix some warnings.
...
Also started teaching it about toxcore's alloc/dealloc functions in
hopes of it catching some errors (it doesn't seem to be very good at
this, but maybe better than nothing?).
2023-12-27 00:00:10 +00:00
iphydf
766e62bc89
chore: Use pkg_search_module
directly in cmake.
...
The `pkg_use_module` was doing magic we used to use, but no longer need.
2023-12-26 01:14:50 +00:00
iphydf
00ff078f91
cleanup: Use target_link_libraries directly in cmake.
...
Instead of using `target_link_modules`, which does magic that we no
longer need, because we only have 1 library we install, and all binaries
we build link statically because they need access to internal symbols.
2023-12-26 00:24:08 +00:00
iphydf
c58928cc89
chore: Add IMPORTED_TARGET
to pkg-config packages.
...
Also use `PRIVATE` for `target_link_libraries`. This helps avoid
implicit transitive dependencies.
2023-12-26 00:04:07 +00:00
iphydf
895a6af122
cleanup: Remove NaCl support.
...
We now depend on libsodium unconditionally. Future work will require
functions from libsodium, and nobody we're aware of uses the nacl build
for anything other than making sure it still works on CI.
2023-12-25 00:36:38 +00:00
Green Sky
41dfb1c1c0
fix: unpack enum function names in event impl generator
2023-12-24 14:34:34 +01:00
iphydf
447666d1a1
chore: Disable targets for cross-compilation.
...
This way we can do bazel build //... when cross-compiling.
2023-12-24 00:20:13 +00:00
iphydf
572924e924
chore: Build a docker image with coverage info in it.
...
We can then use that to build a coverage web UI on render.com using the
Dockerfile.nginx build.
2023-12-22 00:25:37 +00:00
iphydf
415cb78f5e
cleanup: Some portability/warning fixes for Windows builds.
2023-12-21 19:02:20 +00:00
iphydf
425216d9ec
fix: Correct a use-after-free and fix some memory leaks.
...
Also: use `find_package` to find gtest. This fixes the coverage build to
include unit tests.
2023-12-21 17:17:51 +00:00
iphydf
4b1cfa3e08
refactor: Change all enum-like #define
sequences into enums.
...
The only one I'm not so sure about is `Tcp_Socks5_Proxy_Hs`, which has
repeats. Should we ignore repeats?
2023-12-21 08:55:51 +00:00
iphydf
d3c2704fa9
chore: Fix make_single_file to support core-only.
2023-12-20 23:12:06 +00:00
iphydf
0ce46b644e
refactor: Change the TCP_PACKET_*
defines into an enum.
2023-12-20 15:11:23 +00:00
Green Sky
22cd38ad50
adopt event impl generation tool to #2392
2023-12-20 12:13:45 +01:00
Green Sky
f31ea1088a
add the event impl generation tool
2023-12-20 10:46:59 +01:00
iphydf
4e603bb613
refactor: Use enum-from-int
rule from tokstyle.
...
These functions are a bit clearer and don't need to change if enum
values change.
See https://github.com/TokTok/hs-tokstyle/pull/212 for the relevant
linter implementation.
2023-12-19 20:53:15 +00:00
iphydf
19d8f180d6
chore: Update github actions uses
.
...
The old ones are going to stop working soon.
2023-12-19 20:06:15 +00:00
iphydf
6a895be0c7
test: Make esp32 build actually try to instantiate tox.
...
It doesn't work, because esp32 has too little RAM (320KB). DHT is a
240KB struct, so even just allocating that immediately fails. We'll need
to think carefully about trimming that if we ever want this to work on
embedded devices.
2023-12-19 19:41:45 +00:00