Commit Graph

12 Commits

Author SHA1 Message Date
iphydf 6f735b51be chore: Happy new year 2026! 2026-01-27 22:35:47 +00:00
iphydf 8e8b352abc refactor: Add nullable annotations to struct members.
Also add a bunch of casts where needed. I've tried to model everything
in such a way that it minimises casts. The casts *should* be safe, but
it's not always obvious. In the obvious cases, we should have a linter
that validates it. In the non-obvious cases, that linter should warn and
require that we add a null check. I've added some null checks in some
cases but not all.

Also, refactored some of the constructor functions to never assign a
maybe-null value to a non-null struct member, instead using a temporary
local variable to check if construction/allocation succeeded.
2026-01-04 23:38:38 +00:00
iphydf 40b3f0b463 refactor: Use clang's nullability qualifiers instead of attributes. 2025-07-13 00:26:24 +00:00
iphydf f81e30679b refactor: Use per-parameter nullability annotations.
This is less error-prone.
2025-07-12 09:20:18 +00:00
iphydf bc43cec062 chore: Happy new year! 2025-01-05 23:24:52 +00:00
iphydf 4e2dba4d9f chore: Reformat sources with astyle.
Restyled astyle is fixed now.
2024-02-02 01:31:32 +00:00
iphydf 511bfe39c8 cleanup: Use Bazel modules to enforce proper #include hygiene. 2024-01-30 23:51:43 +00:00
iphydf 0426624dcb refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
iphydf fad6e4e173 cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
iphydf 028b017d79 perf: Slightly reduce bandwidth usage when there are few nodes.
This mainly saves spam in test logs, but may save some packets here and
there, if nodes are randomly selected twice for GET_NODES and onion
routing packets.
2023-12-18 16:23:45 +00:00
iphydf a549807df7 refactor: Add mem module to allow tests to override allocators.
This will allow us to do more interesting things with memory allocation
within toxcore, and allow fuzzers to explore various allocation failure
paths.
2023-08-30 22:55:05 +00:00
sudden6 8c7d30475f refactor: re-implement shared key cache in separate file
The exisiting implementation is not clearly documented and used by
multiple modules.
2022-11-22 23:43:05 +01:00