diff mbox

[07/15] qapi: Clean up includes

Message ID 1454089805-5470-8-git-send-email-peter.maydell@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Maydell Jan. 29, 2016, 5:49 p.m. UTC
Clean up includes so that osdep.h is included first and headers
which it implies are not included manually.

This commit was created with scripts/clean-includes.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 qapi/opts-visitor.c          | 1 +
 qapi/qapi-dealloc-visitor.c  | 1 +
 qapi/qapi-util.c             | 2 +-
 qapi/qapi-visit-core.c       | 1 +
 qapi/qmp-dispatch.c          | 2 +-
 qapi/qmp-event.c             | 2 +-
 qapi/qmp-input-visitor.c     | 1 +
 qapi/qmp-output-visitor.c    | 1 +
 qapi/qmp-registry.c          | 2 +-
 qapi/string-input-visitor.c  | 1 +
 qapi/string-output-visitor.c | 1 +
 11 files changed, 11 insertions(+), 4 deletions(-)

Comments

Eric Blake Jan. 29, 2016, 6:31 p.m. UTC | #1
On 01/29/2016 10:49 AM, Peter Maydell wrote:
> Clean up includes so that osdep.h is included first and headers
> which it implies are not included manually.
> 
> This commit was created with scripts/clean-includes.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  qapi/opts-visitor.c          | 1 +
>  qapi/qapi-dealloc-visitor.c  | 1 +
>  qapi/qapi-util.c             | 2 +-
>  qapi/qapi-visit-core.c       | 1 +
>  qapi/qmp-dispatch.c          | 2 +-
>  qapi/qmp-event.c             | 2 +-
>  qapi/qmp-input-visitor.c     | 1 +
>  qapi/qmp-output-visitor.c    | 1 +
>  qapi/qmp-registry.c          | 2 +-
>  qapi/string-input-visitor.c  | 1 +
>  qapi/string-output-visitor.c | 1 +
>  11 files changed, 11 insertions(+), 4 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

Hmm - we also have generated qapi files, where the scripts/qapi*.py
files will need to output correct header information.  I'll take a look
at doing that.
Peter Maydell Feb. 8, 2016, 12:30 p.m. UTC | #2
On 29 January 2016 at 18:31, Eric Blake <eblake@redhat.com> wrote:
> Hmm - we also have generated qapi files, where the scripts/qapi*.py
> files will need to output correct header information.  I'll take a look
> at doing that.

Hi Eric; did you get time to look at updating these scripts? I
started working on the "remove unnecessary #includes from .h files"
part of this cleanup, but at the moment that causes all the generated
qapi .c files to fail to build because they don't include osdep.h yet.

thanks
-- PMM
Eric Blake Feb. 8, 2016, 3:38 p.m. UTC | #3
On 02/08/2016 05:30 AM, Peter Maydell wrote:
> On 29 January 2016 at 18:31, Eric Blake <eblake@redhat.com> wrote:
>> Hmm - we also have generated qapi files, where the scripts/qapi*.py
>> files will need to output correct header information.  I'll take a look
>> at doing that.
> 
> Hi Eric; did you get time to look at updating these scripts? I
> started working on the "remove unnecessary #includes from .h files"
> part of this cleanup, but at the moment that causes all the generated
> qapi .c files to fail to build because they don't include osdep.h yet.

Sent now, but I based it on Markus' qapi-next tree. I didn't test if it
would apply directly to master.
diff mbox

Patch

diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
index ef5fb8b..eb7d85b 100644
--- a/qapi/opts-visitor.c
+++ b/qapi/opts-visitor.c
@@ -10,6 +10,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/qmp/qerror.h"
 #include "qapi/opts-visitor.h"
diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index 737deab..9340446 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -11,6 +11,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qapi/dealloc-visitor.h"
 #include "qemu/queue.h"
 #include "qemu-common.h"
diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c
index bcdc94d..8afb12e 100644
--- a/qapi/qapi-util.c
+++ b/qapi/qapi-util.c
@@ -10,8 +10,8 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "qapi/error.h"
 #include "qapi/util.h"
 
 int qapi_enum_parse(const char * const lookup[], const char *buf,
diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
index 6d63e40..8473d3c 100644
--- a/qapi/qapi-visit-core.c
+++ b/qapi/qapi-visit-core.c
@@ -11,6 +11,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/qmp/qobject.h"
 #include "qapi/qmp/qerror.h"
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index f36933d..8f27c34 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -11,11 +11,11 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp/types.h"
 #include "qapi/qmp/dispatch.h"
 #include "qapi/qmp/json-parser.h"
 #include "qapi-types.h"
-#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 
 static QDict *qmp_dispatch_check_obj(const QObject *request, Error **errp)
diff --git a/qapi/qmp-event.c b/qapi/qmp-event.c
index c0e435f..8bba165 100644
--- a/qapi/qmp-event.c
+++ b/qapi/qmp-event.c
@@ -11,7 +11,7 @@ 
  *
  */
 
-#include <inttypes.h>
+#include "qemu/osdep.h"
 
 #include "qemu-common.h"
 #include "qapi/qmp-event.h"
diff --git a/qapi/qmp-input-visitor.c b/qapi/qmp-input-visitor.c
index 932b5f3..edb8bd2 100644
--- a/qapi/qmp-input-visitor.c
+++ b/qapi/qmp-input-visitor.c
@@ -11,6 +11,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp-input-visitor.h"
 #include "qapi/visitor-impl.h"
 #include "qemu/queue.h"
diff --git a/qapi/qmp-output-visitor.c b/qapi/qmp-output-visitor.c
index 29899ac..b064fb5 100644
--- a/qapi/qmp-output-visitor.c
+++ b/qapi/qmp-output-visitor.c
@@ -11,6 +11,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp-output-visitor.h"
 #include "qapi/visitor-impl.h"
 #include "qemu/queue.h"
diff --git a/qapi/qmp-registry.c b/qapi/qmp-registry.c
index 3e4498a..4ebfbcc 100644
--- a/qapi/qmp-registry.c
+++ b/qapi/qmp-registry.c
@@ -12,8 +12,8 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include <glib.h>
-#include <string.h>
 #include "qapi/qmp/dispatch.h"
 
 static QTAILQ_HEAD(QmpCommandList, QmpCommand) qmp_commands =
diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c
index dee780a..8c5ff7e 100644
--- a/qapi/string-input-visitor.c
+++ b/qapi/string-input-visitor.c
@@ -10,6 +10,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/string-input-visitor.h"
 #include "qapi/visitor-impl.h"
diff --git a/qapi/string-output-visitor.c b/qapi/string-output-visitor.c
index b86ce2c..b04cec4 100644
--- a/qapi/string-output-visitor.c
+++ b/qapi/string-output-visitor.c
@@ -10,6 +10,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/string-output-visitor.h"
 #include "qapi/visitor-impl.h"