diff options
author | Markus Armbruster <armbru@redhat.com> | 2020-04-15 10:30:44 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2020-04-30 06:51:15 +0200 |
commit | 64594e2bcc9a734bfabfaa8a75e08b4c9d920569 (patch) | |
tree | a502424291b3d9895b753f64c47bfe99dc2d08d3 /include/qapi | |
parent | 648db19685b7030aa558a4ddbd3a8e53d8c9a062 (diff) |
qobject: Clean up QLIST_FOREACH_ENTRY()
QLIST_FOREACH_ENTRY() traverses a tail queue manually. Use
QTAILQ_FIRST() and QTAILQ_NEXT() instead.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200415083048.14339-2-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include/qapi')
-rw-r--r-- | include/qapi/qmp/qlist.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h index 8d2c32ca28..07ecae81e4 100644 --- a/include/qapi/qmp/qlist.h +++ b/include/qapi/qmp/qlist.h @@ -34,10 +34,10 @@ void qlist_append_int(QList *qlist, int64_t value); void qlist_append_null(QList *qlist); void qlist_append_str(QList *qlist, const char *value); -#define QLIST_FOREACH_ENTRY(qlist, var) \ - for ((var) = ((qlist)->head.tqh_first); \ - (var); \ - (var) = ((var)->next.tqe_next)) +#define QLIST_FOREACH_ENTRY(qlist, var) \ + for ((var) = QTAILQ_FIRST(&(qlist)->head); \ + (var); \ + (var) = QTAILQ_NEXT((var), next)) static inline QObject *qlist_entry_obj(const QListEntry *entry) { |