diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-07-17 01:18:04 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-07-22 02:34:30 +0000 |
commit | f627a26a7b1c3619ba66f84b87092ff8ba7a95b6 (patch) | |
tree | c72c950fab473dc9bec4b5329d251b790e55443d /other | |
parent | 7245ac11ef9be2420c8356c12acc79f93ea211bb (diff) |
Run Clang global static analysis on Travis.
This uses a single .cc file containing almost all the code in the
repository to perform whole program analysis.
Diffstat (limited to 'other')
-rw-r--r-- | other/BUILD.bazel | 12 | ||||
-rw-r--r-- | other/analysis/gen-file.sh | 116 | ||||
-rwxr-xr-x | other/analysis/run-clang | 22 | ||||
-rwxr-xr-x | other/analysis/run-clang-analyze | 8 | ||||
-rwxr-xr-x | other/analysis/run-cppcheck | 4 | ||||
-rwxr-xr-x | other/analysis/run-gcc | 23 | ||||
-rwxr-xr-x | other/analysis/run-infer | 4 | ||||
-rwxr-xr-x | other/analysis/run-sparse | 9 | ||||
-rw-r--r-- | other/bootstrap_daemon/src/config.c | 4 | ||||
-rw-r--r-- | other/bootstrap_daemon/src/tox-bootstrapd.c | 2 | ||||
-rw-r--r-- | other/cpufeatures.c | 2 | ||||
-rw-r--r-- | other/fun/cracker.c | 2 | ||||
-rw-r--r-- | other/fun/sign.c | 15 | ||||
-rw-r--r-- | other/fun/strkey.c | 2 | ||||
-rw-r--r-- | other/monolith.h | 38 |
15 files changed, 124 insertions, 139 deletions
diff --git a/other/BUILD.bazel b/other/BUILD.bazel index 8bcdc4b4..d0fcf850 100644 --- a/other/BUILD.bazel +++ b/other/BUILD.bazel | |||
@@ -1,18 +1,6 @@ | |||
1 | load("//tools:no_undefined.bzl", "cc_library") | 1 | load("//tools:no_undefined.bzl", "cc_library") |
2 | 2 | ||
3 | cc_library( | 3 | cc_library( |
4 | name = "monolith", | ||
5 | hdrs = ["monolith.h"], | ||
6 | visibility = ["//c-toxcore/auto_tests:__pkg__"], | ||
7 | deps = [ | ||
8 | "//c-toxcore/testing:monolith", | ||
9 | "//c-toxcore/toxav:monolith", | ||
10 | "//c-toxcore/toxcore:monolith", | ||
11 | "//c-toxcore/toxencryptsave:monolith", | ||
12 | ], | ||
13 | ) | ||
14 | |||
15 | cc_library( | ||
16 | name = "bootstrap_node_packets", | 4 | name = "bootstrap_node_packets", |
17 | srcs = ["bootstrap_node_packets.c"], | 5 | srcs = ["bootstrap_node_packets.c"], |
18 | hdrs = ["bootstrap_node_packets.h"], | 6 | hdrs = ["bootstrap_node_packets.h"], |
diff --git a/other/analysis/gen-file.sh b/other/analysis/gen-file.sh index 710e20d7..89144eff 100644 --- a/other/analysis/gen-file.sh +++ b/other/analysis/gen-file.sh | |||
@@ -1,48 +1,80 @@ | |||
1 | CPPFLAGS="-DMIN_LOGGER_LEVEL=LOG_TRACE -Iauto_tests -Itoxcore -Itoxav -Itoxencryptsave `pkg-config --cflags libsodium opus vpx`" | 1 | #!/bin/sh |
2 | |||
3 | CPPFLAGS="$CPPFLAGS -DMIN_LOGGER_LEVEL=LOGGER_LEVEL_TRACE" | ||
4 | CPPFLAGS="$CPPFLAGS -isystem /usr/include/opus" | ||
5 | CPPFLAGS="$CPPFLAGS -Iauto_tests" | ||
6 | CPPFLAGS="$CPPFLAGS -Iother" | ||
7 | CPPFLAGS="$CPPFLAGS -Iother/bootstrap_daemon/src" | ||
8 | CPPFLAGS="$CPPFLAGS -Iother/fun" | ||
9 | CPPFLAGS="$CPPFLAGS -Itesting" | ||
10 | CPPFLAGS="$CPPFLAGS -Itoxcore" | ||
11 | CPPFLAGS="$CPPFLAGS -Itoxav" | ||
12 | CPPFLAGS="$CPPFLAGS -Itoxencryptsave" | ||
13 | |||
14 | LDFLAGS="$LDFLAGS -lopus -lsodium -lvpx -lpthread -lconfig" | ||
2 | 15 | ||
3 | put() { | 16 | put() { |
4 | if [ "$SKIP_LINES" = "" ]; then | 17 | if [ "$SKIP_LINES" = "" ]; then |
5 | echo "#line 1 \"$1\"" >> test.c | 18 | echo "#line 1 \"$1\"" >> amalgamation.cc |
19 | fi | ||
20 | cat $1 >> amalgamation.cc | ||
21 | } | ||
22 | |||
23 | putmain() { | ||
24 | echo "namespace $(echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g') {" >> amalgamation.cc | ||
25 | if [ "$SKIP_LINES" = "" ]; then | ||
26 | echo "#line 1 \"$1\"" >> amalgamation.cc | ||
6 | fi | 27 | fi |
7 | cat $1 >> test.c | 28 | sed -e 's/^int main(/static &/' $1 >> amalgamation.cc |
29 | echo "} // namespace $(echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g')" >> amalgamation.cc | ||
30 | } | ||
31 | |||
32 | callmain() { | ||
33 | echo " call($(echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g')::main, argc, argv);" >> amalgamation.cc | ||
8 | } | 34 | } |
9 | 35 | ||
10 | :> test.c | 36 | :> amalgamation.cc |
11 | 37 | ||
12 | put toxcore/tox.c | 38 | echo "#include <algorithm>" >> amalgamation.cc |
13 | 39 | echo "#include <cstdio>" >> amalgamation.cc | |
14 | put toxcore/DHT.c | 40 | echo "#include <memory>" >> amalgamation.cc |
15 | put toxcore/LAN_discovery.c | 41 | echo "#include <random>" >> amalgamation.cc |
16 | put toxcore/Messenger.c | 42 | |
17 | put toxcore/TCP_client.c | 43 | echo "#define TOX_DEFINED" >> amalgamation.cc |
18 | put toxcore/TCP_connection.c | 44 | echo "typedef struct Messenger Tox;" >> amalgamation.cc |
19 | put toxcore/TCP_server.c | 45 | |
20 | put toxcore/crypto_core.c | 46 | put auto_tests/check_compat.h |
21 | put toxcore/crypto_core_mem.c | 47 | |
22 | put toxcore/friend_connection.c | 48 | FIND_QUERY="find . '-(' -name '*.cc' -or -name '*.c' '-)'" |
23 | put toxcore/friend_requests.c | 49 | FIND_QUERY="$FIND_QUERY -and -not -wholename './super_donators/*'" |
24 | put toxcore/group.c | 50 | FIND_QUERY="$FIND_QUERY -and -not -wholename './toxav/*.cc'" |
25 | put toxcore/list.c | 51 | FIND_QUERY="$FIND_QUERY -and -not -wholename './toxcore/*.cc'" |
26 | put toxcore/logger.c | 52 | FIND_QUERY="$FIND_QUERY -and -not -wholename './toxencryptsave/*.cc'" |
27 | put toxcore/network.c | 53 | FIND_QUERY="$FIND_QUERY -and -not -name amalgamation.cc" |
28 | put toxcore/net_crypto.c | 54 | FIND_QUERY="$FIND_QUERY -and -not -name av_test.c" |
29 | put toxcore/onion.c | 55 | FIND_QUERY="$FIND_QUERY -and -not -name dht_test.c" |
30 | put toxcore/onion_announce.c | 56 | FIND_QUERY="$FIND_QUERY -and -not -name version_test.c" |
31 | put toxcore/onion_client.c | 57 | |
32 | put toxcore/ping.c | 58 | for i in $(eval $FIND_QUERY); do |
33 | put toxcore/ping_array.c | 59 | if ! grep -q '^int main(' $i; then |
34 | put toxcore/tox_api.c | 60 | put $i |
35 | put toxcore/util.c | 61 | fi |
36 | 62 | done | |
37 | # Not included yet, since there are too many issues with this code. | 63 | |
38 | #put toxav/audio.c | 64 | for i in $(eval $FIND_QUERY); do |
39 | #put toxav/bwcontroller.c | 65 | if grep -q '^int main(' $i; then |
40 | #put toxav/groupav.c | 66 | putmain $i |
41 | #put toxav/msi.c | 67 | fi |
42 | #put toxav/ring_buffer.c | 68 | done |
43 | #put toxav/rtp.c | 69 | |
44 | #put toxav/toxav.c | 70 | echo "static void call(int m(), int argc, char **argv) { m(); }" >> amalgamation.cc |
45 | #put toxav/toxav_old.c | 71 | echo "static void call(int m(int, char **), int argc, char **argv) { m(argc, argv); }" >> amalgamation.cc |
46 | #put toxav/video.c | 72 | |
47 | 73 | echo "int main(int argc, char **argv) {" >> amalgamation.cc | |
48 | put toxencryptsave/toxencryptsave.c | 74 | for i in $(eval $FIND_QUERY); do |
75 | if grep -q '^int main(' $i; then | ||
76 | callmain $i | ||
77 | fi | ||
78 | done | ||
79 | echo " return 0;" >> amalgamation.cc | ||
80 | echo "}" >> amalgamation.cc | ||
diff --git a/other/analysis/run-clang b/other/analysis/run-clang index 1c8da7ea..60e59eab 100755 --- a/other/analysis/run-clang +++ b/other/analysis/run-clang | |||
@@ -2,6 +2,22 @@ | |||
2 | 2 | ||
3 | . other/analysis/gen-file.sh | 3 | . other/analysis/gen-file.sh |
4 | 4 | ||
5 | put auto_tests/lan_discovery_test.c | 5 | echo "Running Clang compiler" |
6 | 6 | clang++ -o /dev/null amalgamation.cc \ | |
7 | clang --analyze test.c $CPPFLAGS | 7 | $CPPFLAGS \ |
8 | $LDFLAGS \ | ||
9 | -std=c++11 \ | ||
10 | -Weverything \ | ||
11 | -Wno-c++98-compat-pedantic \ | ||
12 | -Wno-c99-extensions \ | ||
13 | -Wno-cast-align \ | ||
14 | -Wno-conversion \ | ||
15 | -Wno-covered-switch-default \ | ||
16 | -Wno-documentation-deprecated-sync \ | ||
17 | -Wno-missing-field-initializers \ | ||
18 | -Wno-old-style-cast \ | ||
19 | -Wno-padded \ | ||
20 | -Wno-sign-compare \ | ||
21 | -Wno-unreachable-code-return \ | ||
22 | -Wno-unused-parameter \ | ||
23 | -Wno-used-but-marked-unused \ | ||
diff --git a/other/analysis/run-clang-analyze b/other/analysis/run-clang-analyze new file mode 100755 index 00000000..0e6d9af0 --- /dev/null +++ b/other/analysis/run-clang-analyze | |||
@@ -0,0 +1,8 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | . other/analysis/gen-file.sh | ||
4 | |||
5 | echo "Running Clang static analyzer" | ||
6 | clang++ --analyze amalgamation.cc \ | ||
7 | $CPPFLAGS \ | ||
8 | -std=c++11 | ||
diff --git a/other/analysis/run-cppcheck b/other/analysis/run-cppcheck index 9e928c9a..dc369840 100755 --- a/other/analysis/run-cppcheck +++ b/other/analysis/run-cppcheck | |||
@@ -2,6 +2,4 @@ | |||
2 | 2 | ||
3 | . other/analysis/gen-file.sh | 3 | . other/analysis/gen-file.sh |
4 | 4 | ||
5 | put auto_tests/lan_discovery_test.c | 5 | cppcheck amalgamation.cc $CPPFLAGS |
6 | |||
7 | cppcheck test.c $CPPFLAGS | ||
diff --git a/other/analysis/run-gcc b/other/analysis/run-gcc index ffd42f4e..3ea32782 100755 --- a/other/analysis/run-gcc +++ b/other/analysis/run-gcc | |||
@@ -2,12 +2,14 @@ | |||
2 | 2 | ||
3 | . other/analysis/gen-file.sh | 3 | . other/analysis/gen-file.sh |
4 | 4 | ||
5 | put auto_tests/lan_discovery_test.c | 5 | echo "Running GCC" |
6 | |||
7 | # TODO(iphydf): Get rid of all VLAs, then enable -fstack-protector -Wstack-protector | 6 | # TODO(iphydf): Get rid of all VLAs, then enable -fstack-protector -Wstack-protector |
8 | gcc -O3 -c -o /dev/null test.c $CPPFLAGS \ | 7 | g++ -O3 -o /dev/null amalgamation.cc \ |
9 | -std=c99 \ | 8 | $CPPFLAGS \ |
9 | $LDFLAGS \ | ||
10 | -std=c++11 \ | ||
10 | -pedantic \ | 11 | -pedantic \ |
12 | -fdiagnostics-color=always \ | ||
11 | -Wall \ | 13 | -Wall \ |
12 | -Wextra \ | 14 | -Wextra \ |
13 | -Wno-aggregate-return \ | 15 | -Wno-aggregate-return \ |
@@ -22,18 +24,9 @@ gcc -O3 -c -o /dev/null test.c $CPPFLAGS \ | |||
22 | -Wno-unused-parameter \ | 24 | -Wno-unused-parameter \ |
23 | -Wstrict-aliasing=0 \ | 25 | -Wstrict-aliasing=0 \ |
24 | -Wstrict-overflow=1 \ | 26 | -Wstrict-overflow=1 \ |
25 | \ | 27 | \ |
26 | -Wbad-function-cast \ | ||
27 | -Wmissing-declarations \ | 28 | -Wmissing-declarations \ |
28 | -Wmissing-parameter-type \ | ||
29 | -Wmissing-prototypes \ | ||
30 | -Wnested-externs \ | ||
31 | -Wold-style-declaration \ | ||
32 | -Wold-style-definition \ | ||
33 | -Wstrict-prototypes \ | ||
34 | -Wbool-compare \ | 29 | -Wbool-compare \ |
35 | -Wc99-c11-compat \ | ||
36 | -Wc++-compat \ | ||
37 | -Wcast-align \ | 30 | -Wcast-align \ |
38 | -Wcast-qual \ | 31 | -Wcast-qual \ |
39 | -Wchar-subscripts \ | 32 | -Wchar-subscripts \ |
@@ -45,10 +38,8 @@ gcc -O3 -c -o /dev/null test.c $CPPFLAGS \ | |||
45 | -Wformat=2 \ | 38 | -Wformat=2 \ |
46 | -Wframe-address \ | 39 | -Wframe-address \ |
47 | -Wframe-larger-than=133168 \ | 40 | -Wframe-larger-than=133168 \ |
48 | -Wjump-misses-init \ | ||
49 | -Wignored-qualifiers \ | 41 | -Wignored-qualifiers \ |
50 | -Wignored-attributes \ | 42 | -Wignored-attributes \ |
51 | -Wincompatible-pointer-types \ | ||
52 | -Winit-self \ | 43 | -Winit-self \ |
53 | -Winline \ | 44 | -Winline \ |
54 | -Wlarger-than=133120 \ | 45 | -Wlarger-than=133120 \ |
diff --git a/other/analysis/run-infer b/other/analysis/run-infer index 942d0cfd..2a897227 100755 --- a/other/analysis/run-infer +++ b/other/analysis/run-infer | |||
@@ -5,6 +5,4 @@ SKIP_LINES=1 | |||
5 | 5 | ||
6 | . other/analysis/gen-file.sh | 6 | . other/analysis/gen-file.sh |
7 | 7 | ||
8 | put auto_tests/lan_discovery_test.c | 8 | infer -- clang++ -fsyntax-only amalgamation.cc $CPPFLAGS |
9 | |||
10 | infer -- clang -fsyntax-only test.c $CPPFLAGS | ||
diff --git a/other/analysis/run-sparse b/other/analysis/run-sparse deleted file mode 100755 index b4d0f736..00000000 --- a/other/analysis/run-sparse +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | . other/analysis/gen-file.sh | ||
4 | |||
5 | put auto_tests/lan_discovery_test.c | ||
6 | |||
7 | sparse test.c $CPPFLAGS \ | ||
8 | -Wsparse-all \ | ||
9 | -Wno-declaration-after-statement | ||
diff --git a/other/bootstrap_daemon/src/config.c b/other/bootstrap_daemon/src/config.c index 9fde33b2..0a7f566b 100644 --- a/other/bootstrap_daemon/src/config.c +++ b/other/bootstrap_daemon/src/config.c | |||
@@ -303,7 +303,7 @@ int get_general_config(const char *cfg_file_path, char **pid_file_path, char **k | |||
303 | * @return binary on success, | 303 | * @return binary on success, |
304 | * NULL on failure. | 304 | * NULL on failure. |
305 | */ | 305 | */ |
306 | static uint8_t *hex_string_to_bin(const char *hex_string) | 306 | static uint8_t *bootstrap_hex_string_to_bin(const char *hex_string) |
307 | { | 307 | { |
308 | if (strlen(hex_string) % 2 != 0) { | 308 | if (strlen(hex_string) % 2 != 0) { |
309 | return nullptr; | 309 | return nullptr; |
@@ -407,7 +407,7 @@ int bootstrap_from_config(const char *cfg_file_path, DHT *dht, int enable_ipv6) | |||
407 | goto next; | 407 | goto next; |
408 | } | 408 | } |
409 | 409 | ||
410 | bs_public_key_bin = hex_string_to_bin(bs_public_key); | 410 | bs_public_key_bin = bootstrap_hex_string_to_bin(bs_public_key); |
411 | address_resolved = dht_bootstrap_from_address(dht, bs_address, enable_ipv6, net_htons(bs_port), | 411 | address_resolved = dht_bootstrap_from_address(dht, bs_address, enable_ipv6, net_htons(bs_port), |
412 | bs_public_key_bin); | 412 | bs_public_key_bin); |
413 | free(bs_public_key_bin); | 413 | free(bs_public_key_bin); |
diff --git a/other/bootstrap_daemon/src/tox-bootstrapd.c b/other/bootstrap_daemon/src/tox-bootstrapd.c index fd05f8a2..b17fc2ba 100644 --- a/other/bootstrap_daemon/src/tox-bootstrapd.c +++ b/other/bootstrap_daemon/src/tox-bootstrapd.c | |||
@@ -22,7 +22,9 @@ | |||
22 | * You should have received a copy of the GNU General Public License | 22 | * You should have received a copy of the GNU General Public License |
23 | * along with Tox. If not, see <http://www.gnu.org/licenses/>. | 23 | * along with Tox. If not, see <http://www.gnu.org/licenses/>. |
24 | */ | 24 | */ |
25 | #ifndef _XOPEN_SOURCE | ||
25 | #define _XOPEN_SOURCE 600 | 26 | #define _XOPEN_SOURCE 600 |
27 | #endif | ||
26 | 28 | ||
27 | // system provided | 29 | // system provided |
28 | #include <sys/stat.h> | 30 | #include <sys/stat.h> |
diff --git a/other/cpufeatures.c b/other/cpufeatures.c index e52a90ff..3da06e58 100644 --- a/other/cpufeatures.c +++ b/other/cpufeatures.c | |||
@@ -1,5 +1,5 @@ | |||
1 | #define typeof __typeof__ | ||
2 | #ifdef ANDROID_CPU_FEATURES | 1 | #ifdef ANDROID_CPU_FEATURES |
2 | #define typeof __typeof__ | ||
3 | #include ANDROID_CPU_FEATURES | 3 | #include ANDROID_CPU_FEATURES |
4 | #endif | 4 | #endif |
5 | 5 | ||
diff --git a/other/fun/cracker.c b/other/fun/cracker.c index 502a8af0..fd9564f6 100644 --- a/other/fun/cracker.c +++ b/other/fun/cracker.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include "../../testing/misc_tools.h" | 20 | #include "../../testing/misc_tools.h" |
21 | #include "../../toxcore/ccompat.h" | 21 | #include "../../toxcore/ccompat.h" |
22 | 22 | ||
23 | void print_key(uint8_t *client_id) | 23 | static void print_key(uint8_t *client_id) |
24 | { | 24 | { |
25 | uint32_t j; | 25 | uint32_t j; |
26 | 26 | ||
diff --git a/other/fun/sign.c b/other/fun/sign.c index 007d19a0..547af311 100644 --- a/other/fun/sign.c +++ b/other/fun/sign.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "../../testing/misc_tools.h" // hex_string_to_bin | 21 | #include "../../testing/misc_tools.h" // hex_string_to_bin |
22 | #include "../../toxcore/ccompat.h" | 22 | #include "../../toxcore/ccompat.h" |
23 | 23 | ||
24 | int load_file(char *filename, char **result) | 24 | static int load_file(char *filename, unsigned char **result) |
25 | { | 25 | { |
26 | int size = 0; | 26 | int size = 0; |
27 | FILE *f = fopen(filename, "rb"); | 27 | FILE *f = fopen(filename, "rb"); |
@@ -34,7 +34,7 @@ int load_file(char *filename, char **result) | |||
34 | fseek(f, 0, SEEK_END); | 34 | fseek(f, 0, SEEK_END); |
35 | size = ftell(f); | 35 | size = ftell(f); |
36 | fseek(f, 0, SEEK_SET); | 36 | fseek(f, 0, SEEK_SET); |
37 | *result = (char *)malloc(size + 1); | 37 | *result = (unsigned char *)malloc(size + 1); |
38 | 38 | ||
39 | if (size != fread(*result, sizeof(char), size, f)) { | 39 | if (size != fread(*result, sizeof(char), size, f)) { |
40 | free(*result); | 40 | free(*result); |
@@ -72,7 +72,7 @@ int main(int argc, char *argv[]) | |||
72 | 72 | ||
73 | if (argc == 5 && argv[1][0] == 's') { | 73 | if (argc == 5 && argv[1][0] == 's') { |
74 | unsigned char *secret_key = hex_string_to_bin(argv[2]); | 74 | unsigned char *secret_key = hex_string_to_bin(argv[2]); |
75 | char *data; | 75 | unsigned char *data; |
76 | int size = load_file(argv[3], &data); | 76 | int size = load_file(argv[3], &data); |
77 | 77 | ||
78 | if (size < 0) { | 78 | if (size < 0) { |
@@ -80,7 +80,7 @@ int main(int argc, char *argv[]) | |||
80 | } | 80 | } |
81 | 81 | ||
82 | unsigned long long smlen; | 82 | unsigned long long smlen; |
83 | char *sm = malloc(size + crypto_sign_ed25519_BYTES * 2); | 83 | unsigned char *sm = (unsigned char *)malloc(size + crypto_sign_ed25519_BYTES * 2); |
84 | crypto_sign_ed25519(sm, &smlen, data, size, secret_key); | 84 | crypto_sign_ed25519(sm, &smlen, data, size, secret_key); |
85 | free(secret_key); | 85 | free(secret_key); |
86 | 86 | ||
@@ -106,19 +106,18 @@ int main(int argc, char *argv[]) | |||
106 | 106 | ||
107 | if (argc == 4 && argv[1][0] == 'c') { | 107 | if (argc == 4 && argv[1][0] == 'c') { |
108 | unsigned char *public_key = hex_string_to_bin(argv[2]); | 108 | unsigned char *public_key = hex_string_to_bin(argv[2]); |
109 | char *data; | 109 | unsigned char *data; |
110 | int size = load_file(argv[3], &data); | 110 | int size = load_file(argv[3], &data); |
111 | 111 | ||
112 | if (size < 0) { | 112 | if (size < 0) { |
113 | goto fail; | 113 | goto fail; |
114 | } | 114 | } |
115 | 115 | ||
116 | char *signe = malloc(size + crypto_sign_ed25519_BYTES); | 116 | unsigned char *signe = (unsigned char *)malloc(size + crypto_sign_ed25519_BYTES); |
117 | memcpy(signe, data + size - crypto_sign_ed25519_BYTES, | 117 | memcpy(signe, data + size - crypto_sign_ed25519_BYTES, |
118 | crypto_sign_ed25519_BYTES); // Move signature from end to beginning of file. | 118 | crypto_sign_ed25519_BYTES); // Move signature from end to beginning of file. |
119 | memcpy(signe + crypto_sign_ed25519_BYTES, data, size - crypto_sign_ed25519_BYTES); | 119 | memcpy(signe + crypto_sign_ed25519_BYTES, data, size - crypto_sign_ed25519_BYTES); |
120 | unsigned long long smlen; | 120 | unsigned char *m = (unsigned char *)malloc(size); |
121 | char *m = malloc(size); | ||
122 | unsigned long long mlen; | 121 | unsigned long long mlen; |
123 | 122 | ||
124 | if (crypto_sign_ed25519_open(m, &mlen, signe, size, public_key) == -1) { | 123 | if (crypto_sign_ed25519_open(m, &mlen, signe, size, public_key) == -1) { |
diff --git a/other/fun/strkey.c b/other/fun/strkey.c index ef54a404..d769318a 100644 --- a/other/fun/strkey.c +++ b/other/fun/strkey.c | |||
@@ -43,7 +43,7 @@ | |||
43 | 43 | ||
44 | #define PRINT_TRIES_COUNT | 44 | #define PRINT_TRIES_COUNT |
45 | 45 | ||
46 | void print_key(unsigned char *key) | 46 | static void print_key(unsigned char *key) |
47 | { | 47 | { |
48 | size_t i; | 48 | size_t i; |
49 | 49 | ||
diff --git a/other/monolith.h b/other/monolith.h deleted file mode 100644 index 356252f2..00000000 --- a/other/monolith.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | #include "../toxcore/tox.c" | ||
2 | |||
3 | #include "../toxcore/DHT.c" | ||
4 | #include "../toxcore/LAN_discovery.c" | ||
5 | #include "../toxcore/Messenger.c" | ||
6 | #include "../toxcore/TCP_client.c" | ||
7 | #include "../toxcore/TCP_connection.c" | ||
8 | #include "../toxcore/TCP_server.c" | ||
9 | #include "../toxcore/crypto_core.c" | ||
10 | #include "../toxcore/crypto_core_mem.c" | ||
11 | #include "../toxcore/friend_connection.c" | ||
12 | #include "../toxcore/friend_requests.c" | ||
13 | #include "../toxcore/group.c" | ||
14 | #include "../toxcore/list.c" | ||
15 | #include "../toxcore/logger.c" | ||
16 | #include "../toxcore/mono_time.c" | ||
17 | #include "../toxcore/network.c" | ||
18 | #include "../toxcore/net_crypto.c" | ||
19 | #include "../toxcore/onion.c" | ||
20 | #include "../toxcore/onion_announce.c" | ||
21 | #include "../toxcore/onion_client.c" | ||
22 | #include "../toxcore/ping.c" | ||
23 | #include "../toxcore/ping_array.c" | ||
24 | #include "../toxcore/state.c" | ||
25 | #include "../toxcore/tox_api.c" | ||
26 | #include "../toxcore/util.c" | ||
27 | |||
28 | #include "../toxav/audio.c" | ||
29 | #include "../toxav/bwcontroller.c" | ||
30 | #include "../toxav/groupav.c" | ||
31 | #include "../toxav/msi.c" | ||
32 | #include "../toxav/ring_buffer.c" | ||
33 | #include "../toxav/rtp.c" | ||
34 | #include "../toxav/toxav.c" | ||
35 | #include "../toxav/toxav_old.c" | ||
36 | #include "../toxav/video.c" | ||
37 | |||
38 | #include "../toxencryptsave/toxencryptsave.c" | ||