From c644ef76810f8db61bce3f52d36a1a6a25e47683 Mon Sep 17 00:00:00 2001 From: "zugz (tox)" Date: Fri, 28 Feb 2020 00:00:00 +0000 Subject: use -1 rather than ~0 in unsigned integer types Using ~0 involves a bitwise operation on int, so depends on the internal representation of signed integers. --- auto_tests/toxav_basic_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'auto_tests/toxav_basic_test.c') diff --git a/auto_tests/toxav_basic_test.c b/auto_tests/toxav_basic_test.c index 5c6daefa..89c2918a 100644 --- a/auto_tests/toxav_basic_test.c +++ b/auto_tests/toxav_basic_test.c @@ -88,7 +88,7 @@ static void t_accept_friend_request_cb(Tox *m, const uint8_t *public_key, const void *userdata) { if (length == 7 && memcmp("gentoo", data, 7) == 0) { - ck_assert(tox_friend_add_norequest(m, public_key, nullptr) != (uint32_t) ~0); + ck_assert(tox_friend_add_norequest(m, public_key, nullptr) != (uint32_t) -1); } } @@ -191,7 +191,7 @@ static void test_av_flows(void) tox_bootstrap(Alice, "localhost", dht_port, dht_key, nullptr); tox_bootstrap(Bob, "localhost", dht_port, dht_key, nullptr); - ck_assert(tox_friend_add(Bob, address, (const uint8_t *)"gentoo", 7, nullptr) != (uint32_t) ~0); + ck_assert(tox_friend_add(Bob, address, (const uint8_t *)"gentoo", 7, nullptr) != (uint32_t) -1); uint8_t off = 1; -- cgit v1.2.3