Fix some Warnings

vita
Florian Märkl 2 years ago
parent 81984b7d48
commit 6c46920adb
No known key found for this signature in database
GPG Key ID: 125BC8A5A6A1E857

@ -16,7 +16,7 @@ typedef struct drop_record_t
static void drop(uint64_t seq_num, void *elem_user, void *cb_user)
{
DropRecord *record = cb_user;
uint64_t v = (uint64_t)elem_user;
uint64_t v = (uint64_t)(size_t)elem_user;
if(v > DROP_RECORD_MAX)
{
record->failed = true;
@ -58,7 +58,7 @@ static MunitResult test_reorder_queue_16(const MunitParameter params[], void *te
munit_assert_uint64(chiaki_reorder_queue_count(&queue), ==, 0);
munit_assert(!drop_record.failed);
munit_assert_uint64(drop_record.count[0], ==, 0);
munit_assert_uint64((uint64_t)user, ==, 0);
munit_assert_uint64((uint64_t)(size_t)user, ==, 0);
munit_assert_uint64(seq_num, ==, 42);
// push outdated
@ -105,22 +105,22 @@ static MunitResult test_reorder_queue_16(const MunitParameter params[], void *te
pulled = chiaki_reorder_queue_pull(&queue, &seq_num, &user);
munit_assert(pulled);
munit_assert_uint64(seq_num, ==, 44);
munit_assert_uint64((uint64_t)user, ==, 3);
munit_assert_uint64((uint64_t)(size_t)user, ==, 3);
pulled = chiaki_reorder_queue_pull(&queue, &seq_num, &user);
munit_assert(pulled);
munit_assert_uint64(seq_num, ==, 45);
munit_assert_uint64((uint64_t)user, ==, 2);
munit_assert_uint64((uint64_t)(size_t)user, ==, 2);
pulled = chiaki_reorder_queue_pull(&queue, &seq_num, &user);
munit_assert(pulled);
munit_assert_uint64(seq_num, ==, 46);
munit_assert_uint64((uint64_t)user, ==, 1);
munit_assert_uint64((uint64_t)(size_t)user, ==, 1);
pulled = chiaki_reorder_queue_pull(&queue, &seq_num, &user);
munit_assert(pulled);
munit_assert_uint64(seq_num, ==, 47);
munit_assert_uint64((uint64_t)user, ==, 5);
munit_assert_uint64((uint64_t)(size_t)user, ==, 5);
// should be empty now again
pulled = chiaki_reorder_queue_pull(&queue, &seq_num, &user);
@ -142,7 +142,7 @@ static MunitResult test_reorder_queue_16(const MunitParameter params[], void *te
pulled = chiaki_reorder_queue_pull(&queue, &seq_num, &user);
munit_assert(pulled);
munit_assert_uint64(seq_num, ==, 1337);
munit_assert_uint64((uint64_t)user, ==, 6);
munit_assert_uint64((uint64_t)(size_t)user, ==, 6);
munit_assert_uint64(chiaki_reorder_queue_count(&queue), ==, 0);
// same as before, but with an element in the queue that will be dropped
@ -163,7 +163,7 @@ static MunitResult test_reorder_queue_16(const MunitParameter params[], void *te
pulled = chiaki_reorder_queue_pull(&queue, &seq_num, &user);
munit_assert(pulled);
munit_assert_uint64(seq_num, ==, 2000);
munit_assert_uint64((uint64_t)user, ==, 8);
munit_assert_uint64((uint64_t)(size_t)user, ==, 8);
munit_assert_uint64(chiaki_reorder_queue_count(&queue), ==, 0);
chiaki_reorder_queue_fini(&queue);
@ -182,4 +182,4 @@ MunitTest tests_reorder_queue[] = {
NULL
},
{ NULL, NULL, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }
};
};

Loading…
Cancel
Save