From patchwork Sat Feb 8 10:41:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 318408 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 83AF42C00A4 for ; Sat, 8 Feb 2014 21:42:48 +1100 (EST) Received: from localhost ([::1]:46049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WC5N0-00080o-A9 for incoming@patchwork.ozlabs.org; Sat, 08 Feb 2014 05:42:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WC5MY-0007qi-Ls for qemu-devel@nongnu.org; Sat, 08 Feb 2014 05:42:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WC5MO-0006xv-5H for qemu-devel@nongnu.org; Sat, 08 Feb 2014 05:42:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WC5MN-0006xr-U2 for qemu-devel@nongnu.org; Sat, 08 Feb 2014 05:42:08 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s18Ag7Ej011463 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 8 Feb 2014 05:42:07 -0500 Received: from localhost (ovpn-112-22.ams2.redhat.com [10.36.112.22]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s18Ag6oR016766; Sat, 8 Feb 2014 05:42:06 -0500 From: Stefan Hajnoczi To: Date: Sat, 8 Feb 2014 11:41:07 +0100 Message-Id: <1391856067-16860-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Andreas Faerber Subject: [Qemu-devel] [PATCH] qtest: include system headers before user headers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org It is dangerous to include user headers before system headers since user macros can affect system headers. Signed-off-by: Stefan Hajnoczi --- 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 #include @@ -18,6 +17,7 @@ #include #include +#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 +#include #include "libqtest.h" +#define NO_QEMU_PROTOS #include "hw/nvram/fw_cfg.h" #include "libqos/fw_cfg.h" -#include -#include - 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 #include #include @@ -26,6 +20,11 @@ #include #include +#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 #include @@ -19,6 +18,8 @@ #include #include +#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 5e5af7a..c979a89 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 #include + +#include "libqtest.h" #include "qemu/osdep.h" static void test_nop(gconstpointer data) 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 #include @@ -19,6 +17,9 @@ #include #include +#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 + #include "libqtest.h" #include "libqos/i2c.h" #include "hw/misc/tmp105_regs.h" -#include - #define OMAP2_I2C_1_BASE 0x48070000 #define N8X0_ADDR 0x48