diff options
author | Markus Armbruster <armbru@redhat.com> | 2018-02-01 12:18:36 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-02-09 13:52:15 +0100 |
commit | 15280c360e54a65e2c7be1a47bfbe41dce1ef986 (patch) | |
tree | c65fa005a5c83631aa6b7d4b83e4e4667b7dad01 /tests | |
parent | 6b67395762a4c8b6ca94364e0a0f616a6470c46a (diff) |
qdict qlist: Make most helper macros functions
The macro expansions of qdict_put_TYPE() and qlist_append_TYPE() need
qbool.h, qnull.h, qnum.h and qstring.h to compile. We include qnull.h
and qnum.h in the headers, but not qbool.h and qstring.h. Works,
because we include those wherever the macros get used.
Open-coding these helpers is of dubious value. Turn them into
functions and drop the includes from the headers.
This cleanup makes the number of objects depending on qapi/qmp/qnum.h
from 4551 (out of 4743) to 46 in my "build everything" tree. For
qapi/qmp/qnull.h, the number drops from 4552 to 21.
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180201111846.21846-10-armbru@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check-qdict.c | 1 | ||||
-rw-r--r-- | tests/check-qjson.c | 2 | ||||
-rw-r--r-- | tests/check-qobject.c | 2 | ||||
-rw-r--r-- | tests/test-qmp-commands.c | 1 | ||||
-rw-r--r-- | tests/test-qmp-event.c | 1 | ||||
-rw-r--r-- | tests/test-qobject-input-visitor.c | 2 | ||||
-rw-r--r-- | tests/test-qobject-output-visitor.c | 2 |
7 files changed, 11 insertions, 0 deletions
diff --git a/tests/check-qdict.c b/tests/check-qdict.c index 35405778cc..1b1173634f 100644 --- a/tests/check-qdict.c +++ b/tests/check-qdict.c @@ -12,6 +12,7 @@ #include "qemu/osdep.h" #include "qapi/qmp/qdict.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "qapi/error.h" #include "qemu-common.h" diff --git a/tests/check-qjson.c b/tests/check-qjson.c index 7881009f1c..26f5d4401e 100644 --- a/tests/check-qjson.c +++ b/tests/check-qjson.c @@ -17,6 +17,8 @@ #include "qapi/qmp/qbool.h" #include "qapi/qmp/qjson.h" #include "qapi/qmp/qlit.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qemu-common.h" static void escaped_string(void) diff --git a/tests/check-qobject.c b/tests/check-qobject.c index 06b9c6ec34..9e1e82045f 100644 --- a/tests/check-qobject.c +++ b/tests/check-qobject.c @@ -9,6 +9,8 @@ #include "qemu/osdep.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "qemu-common.h" diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c index 4794d1a9d8..b5a3d88775 100644 --- a/tests/test-qmp-commands.c +++ b/tests/test-qmp-commands.c @@ -1,6 +1,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qapi/qmp/qdict.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "test-qmp-commands.h" #include "qapi/error.h" diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c index b197dff453..cad94778c7 100644 --- a/tests/test-qmp-event.c +++ b/tests/test-qmp-event.c @@ -18,6 +18,7 @@ #include "test-qapi-event.h" #include "qapi/error.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qobject.h" #include "qapi/qmp/qstring.h" #include "qapi/qmp-event.h" diff --git a/tests/test-qobject-input-visitor.c b/tests/test-qobject-input-visitor.c index 96405991bb..20bf9a5414 100644 --- a/tests/test-qobject-input-visitor.c +++ b/tests/test-qobject-input-visitor.c @@ -18,6 +18,8 @@ #include "qapi/qobject-input-visitor.h" #include "test-qapi-visit.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qjson.h" #include "test-qmp-introspect.h" #include "qmp-introspect.h" diff --git a/tests/test-qobject-output-visitor.c b/tests/test-qobject-output-visitor.c index a0b7fe6add..4a24e12121 100644 --- a/tests/test-qobject-output-visitor.c +++ b/tests/test-qobject-output-visitor.c @@ -17,6 +17,8 @@ #include "qapi/qobject-output-visitor.h" #include "test-qapi-visit.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qjson.h" typedef struct TestOutputVisitorData { |