Age | Commit message (Collapse) | Author |
|
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
We use functions for this instead.
|
|
This allows Tox to contain additional data on top of Messenger, making
Messenger not necessarily the most top-level object. E.g. groups are
built on Messenger and currently awkwardly void-pointered into it to
pretend there is no cyclic dependency.
|
|
|
|
* Moved PAIR to toxav, where it's used (but really this should die).
* Replace most MIN calls with typed `min_*` calls. Didn't replace the
ones where the desired semantics are unclear. Moved the MIN macro to
the one place where it's still used.
* Avoid assignments in `while` loops. Instead, factored out the loop body
into a separate `bool`-returning function.
* Use named types for callbacks (`_cb` types).
* Avoid assignments in `if` conditions.
* Removed `MAKE_REALLOC` and expanded its two calls. We can't have
templates in C, and this fake templating is ugly and hard to analyse
and debug (it expands on a single line).
* Moved epoll system include to the .c file, out of the .h file.
* Avoid assignments in expressions (`a = b = c;`).
* Avoid multiple declarators per struct member declaration.
* Fix naming inconsistencies.
* Replace `net_to_host` macro with function.
|
|
It turns out, `unix_time` is also monotonic, and is used as such, so I've
renamed the new functions to `mono_time_*`.
2018-07-08:
```
00:01 <@irungentoo> the idea used to be that the unix_time() function
could go backward in time but I think I might have started using it like
if it could not after I changed it so that it would never go back in time
```
|
|
|
|
This change does not include the addition of VP9. We do that in a
separate pull request.
Changes:
* fix the video bug (video frames larger than 65KBytes) by sending full
frame length in alternate header field
* improve video frame reconstruction logic with slots
* configure video encoder and decoder to be multihtreaded
* set error resilience flags on video codec
* change encoder and decoder softdeadline
|
|
This changes only code, no string literals or comments.
|
|
follow TokTok#731. This commit
completely removed all things in namespace bit_rate, and deprecated
functions are to be added back in another commit. set_xxx() is treadted
as a property of namespace audio&video, same as bit_rate change event.
toxav_basic_test is fixed, either.
|
|
Fixes #572.
As discussed in the issue, there's a risk that toxcore may not hold the
maximum bitrates libvpx supports, if toxcore insists on using integer
type. I initially proposed to have another flag in set(), so that we can
use unsigned type instead. iphydf came up with a better solution, that is
splitting the original functions, one for audio, one for video. Now, we
could safely replace int32_t with uint32_t.
Also: clean video_bit_rate_invalid()
Though this is not a part of issue #572, as it's used in the
toxav_bit_rate_set(), i cleaned the code. As mannol said, there should be
a check. Uint32_t is large enough to hold the maximum bitrates libvpx
supports, but user may pass a value larger than uint while smaller than
uint32_t. Thanks to the reminding from nurupo, it's no longer a stub
function.
Bitrate error enums are shared for both audio and video
https://github.com/TokTok/c-toxcore/pull/578#issuecomment-360095609, just
as iphydf said.
|
|
This is the implementation of the [proposed fix](https://github.com/TokTok/c-toxcore/issues/620#issuecomment-346902071) for [this issue](https://github.com/TokTok/c-toxcore/issues/620).
|
|
socket -> net_socket
htons -> net_htons
htonl -> net_htonl
connect -> net_connect
sendto -> net_sendto_ip4
getaddrinfo -> net_getipport
sa_family_t -> Family
|
|
|
|
|
|
"All rights reserved" was incorrect. The project was licensed under GPL3,
which means a lot of rights are licensed to everybody in the world, i.e.
not reserved to the "Tox Project".
|
|
calls msi_kill() (toxav.c:180) which frees msi_call instances (msi.c:161)
which are then used when call_remove() (toxav.c:1136) is called.
This fix prevents call_remove() from calling invalid pointer.
Fixes #278
|
|
|
|
|
|
It is still C code, so still compatible with C compilers as well. This
change lets us see more clearly where implicit conversions occur by
making them explicit.
|
|
This reverts commit 21f8db12c45bd56293262cd4abfb73cd9abec821.
It is currently broken. Incoming call callbacks are not invoked, and
instead the client goes offline immediately.
|
|
|
|
In the future, all TODOs added either need a bug number (TODO(#NN)) or a
person's github user name. By default, I made irungentoo the owner of
all toxcore TODOs, mannol the owner of toxav TODOs, and myself the owner
of API TODOs.
|
|
It now enforces a bit more formatting. In particular, padding inside
parentheses is removed. I would like it to remove padding after unary
operators, but there seems to be no option for that.
|
|
1. Current module (if C file).
2. Headers from current library.
3. Headers from other library (e.g. toxcore includes in toxav).
4. System headers.
|
|
http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
|
|
The parameter names were taken from function definitions to update the names in
function declarations (prototypes).
|
|
|
|
This removes the global logger (which by the way was deleted when the first tox
was killed, so other toxes would then stop logging). Various bits of the code
now carry a logger or pass it around. It's a bit less transparent now, but now
there is no need to have a global logger, and clients can decide what to log and
where.
|
|
We run astyle on Travis and check if there is a diff. The build terminates if
git finds a difference.
|