Commit Graph

3938 Commits

Author SHA1 Message Date
iphydf
95b8365af6
Remove redundant callback objects.
These three objects and their callback IDs are always the same.
2016-09-27 14:22:48 +01:00
iphydf
621c3fddb2
C++ the second round.
Group chats were changed and now need to be updated. This change got
lost in the merge.
2016-09-26 00:03:48 +01:00
iphydf
d369448ace
Work around bug in opencv3 headers.
OpenCV 3.1 doesn't define cvRound in C, only in C++. Thus, we now need
to compile av_test as C++ code.
2016-09-25 01:58:51 +01:00
iphydf
f60900c4b8
Move ring buffer out of toxcore/util into toxav.
Toxcore itself doesn't use this data structure. Only toxav does, so now
toxav owns the code for it.
2016-09-24 23:36:50 +01:00
iphydf
15cb426166
Make toxcore code C++ compatible.
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.
2016-09-24 21:53:50 +01:00
iphydf
0d347c2b2e
Minor cleanups: unused vars, unreachable code, static globals.
- All global variables should be static unless they have an explicit
  extern declaration in a header file.
- `to_compare` was not used in encryptsave and toxav tests.
- `break` in switch cases is not required directly after `return`,
  `goto`, or a noreturn function like `abort`.
2016-09-24 20:52:09 +01:00
iphydf
b588e0fdd3
Replace void* with RingBuffer* to avoid conversions.
`vbuf_raw` is always a `RingBuffer*` so there is no need to pretend it
could ever be anything else (as indicated by it being a pointer to
void).
2016-09-23 11:41:11 +01:00
iphydf
18b298a3d6
Make TCP_Connections module-private. 2016-09-22 16:42:36 +01:00
iphydf
fd50660f40
Allow the OSX build to fail on travis.
Given that it fails about 80-90% of the time, it's not worth requiring
it to pass. Instead, we'll need to manually look at the osx build to see
in what way it failed.

Also, set `fast_finish` to true, since OSX regularly has multi-hour (up
to half a day) outages that can't block us for trivial code changes or
non-code changes.
2016-09-22 14:46:51 +01:00
iphydf
78d77349e4
Make TCP_Server opaque.
We should aim to make as many structures module-private as possible.
2016-09-22 11:22:32 +01:00
irungentoo
161ab46f88
Merge branch 'arza-zara-umask' 2016-09-21 23:27:58 -04:00
iphydf
aa7670da5a
Fix strict-ld grep expressions to include digits.
`tox_options_[gs]et_ipv6_enabled` were missing from the version script
because the grep expression only accepted `[a-z_]`. Now it also accepts
digits in the function names.
2016-09-21 22:36:29 +01:00
Jfreegman
dd2965a58f Make group callbacks stateless 2016-09-21 15:33:55 -04:00
iphydf
e59fd26d49
Add OSX and Windows build to travis config.
Tests for Windows are disabled for now, until we figure out which tests
can successfully run on wine and select only those.
2016-09-20 13:52:33 +01:00
iphydf
51d18236c8
Revert "Make ToxAV stateless"
This reverts commit 21f8db12c4.

It is currently broken. Incoming call callbacks are not invoked, and
instead the client goes offline immediately.
2016-09-19 21:53:40 +01:00
iphydf
67ac9138ab
Add STRICT_ABI cmake flag to generate export lists.
Enabling this flag will generate and use an LD version script. It
ensures that the dynamic libraries (libtoxcore.so, libtoxav.so) only
export the symbols that are defined in their public API (tox.h and
toxav.h, respectively).
2016-09-19 19:42:12 +01:00
arza
d28f94a2f9 Changed the umask to 077 so that the keys file is not readable/writable by other users. 2016-09-19 05:03:48 +03:00
arza
3df21424bb Included sys/stat.h. 2016-09-19 05:03:38 +03:00
Gregory Mullen (grayhatter)
d497bfe533
Added UB comment r/t deleting a friend w/ active call 2016-09-18 18:59:17 -07:00
iphydf
b6db1dba9a
Make internal chat list function take uint32_t* as well.
The public one already does this, and the internal one actually assigns
`uint32_t`s.
2016-09-18 11:27:14 +01:00
iphydf
f41b010e9b
Only build toxav if opus and vpx are found. 2016-09-18 02:18:24 +01:00
Jfreegman
8e43ca834c Complete old groupchat conversion to new API 2016-09-17 19:11:28 -04:00
iphydf
c0397a0a46 ApiDSL'ing old group chats (now: conference). 2016-09-17 19:11:28 -04:00
Gregory Mullen (grayhatter)
21f8db12c4
Make ToxAV stateless 2016-09-17 14:05:51 -07:00
iphydf
5da85c582d
Fix for windows dynamic libraries. 2016-09-17 19:54:22 +01:00
iphydf
80cc32a79d
Use C99 %zu format conversion in printf for size_t.
size_t is unsigned long long on LLP64 and %lu prints unsigned long (32
bit), potentially causing problems.
2016-09-17 10:19:49 +01:00
iphydf
63e0008b7d
const-correctness in windows code. 2016-09-16 14:45:52 +01:00
iphydf
1494e474dd
Ensure that all TODOs have an owner.
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.
2016-09-16 12:06:02 +01:00
iphydf
37c041f815
Clean up Travis build a bit in preparation for osx/win. 2016-09-16 11:22:23 +01:00
iphydf
c0d84ab489
Remove format-source from travis script.
This test is already performed by `make test` later on. We originally
had it in the Travis script to make it fail fast when the format is
wrong, but there is also some value in running all tests despite format
errors.

Fixes #83. There are no more relevant phases that would benefit from the
padding lines proposed.
2016-09-16 11:05:54 +01:00
iphydf
d1f16e27b8
Add option to build static libraries. 2016-09-14 14:32:01 +01:00
iphydf
45d28904b9
Use <stdbool.h> and replace _Bool with bool.
This header is a requirement for the public API, therefore is assumed to
exist. It is a C99 standard library header, and _Bool is not intended to
be used directly, except in legacy code that defines bool (and
true/false) itself. We don't use or depend on such code. None of our
client code uses or depends on such code. There is no reason to not use
bool.
2016-09-13 22:01:45 +01:00
iphydf
a8823830d3
Add some astyle options to make it do more.
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.
2016-09-13 01:07:02 +01:00
iphydf
0aa2840164
Group #include directives in 3-4 groups.
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.
2016-09-13 00:32:02 +01:00
iphydf
2b2dc07f6f
Merge remote-tracking branch 'chuongv/chuongv/tox_test_fix' 2016-09-12 23:46:50 +01:00
iphydf
a365bef2ae
Remove else directly after return.
See #78.
2016-09-12 16:30:00 +01:00
iphydf
2db31d95fd
Use "phase" script for travis build phases.
This is the first step towards unifying travis configs for toxcore,
hstox, and qtox.
2016-09-11 22:13:47 +01:00
iphydf
6683a4b284
Use TokTok's apidsl instead of the iphydf one. 2016-09-11 21:09:41 +01:00
Chuong Vu
d9cd1b0c64 Use correct logical operator for tox_test
Check to ensure that all 3 tox instances are up rather than
just one.
2016-09-11 10:47:15 -07:00
michael bishop
05f474b4df
make the majority of the callbacks stateless and add some status to a testcase 2016-09-10 01:09:37 -03:00
iphydf
406d292107
Minor cleanups: header reordering, adding {}.
I hadn't done this for the "fun" code, yet. Also, we should include
system headers after our own headers.

"In general, a module should be implemented by one or more .cpp files.
Each of these .cpp files should include the header that defines their
interface first. This ensures that all of the dependences of the module
header have been properly added to the module header itself, and are not
implicit. System headers should be included after user headers for a
translation unit."
-- http://llvm.org/docs/CodingStandards.html#a-public-header-file-is-a-module
2016-09-09 19:30:50 +01:00
Jfreegman
769db9dd9a Separate IP_Port packing from pack_nodes() and unpack_nodes()
Allows us to pack IP_Port structs that are part of arbitrarily structured data.
2016-09-09 10:37:40 -04:00
iphydf
59075ba325
Use const for version numbers.
ApiDSL generates the lowercase function declarations for us and puts them in the
right namespace (TOX_, TOXAV_).
2016-09-09 10:05:12 +01:00
iphydf
3521898b0c
Fix potential null pointer dereference.
This used to not be an issue, but now that the logger is no longer
global, not all source locations may have access to it.
2016-09-08 20:21:12 +01:00
iphydf
54de13c1c7
Fix compilation for Windows.
- Mingw32 didn't read MSDN, so behaves badly despite lean and mean.
- Avoid alignment issues on windows with packed bitfields in the RTP header.
  This change makes the program ill-formed in C99, but I don't know the correct
  fix at the moment, and I don't want to keep the Windows build broken for too
  long.
2016-09-08 11:37:35 +01:00
iphydf
d5f9344847
Remove the packet mutation in toxav's bwcontroller.
1. This mutation is never observed outside the function.
2. If it were (it's not), it would be undefined behaviour, since the
   packet data goes out of scope a few instructions after the callback
   returns.
2016-09-08 11:10:25 +01:00
iphydf
254feb0acd
Add address sanitizer option to cmake file. 2016-09-08 10:13:40 +01:00
iphydf
ca1fe7ff7d
Fix memory leak on error paths in tox_new.
We didn't need to create the logger before all the validations. There is only
one error path where we need to free the logger.
2016-09-08 01:04:46 +01:00
iphydf
159dc3b6ab
Print a message about missing astyle in format-source. 2016-09-07 23:11:13 +01:00
Jfreegman
27a1626084
Comment intentional switch fallthroughs 2016-09-07 17:48:01 -04:00