Age | Commit message (Collapse) | Author |
|
We put some tokstyle exemptions into the source files themselves,
instead. This way we can check some of the code in those files, and more
in the future when tokstyle supports more constructs (like apidsl).
Also: hacked ping_array.api.h to not emit `_array` as parameter names.
We'll need to fix apidsl to do this better. This works for now.
|
|
|
|
|
|
See https://github.com/TokTok/hs-tokstyle/pull/49 for the corresponding
tokstyle analysis.
|
|
|
|
|
|
We're actually still using it, but we got a private pointer now,
preparing us for having a private mono_time in toxav.
|
|
|
|
We want functions declared as `static` to also be defined as `static`.
|
|
https://github.com/TokTok/hs-tokstyle/pull/43 implements a validation for
this. We should avoid locally declaring functions from another
translation unit, and instead use header files to export/import them.
|
|
* make static functions return bool rather than int to indicate success
* add peer_in_list() to factor out uniformity over peer and frozen lists
* reduce repetition in send_lossy_all_close
* rename 'close' to 'connections'
* use uint32_t for peernumber (in accord with tox.c)
* explain persistence in tox_conference_get_chatlist documentation
* clarify "connectedness" in group API documentation
* clarify that tox_conference_peer_count counts only online peers
* refactor variously
|
|
In windows network code, we implement inet_pton and inet_ntop, which take
void pointers. We can do slightly better because we already know the type
when we call these functions, so we can avoid casting between void
pointer and the addr struct types.
|
|
Most of our enums already have one. Some didn't. Tokstyle is going to
require commas at the end of enumerator lists in enum definitions.
|
|
Tokstyle (check-cimple) will start enforcing comment formats at some
point. It will not support arbitrary stuff in comments, and will parse
them. The result can then be semantically analysed.
|
|
|
|
|
|
The current code violates the C standard and causes crashes on strict
alignment architectures.
|
|
|
|
Removed av_test, because it depends on an ancient opencv that starts to
really not exist on modern systems anymore.
|
|
ToxAV is not thread-safe at the moment, remove that claim from the
header file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A group loaded from a savefile starts with AV disabled.
|
|
|
|
- unistd.h doesn't exist on MSVC.
- `vpx_codec_iface_t` is already `const`, so adding `const` qualifiers is
redundant and causes warnings on MSVC.
|
|
This reverts commit f87f8719d02a9adbc9413256fe22958267cfefee.
|
|
This CI can run Bazel tests, because it supports IPv6. This is nice,
because now we can run IPv6 tests on every PR.
|
|
|
|
|
|
|
|
Using the full path including the repo name.
|
|
|
|
|
|
This uses a trick to get read-write access to `this` from a `const`
member function, similar to C++ `mutable`, but uglier.
|
|
|
|
* Assignments can't be used as expressions, therefore `while` loops
should not be used as a `for-each` construct. Use `for`, instead.
|
|
|
|
|
|
|
|
Limited to 4GiB. That ought to be enough for any save file.
|
|
* Use Camel_Snake_Case for type names.
* Use at least 4 characters for constant names. I.e. `END` is a type
name, but `RETURN` is a constant name. This is because `DHT` is a type
name (yay consistency).
* Using `min_*` functions instead of MIN, we can avoid a cast.
* Use `for`-loops for for-each-frame semantics instead of `while`.
* Don't use assignments as expressions.
* `++i` instead of `i++`.
* Function pointers are dereferenced automatically, so no need to
manually do so.
* Avoid void pointers that lie about not being spaghetti code. Toxcore
and toxav are both spaghetti and shouldn't pretend anything else.
* Don't use empty statements (e.g. no `;;` anywhere in the code).
|
|
* Fix `toxav_get_tox` to return tox, not messenger.
* Fix the casts from Tox* to Messenger* in toxav_old.c.
* Pass Tox instead of Messenger to public group AV callbacks.
|
|
* Constant-style macros can't be function call expressions. These must be
function calls themselves.
* Assignments can't be used as expressions.
* Therefore: `while` loops should not be used as a `for-each`
construct. Use `for`, instead.
|
|
This probably doesn't happen, but it can in theory, so we avoid it.
|
|
* No anonymous structs.
* No assignment expressions.
* Only one declarator per struct member declaration.
* Named callback types only, no inline types.
* No `;` empty statements.
* `++i` instead of `i++`.
Avoiding a cast in toxav_old.c avoids some potential (and real) bugs.
|
|
* Named callback types only.
* No anonymous enums or structs.
* `++i` instead of `i++`.
* Don't use enums to specify integer constants. Enums should be
enumerations. All values of an enum type should be listed[1].
[1] I don't know what to do about bit masks yet, but given that enums by
C standard can only go up to 32767 portably and 2^31 in reality, they are
probably not useful for 64 bit bit masks.
|