From 51ee43aa55ae864686286434ce796519eb70f446 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 9 Aug 2012 15:37:03 -0600 Subject: [PATCH] build: fix PROBE() usage of intptr_t Otherwise, in locations like virobject.c where PROBE is used, for certain configure options, the compiler warns: util/virobject.c:110:1: error: 'intptr_t' undeclared (first use in this function) As long as we are making this header always available, we can clean up several other files. * src/internal.h (includes): Pull in . * src/conf/nwfilter_conf.h: Rely on internal.h. * src/storage/storage_backend.c: Likewise. * src/storage/storage_backend.h: Likewise. * src/util/cgroup.c: Likewise. * src/util/sexpr.h: Likewise. * src/util/virhashcode.h: Likewise. * src/util/virnetdevvportprofile.h: Likewise. * src/util/virnetlink.h: Likewise. * src/util/virrandom.h: Likewise. * src/vbox/vbox_driver.c: Likewise. * src/xenapi/xenapi_driver.c: Likewise. * src/xenapi/xenapi_utils.c: Likewise. * src/xenapi/xenapi_utils.h: Likewise. * src/xenxs/xenxs_private.h: Likewise. * tests/storagebackendsheepdogtest.c: Likewise. --- src/conf/nwfilter_conf.h | 5 +---- src/internal.h | 1 + src/storage/storage_backend.c | 1 - src/storage/storage_backend.h | 3 +-- src/util/cgroup.c | 1 - src/util/sexpr.h | 8 ++------ src/util/virhashcode.h | 1 - src/util/virnetdevvportprofile.h | 4 +--- src/util/virnetlink.h | 2 -- src/util/virrandom.h | 1 - src/vbox/vbox_driver.c | 4 +--- src/xenapi/xenapi_driver.c | 1 - src/xenapi/xenapi_utils.c | 1 - src/xenapi/xenapi_utils.h | 2 +- src/xenxs/xenxs_private.h | 3 +-- tests/storagebackendsheepdogtest.c | 2 -- 16 files changed, 9 insertions(+), 31 deletions(-) diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h index 8b05d04501..ca6bd168af 100644 --- a/src/conf/nwfilter_conf.h +++ b/src/conf/nwfilter_conf.h @@ -2,7 +2,7 @@ * nwfilter_conf.h: network filter XML processing * (derived from storage_conf.h) * - * Copyright (C) 2006-2010 Red Hat, Inc. + * Copyright (C) 2006-2010, 2012 Red Hat, Inc. * Copyright (C) 2006-2008 Daniel P. Berrange * * Copyright (C) 2010 IBM Corporation @@ -26,9 +26,6 @@ #ifndef NWFILTER_CONF_H # define NWFILTER_CONF_H -# include -# include - # include "internal.h" # include "util.h" diff --git a/src/internal.h b/src/internal.h index fd8d190229..300de3ac5c 100644 --- a/src/internal.h +++ b/src/internal.h @@ -9,6 +9,7 @@ # include # include # include +# include # if STATIC_ANALYSIS # undef NDEBUG /* Don't let a prior NDEBUG definition cause trouble. */ diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 4a2109e809..df3833a342 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include diff --git a/src/storage/storage_backend.h b/src/storage/storage_backend.h index bafd6b6c6d..5352f5d257 100644 --- a/src/storage/storage_backend.h +++ b/src/storage/storage_backend.h @@ -1,7 +1,7 @@ /* * storage_backend.h: internal storage driver backend contract * - * Copyright (C) 2007-2010 Red Hat, Inc. + * Copyright (C) 2007-2010, 2012 Red Hat, Inc. * Copyright (C) 2007-2008 Daniel P. Berrange * * This library is free software; you can redistribute it and/or @@ -24,7 +24,6 @@ #ifndef __VIR_STORAGE_BACKEND_H__ # define __VIR_STORAGE_BACKEND_H__ -# include # include "internal.h" # include "storage_conf.h" # include "command.h" diff --git a/src/util/cgroup.c b/src/util/cgroup.c index 6c29c874bf..2256c23af4 100644 --- a/src/util/cgroup.c +++ b/src/util/cgroup.c @@ -24,7 +24,6 @@ #include #include -#include #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R # include #endif diff --git a/src/util/sexpr.h b/src/util/sexpr.h index 8dfd89a1d8..b4b41edb64 100644 --- a/src/util/sexpr.h +++ b/src/util/sexpr.h @@ -1,9 +1,8 @@ /* * sexpr.h : S-Expression interfaces needed to communicate with the Xen Daemon * - * Copyright (C) 2005 - * - * Anthony Liguori + * Copyright (C) 2012 Red Hat, Inc. + * Copyright (C) 2005 Anthony Liguori * * This file is subject to the terms and conditions of the GNU Lesser General * Public License. See the file COPYING.LIB in the main directory of this @@ -16,9 +15,6 @@ # include "internal.h" # include "buf.h" -# include -# include - enum sexpr_type { SEXPR_NIL, SEXPR_CONS, diff --git a/src/util/virhashcode.h b/src/util/virhashcode.h index 2fb7a95bd4..34254b6cf6 100644 --- a/src/util/virhashcode.h +++ b/src/util/virhashcode.h @@ -29,7 +29,6 @@ # define __VIR_HASH_CODE_H__ # include "internal.h" -# include extern uint32_t virHashCodeGen(const void *key, size_t len, uint32_t seed); diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprofile.h index 6cce1bb457..f33da1878d 100644 --- a/src/util/virnetdevvportprofile.h +++ b/src/util/virnetdevvportprofile.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2011 Red Hat, Inc. + * Copyright (C) 2009-2012 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,8 +23,6 @@ #ifndef __VIR_NETDEV_VPORT_PROFILE_H__ # define __VIR_NETDEV_VPORT_PROFILE_H__ -# include - # include "internal.h" # include "uuid.h" # include "util.h" diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h index 1997c8d0e7..5d8337dda2 100644 --- a/src/util/virnetlink.h +++ b/src/util/virnetlink.h @@ -24,8 +24,6 @@ # include "internal.h" # include "virmacaddr.h" -# include - # if defined(__linux__) && defined(HAVE_LIBNL) # include diff --git a/src/util/virrandom.h b/src/util/virrandom.h index 8d3cad7225..29a055dced 100644 --- a/src/util/virrandom.h +++ b/src/util/virrandom.h @@ -23,7 +23,6 @@ # define __VIR_RANDOM_H__ # include "internal.h" -# include uint64_t virRandomBits(int nbits); int virRandomGenerateWWN(char **wwn, const char *virt_type); diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c index b340b7c061..c4037f8ec1 100644 --- a/src/vbox/vbox_driver.c +++ b/src/vbox/vbox_driver.c @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2010-2011 Red Hat, Inc. + * Copyright (C) 2010-2012 Red Hat, Inc. * Copyright (C) 2008-2009 Sun Microsystems, Inc. * * This file is part of a free software library; you can redistribute @@ -29,9 +29,7 @@ #include -#include #include -#include #include "internal.h" diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index 5608de8893..f57449e34d 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -23,7 +23,6 @@ #include #include -#include #include #include #include diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c index 3031a17a5b..d62192a200 100644 --- a/src/xenapi/xenapi_utils.c +++ b/src/xenapi/xenapi_utils.c @@ -24,7 +24,6 @@ #include #include -#include #include #include "internal.h" #include "domain_conf.h" diff --git a/src/xenapi/xenapi_utils.h b/src/xenapi/xenapi_utils.h index 59124464a6..86af07c347 100644 --- a/src/xenapi/xenapi_utils.h +++ b/src/xenapi/xenapi_utils.h @@ -1,5 +1,6 @@ /* * xenapi_utils.h: Xen API driver -- utils header + * Copyright (C) 2012, Red Hat, Inc. * Copyright (C) 2009, 2010 Citrix Ltd. * * This library is free software; you can redistribute it and/or @@ -22,7 +23,6 @@ #ifndef __VIR_XENAPI_UTILS__ # define __VIR_XENAPI_UTILS__ -# include # include # include "internal.h" # include "viruri.h" diff --git a/src/xenxs/xenxs_private.h b/src/xenxs/xenxs_private.h index d0ba59a65b..17b481b83c 100644 --- a/src/xenxs/xenxs_private.h +++ b/src/xenxs/xenxs_private.h @@ -1,8 +1,8 @@ /* * xenxs_private.h: Private definitions for Xen parsing * + * Copyright (C) 2007, 2010, 2012 Red Hat, Inc. * Copyright (C) 2011 Univention GmbH - * Copyright (C) 2007, 2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,7 +27,6 @@ # include "internal.h" -# include # include # include "xen_sxpr.h" diff --git a/tests/storagebackendsheepdogtest.c b/tests/storagebackendsheepdogtest.c index b7b3b35d09..ba5bc36beb 100644 --- a/tests/storagebackendsheepdogtest.c +++ b/tests/storagebackendsheepdogtest.c @@ -25,10 +25,8 @@ #include #include #include -#include #include -#include #include #include "internal.h" -- GitLab