diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-12-06 13:10:34 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-01-11 15:46:55 +0100 |
commit | eae3eb3e185028d6e862db747e3b7397600d6762 (patch) | |
tree | 359a23639a6db7a77407cf8f366564561b970738 /tests | |
parent | 7274f01bb8b81ffe8f13f463b6b0f3b9246c5387 (diff) |
qemu/queue.h: simplify reverse access to QTAILQ
The new definition of QTAILQ does not require passing the headname,
remove it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libqos/malloc.c | 2 | ||||
-rw-r--r-- | tests/test-vmstate.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c index ac05874b0a..f7bae47a08 100644 --- a/tests/libqos/malloc.c +++ b/tests/libqos/malloc.c @@ -104,7 +104,7 @@ static void mlist_coalesce(MemList *head, MemBlock *node) do { merge = 0; - left = QTAILQ_PREV(node, MemList, MLIST_ENTNAME); + left = QTAILQ_PREV(node, MLIST_ENTNAME); right = QTAILQ_NEXT(node, MLIST_ENTNAME); /* clowns to the left of me */ diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index 37a7a93784..0ab29a8216 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -630,7 +630,7 @@ struct TestQtailqElement { typedef struct TestQtailq { int16_t i16; - QTAILQ_HEAD(TestQtailqHead, TestQtailqElement) q; + QTAILQ_HEAD(, TestQtailqElement) q; int32_t i32; } TestQtailq; @@ -735,9 +735,9 @@ static void test_load_q(void) g_assert_cmpint(eof, ==, QEMU_VM_EOF); TestQtailqElement *qele_from = QTAILQ_FIRST(&obj_q.q); - TestQtailqElement *qlast_from = QTAILQ_LAST(&obj_q.q, TestQtailqHead); + TestQtailqElement *qlast_from = QTAILQ_LAST(&obj_q.q); TestQtailqElement *qele_to = QTAILQ_FIRST(&tgt.q); - TestQtailqElement *qlast_to = QTAILQ_LAST(&tgt.q, TestQtailqHead); + TestQtailqElement *qlast_to = QTAILQ_LAST(&tgt.q); while (1) { g_assert_cmpint(qele_to->b, ==, qele_from->b); @@ -755,7 +755,7 @@ static void test_load_q(void) /* clean up */ TestQtailqElement *qele; while (!QTAILQ_EMPTY(&tgt.q)) { - qele = QTAILQ_LAST(&tgt.q, TestQtailqHead); + qele = QTAILQ_LAST(&tgt.q); QTAILQ_REMOVE(&tgt.q, qele, next); free(qele); qele = NULL; |