[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 49/49] qtest: Include system headers before user h
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL v2 49/49] qtest: Include system headers before user headers |
Date: |
Mon, 17 Feb 2014 23:24:59 +0100 |
From: Stefan Hajnoczi <address@hidden>
It is dangerous to include user headers before system headers since user
macros can affect system headers.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
tests/endianness-test.c | 2 +-
tests/fw_cfg-test.c | 7 +++----
tests/i440fx-test.c | 11 +++++------
tests/m48t59-test.c | 3 ++-
tests/qom-test.c | 3 ++-
tests/rtc-test.c | 5 +++--
tests/tmp105-test.c | 5 +++--
7 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/tests/endianness-test.c b/tests/endianness-test.c
index 646df7d..92e17d2 100644
--- a/tests/endianness-test.c
+++ b/tests/endianness-test.c
@@ -10,7 +10,6 @@
* See the COPYING file in the top-level directory.
*
*/
-#include "libqtest.h"
#include <glib.h>
#include <stdio.h>
@@ -18,6 +17,7 @@
#include <stdlib.h>
#include <unistd.h>
+#include "libqtest.h"
#include "qemu/bswap.h"
typedef struct TestCase TestCase;
diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c
index e4f355c..5c8f8d6 100644
--- a/tests/fw_cfg-test.c
+++ b/tests/fw_cfg-test.c
@@ -10,15 +10,14 @@
* See the COPYING file in the top-level directory.
*/
-#define NO_QEMU_PROTOS
+#include <string.h>
+#include <glib.h>
#include "libqtest.h"
+#define NO_QEMU_PROTOS
#include "hw/nvram/fw_cfg.h"
#include "libqos/fw_cfg.h"
-#include <string.h>
-#include <glib.h>
-
static uint64_t ram_size = 128 << 20;
static uint16_t nb_cpus = 1;
static uint16_t max_cpus = 1;
diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
index fa3e3d6..e398b83 100644
--- a/tests/i440fx-test.c
+++ b/tests/i440fx-test.c
@@ -12,12 +12,6 @@
* See the COPYING file in the top-level directory.
*/
-#include "libqos/pci.h"
-#include "libqos/pci-pc.h"
-#include "libqtest.h"
-
-#include "hw/pci/pci_regs.h"
-
#include <glib.h>
#include <string.h>
#include <stdio.h>
@@ -26,6 +20,11 @@
#include <sys/mman.h>
#include <stdlib.h>
+#include "libqtest.h"
+#include "libqos/pci.h"
+#include "libqos/pci-pc.h"
+#include "hw/pci/pci_regs.h"
+
#define BROKEN 1
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
diff --git a/tests/m48t59-test.c b/tests/m48t59-test.c
index 6abc4c8..71b4f28 100644
--- a/tests/m48t59-test.c
+++ b/tests/m48t59-test.c
@@ -11,7 +11,6 @@
* See the COPYING file in the top-level directory.
*
*/
-#include "libqtest.h"
#include <glib.h>
#include <stdio.h>
@@ -19,6 +18,8 @@
#include <stdlib.h>
#include <unistd.h>
+#include "libqtest.h"
+
#define RTC_SECONDS 0x9
#define RTC_MINUTES 0xa
#define RTC_HOURS 0xb
diff --git a/tests/qom-test.c b/tests/qom-test.c
index 3316a11..b6671fb 100644
--- a/tests/qom-test.c
+++ b/tests/qom-test.c
@@ -6,10 +6,11 @@
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/
-#include "libqtest.h"
#include <glib.h>
#include <string.h>
+
+#include "libqtest.h"
#include "qemu/osdep.h"
#include "qapi/qmp/types.h"
diff --git a/tests/rtc-test.c b/tests/rtc-test.c
index f1b123f..4243624 100644
--- a/tests/rtc-test.c
+++ b/tests/rtc-test.c
@@ -10,8 +10,6 @@
* See the COPYING file in the top-level directory.
*
*/
-#include "libqtest.h"
-#include "hw/timer/mc146818rtc_regs.h"
#include <glib.h>
#include <stdio.h>
@@ -19,6 +17,9 @@
#include <stdlib.h>
#include <unistd.h>
+#include "libqtest.h"
+#include "hw/timer/mc146818rtc_regs.h"
+
static uint8_t base = 0x70;
static int bcd2dec(int value)
diff --git a/tests/tmp105-test.c b/tests/tmp105-test.c
index 5ac48e2..0834219 100644
--- a/tests/tmp105-test.c
+++ b/tests/tmp105-test.c
@@ -6,12 +6,13 @@
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/
+
+#include <glib.h>
+
#include "libqtest.h"
#include "libqos/i2c.h"
#include "hw/misc/tmp105_regs.h"
-#include <glib.h>
-
#define OMAP2_I2C_1_BASE 0x48070000
#define N8X0_ADDR 0x48
--
1.8.4.5
- [Qemu-devel] [PULL v2 38/49] qdev: Legacy properties are now read-only, (continued)
- [Qemu-devel] [PULL v2 38/49] qdev: Legacy properties are now read-only, Andreas Färber, 2014/02/17
- [Qemu-devel] [PULL v2 41/49] qapi: Add human mode to StringOutputVisitor, Andreas Färber, 2014/02/17
- [Qemu-devel] [PULL v2 42/49] qdev: Use human mode in "info qtree", Andreas Färber, 2014/02/17
- [Qemu-devel] [PULL v2 43/49] qdev: Remove most legacy printers, Andreas Färber, 2014/02/17
- [Qemu-devel] [PULL v2 46/49] qdev: Add enum property types to QAPI schema, Andreas Färber, 2014/02/17
- [Qemu-devel] [PULL v2 44/49] qdev: Remove hex8/32/64 property types, Andreas Färber, 2014/02/17
- [Qemu-devel] [PULL v2 47/49] qdev: Use QAPI type names for properties, Andreas Färber, 2014/02/17
- [Qemu-devel] [PULL v2 48/49] qapi: Refine human printing of sizes, Andreas Färber, 2014/02/17
- [Qemu-devel] [PULL v2 49/49] qtest: Include system headers before user headers,
Andreas Färber <=
- [Qemu-devel] [PULL v2 45/49] block: Handle "rechs" and "large" translation options, Andreas Färber, 2014/02/17
- Re: [Qemu-devel] [PULL v2 00/49] QOM devices patch queue 2014-02-17, Peter Maydell, 2014/02/20