diff options
-rw-r--r-- | super_donators/BUILD.bazel | 1 | ||||
-rw-r--r-- | testing/av_test.c | 15 | ||||
-rw-r--r-- | toxcore/DHT.c | 4 | ||||
-rw-r--r-- | toxcore/tox.c | 6 |
4 files changed, 20 insertions, 6 deletions
diff --git a/super_donators/BUILD.bazel b/super_donators/BUILD.bazel index 85629756..806f72b0 100644 --- a/super_donators/BUILD.bazel +++ b/super_donators/BUILD.bazel | |||
@@ -1,4 +1,5 @@ | |||
1 | cc_binary( | 1 | cc_binary( |
2 | name = "grencez_tok5", | 2 | name = "grencez_tok5", |
3 | srcs = ["grencez_tok5.c"], | 3 | srcs = ["grencez_tok5.c"], |
4 | copts = ["-Wno-unused-result"], | ||
4 | ) | 5 | ) |
diff --git a/testing/av_test.c b/testing/av_test.c index ca2b2779..a058e869 100644 --- a/testing/av_test.c +++ b/testing/av_test.c | |||
@@ -438,7 +438,10 @@ static int print_help(const char *name) | |||
438 | 438 | ||
439 | int main(int argc, char **argv) | 439 | int main(int argc, char **argv) |
440 | { | 440 | { |
441 | freopen("/dev/zero", "w", stderr); | 441 | if (freopen("/dev/zero", "w", stderr) == nullptr) { |
442 | return EXIT_FAILURE; | ||
443 | } | ||
444 | |||
442 | Pa_Initialize(); | 445 | Pa_Initialize(); |
443 | 446 | ||
444 | struct stat st; | 447 | struct stat st; |
@@ -649,10 +652,16 @@ CHECK_ARG: | |||
649 | output.hostApiSpecificStreamInfo = nullptr; | 652 | output.hostApiSpecificStreamInfo = nullptr; |
650 | 653 | ||
651 | PaError err = Pa_OpenStream(&adout, nullptr, &output, af_info.samplerate, frame_size, paNoFlag, nullptr, nullptr); | 654 | PaError err = Pa_OpenStream(&adout, nullptr, &output, af_info.samplerate, frame_size, paNoFlag, nullptr, nullptr); |
652 | assert(err == paNoError); | 655 | |
656 | if (err != paNoError) { | ||
657 | return EXIT_FAILURE; | ||
658 | } | ||
653 | 659 | ||
654 | err = Pa_StartStream(adout); | 660 | err = Pa_StartStream(adout); |
655 | assert(err == paNoError); | 661 | |
662 | if (err != paNoError) { | ||
663 | return EXIT_FAILURE; | ||
664 | } | ||
656 | 665 | ||
657 | // toxav_audio_bit_rate_set(AliceAV, 0, 64, false, nullptr); | 666 | // toxav_audio_bit_rate_set(AliceAV, 0, 64, false, nullptr); |
658 | 667 | ||
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index b2f2e625..682b962f 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -574,7 +574,9 @@ int pack_nodes(uint8_t *data, uint16_t length, const Node_format *nodes, uint16_ | |||
574 | memcpy(data + packed_length, nodes[i].public_key, CRYPTO_PUBLIC_KEY_SIZE); | 574 | memcpy(data + packed_length, nodes[i].public_key, CRYPTO_PUBLIC_KEY_SIZE); |
575 | packed_length += CRYPTO_PUBLIC_KEY_SIZE; | 575 | packed_length += CRYPTO_PUBLIC_KEY_SIZE; |
576 | 576 | ||
577 | #ifndef NDEBUG | ||
577 | const uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; | 578 | const uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; |
579 | #endif | ||
578 | assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6); | 580 | assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6); |
579 | } | 581 | } |
580 | 582 | ||
@@ -610,7 +612,9 @@ int unpack_nodes(Node_format *nodes, uint16_t max_num_nodes, uint16_t *processed | |||
610 | len_processed += CRYPTO_PUBLIC_KEY_SIZE; | 612 | len_processed += CRYPTO_PUBLIC_KEY_SIZE; |
611 | ++num; | 613 | ++num; |
612 | 614 | ||
615 | #ifndef NDEBUG | ||
613 | const uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; | 616 | const uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; |
617 | #endif | ||
614 | assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6); | 618 | assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6); |
615 | } | 619 | } |
616 | 620 | ||
diff --git a/toxcore/tox.c b/toxcore/tox.c index 203a6550..558fe28a 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c | |||
@@ -1013,7 +1013,7 @@ bool tox_friend_get_status_message(const Tox *tox, uint32_t friend_number, uint8 | |||
1013 | { | 1013 | { |
1014 | if (!status_message) { | 1014 | if (!status_message) { |
1015 | SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_NULL); | 1015 | SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_NULL); |
1016 | return 0; | 1016 | return false; |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | const Messenger *const m = tox->m; | 1019 | const Messenger *const m = tox->m; |
@@ -1021,14 +1021,14 @@ bool tox_friend_get_status_message(const Tox *tox, uint32_t friend_number, uint8 | |||
1021 | 1021 | ||
1022 | if (size == -1) { | 1022 | if (size == -1) { |
1023 | SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_FRIEND_NOT_FOUND); | 1023 | SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_FRIEND_NOT_FOUND); |
1024 | return 0; | 1024 | return false; |
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | const int ret = m_copy_statusmessage(m, friend_number, status_message, size); | 1027 | const int ret = m_copy_statusmessage(m, friend_number, status_message, size); |
1028 | assert(ret == size && "concurrency problem: friend status message changed"); | 1028 | assert(ret == size && "concurrency problem: friend status message changed"); |
1029 | 1029 | ||
1030 | SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_OK); | 1030 | SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_OK); |
1031 | return 1; | 1031 | return ret == size; |
1032 | } | 1032 | } |
1033 | 1033 | ||
1034 | void tox_callback_friend_status_message(Tox *tox, tox_friend_status_message_cb *callback) | 1034 | void tox_callback_friend_status_message(Tox *tox, tox_friend_status_message_cb *callback) |