summaryrefslogtreecommitdiff
path: root/toxav/toxav.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-07-12 17:22:20 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-12 20:21:42 +0000
commitbeeb9b4335d9ca6f947a52528453753a51f194f3 (patch)
tree242cad42e2e90ebf5ed04283fd79f42f4e3afa60 /toxav/toxav.c
parentcbda01021c561bd061cb03a1c1bab58199ac2307 (diff)
Style fixes in TCP code; remove MIN and PAIR from util.h.
* 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.
Diffstat (limited to 'toxav/toxav.c')
-rw-r--r--toxav/toxav.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c
index 5abe1130..dcffca4d 100644
--- a/toxav/toxav.c
+++ b/toxav/toxav.c
@@ -242,6 +242,10 @@ void toxav_iterate(ToxAV *av)
242 ac_iterate(i->audio.second); 242 ac_iterate(i->audio.second);
243 vc_iterate(i->video.second); 243 vc_iterate(i->video.second);
244 244
245 // TODO(iphydf): Find out what MIN-semantics are desired here and
246 // use a min_* function from util.h.
247#define MIN(a,b) (((a)<(b))?(a):(b))
248
245 if (i->msi_call->self_capabilities & msi_CapRAudio && 249 if (i->msi_call->self_capabilities & msi_CapRAudio &&
246 i->msi_call->peer_capabilities & msi_CapSAudio) { 250 i->msi_call->peer_capabilities & msi_CapSAudio) {
247 rc = MIN(i->audio.second->lp_frame_duration, rc); 251 rc = MIN(i->audio.second->lp_frame_duration, rc);