Age | Commit message (Collapse) | Author |
|
Also:
* compound statements (blocks, e.g. in if/else) must be non-empty.
Comments don't count.
* `=` is not allowed in subexpressions. We treat it as statement-only.
* `++i` is preferred over `i++` in statements.
* `Type_Names` are camelsnake-case.
|
|
Also:
* `#define` must be scoped. If it's used outside a scope, it must be
defined outside that scope (global `#define` does not need a matching
`#undef`).
|
|
|
|
`BS_LIST` would be a constant. `BS_List` is a type name.
|
|
This is now a style rule: you can only use typedef'd function types.
Previous rules now applied in `onion_*.c`:
* `struct`s must have a name (typedef of unnamed struct is not allowed).
* `++i` for increment-stmt, not `i++`, e.g. in loops.
* Only a single declarator per struct member declaration.
* Type_Names vs. variable_names.
|
|
Also:
* No inner structs.
* One declarator per member declaration.
* Function names are snake_case.
* Names ending in `_cb` are function types.
* `++i` is preferred over `i++`.
|
|
We used to pass the actual peer numbers of peers leaving, but we no
longer know these in the PGC world, so we don't pass them anymore.
|
|
Rules:
1. Constants are uppercase names: THE_CONSTANT.
2. SUE[1] types start with an uppercase letter and have at least one
lowercase letter in it: The_Type, THE_Type.
3. Function types end in "_cb": tox_friend_connection_cb.
4. Variable and function names are all lowercase: the_function.
This makes it easier for humans reading the code to determine what an
identifier means. I'm not convinced by the enum type name change, but I
don't know a better rule. Currently, a lot of enum types are spelled like
constants, which is confusing.
[1] struct/union/enum
|
|
Have one script per build. This means more duplication between the
scripts, but it's much easier to understand and to run locally.
|
|
|
|
|
|
* Consistently use `num_packets_array` to get the packet count in the
packet buffer.
* Use `const` in more places.
* Typo fix: begginning.
* Rewrite `length < 1` for unsigned int to `length == 0`.
* Limit scope of some loop variables by using for-init-decl.
* Use early return in error paths to reduce indentation and for clarity.
* Use `net_unpack_*` instead of manual `ntohs`.
* Fix an uninitialised stack variable copy.
* Fix a potential null pointer dereference.
* Consistently use `get_crypto_connection`. It was inlined in some
places. I de-inlined it now.
* Add Loggers to some functions in preparation for adding log statements.
|
|
|
|
Rename args `host:port` from `address:port`.
The *address* is well known as *Tox Address* in this project. Then we
should reserve *addres* to it, and use *host* to express the hostname or
IP address in TCP domain.
|
|
|
|
Fixes #946.
|
|
`clang-format -style='{BasedOnStyle: Google, ColumnLimit: 100}'`
|
|
This one has ASAN enabled, unlike Travis.
|
|
In preparation for adding log statements.
Also, fix an uninitialised variable warning in cppcheck.
|
|
Currently, toxcore does not support UDP over proxies. In the future, we
can relax this by disabling UDP only if the proxy doesn't support it.
|
|
I.e. make tox_new(0, 0) behave the same as tox_new(tox_options_new(0), 0).
Changing defaults in the options does not currently affect NULL options.
|
|
It was a list of #defines, but clearly this is a discrete and limited set
of named values, so an enum is more appropriate.
|
|
|
|
|
|
Fixes #900.
|
|
|
|
|
|
|
|
Fixes #868
Is made by:
1. Fix enumeration mechanism of Crypto_Connection instances in function send_crypto_packets()
(this item solves the main problem);
2. Disruption of correlation between parameters of different dimensions
(the parameters MAX_NUM_SENDPACKET_TRIES and UDP_DIRECT_TIMEOUT have different dimensions).
|
|
The Family stuff in toxcore is a big mess. I'm sure I saw a bunch of bugs
on the way, but I'm not verifying that code now, so the bugs stay.
|
|
|
|
|
|
Windows doesn't report network errors though errno, it has its own facilities.
|
|
|
|
|
|
We control the random functions in crypto_core, so we can make them
deterministic more easily. This will help test reproducibility in the
future.
|
|
|
|
|
|
This is useful for debugging a function that doesn't have a logger
available. It should not be used in production code, since it outputs to
stderr.
|
|
|
|
It's not supported in mingw.
See https://github.com/TokTok/c-toxcore/issues/786.
|
|
|
|
|
|
|
|
By increasing a magic number.. Also, added more verbose logging to the
file transfer test.
|
|
|
|
Fixes #768
|
|
This currently fails the nightly build.
|
|
|
|
DETECTED=cppcheck
|