diff options
author | Eric Blake <eblake@redhat.com> | 2021-01-13 16:10:12 -0600 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2021-01-28 08:08:45 +0100 |
commit | c3033fd372fdaf5b89190136a74b3d78880b85d6 (patch) | |
tree | 6c2464ae3f51b43702c448606acb3a6c21b6b634 /tests/test-string-output-visitor.c | |
parent | dc13f40c6ba291e31d09053815c230ed88c8921f (diff) | |
download | qemu-c3033fd372fdaf5b89190136a74b3d78880b85d6.zip qemu-c3033fd372fdaf5b89190136a74b3d78880b85d6.tar.gz qemu-c3033fd372fdaf5b89190136a74b3d78880b85d6.tar.bz2 |
qapi: Use QAPI_LIST_APPEND in trivial cases
The easiest spots to use QAPI_LIST_APPEND are where we already have an
obvious pointer to the tail of a list. While at it, consistently use
the variable name 'tail' for that purpose.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210113221013.390592-5-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/test-string-output-visitor.c')
-rw-r--r-- | tests/test-string-output-visitor.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/test-string-output-visitor.c b/tests/test-string-output-visitor.c index 0dae04b..e2bedc5 100644 --- a/tests/test-string-output-visitor.c +++ b/tests/test-string-output-visitor.c @@ -88,15 +88,13 @@ static void test_visitor_out_intList(TestOutputVisitorData *data, { int64_t value[] = {0, 1, 9, 10, 16, 15, 14, 3, 4, 5, 6, 11, 12, 13, 21, 22, INT64_MAX - 1, INT64_MAX}; - intList *list = NULL, **tmp = &list; + intList *list = NULL, **tail = &list; int i; Error *err = NULL; char *str; for (i = 0; i < ARRAY_SIZE(value); i++) { - *tmp = g_malloc0(sizeof(**tmp)); - (*tmp)->value = value[i]; - tmp = &(*tmp)->next; + QAPI_LIST_APPEND(tail, value[i]); } visit_type_intList(data->ov, NULL, &list, &err); |