[libvirt] [PATCH 09/19] conf: storage: use #pragma once in headers

Jonathon Jongsma jjongsma at redhat.com
Fri Jun 7 20:20:20 UTC 2019


Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
---
 src/conf/storage_adapter_conf.h | 11 ++++-----
 src/conf/storage_capabilities.h |  8 ++-----
 src/conf/storage_conf.h         | 41 +++++++++++++++------------------
 src/conf/storage_event.h        | 11 ++++-----
 src/conf/virstorageobj.h        | 11 ++++-----
 5 files changed, 33 insertions(+), 49 deletions(-)

diff --git a/src/conf/storage_adapter_conf.h b/src/conf/storage_adapter_conf.h
index 81d73ea889..4c7da7c8d9 100644
--- a/src/conf/storage_adapter_conf.h
+++ b/src/conf/storage_adapter_conf.h
@@ -17,12 +17,11 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_STORAGE_ADAPTER_CONF_H
-# define LIBVIRT_STORAGE_ADAPTER_CONF_H
+#pragma once
 
-# include "virpci.h"
-# include "virxml.h"
-# include "virenum.h"
+#include "virpci.h"
+#include "virxml.h"
+#include "virenum.h"
 
 
 typedef enum {
@@ -81,5 +80,3 @@ virStorageAdapterValidate(virStorageAdapterPtr adapter);
 void
 virStorageAdapterFormat(virBufferPtr buf,
                         virStorageAdapterPtr adapter);
-
-#endif /* LIBVIRT_STORAGE_ADAPTER_CONF_H */
diff --git a/src/conf/storage_capabilities.h b/src/conf/storage_capabilities.h
index daeb496909..948e5bed5b 100644
--- a/src/conf/storage_capabilities.h
+++ b/src/conf/storage_capabilities.h
@@ -18,10 +18,9 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_STORAGE_CAPABILITIES_H
-# define LIBVIRT_STORAGE_CAPABILITIES_H
+#pragma once
 
-# include "internal.h"
+#include "internal.h"
 
 typedef struct _virStoragePoolCaps virStoragePoolCaps;
 typedef virStoragePoolCaps *virStoragePoolCapsPtr;
@@ -36,6 +35,3 @@ virStoragePoolCapsNew(virCapsPtr driverCaps);
 
 char *
 virStoragePoolCapsFormat(virStoragePoolCapsPtr const caps);
-
-
-#endif /* LIBVIRT_STORAGE_CAPABILITIES_H */
diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h
index 6e4f7c689a..338e70244d 100644
--- a/src/conf/storage_conf.h
+++ b/src/conf/storage_conf.h
@@ -19,21 +19,20 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_STORAGE_CONF_H
-# define LIBVIRT_STORAGE_CONF_H
-
-# include "internal.h"
-# include "virstorageencryption.h"
-# include "virstoragefile.h"
-# include "virbitmap.h"
-# include "virthread.h"
-# include "device_conf.h"
-# include "object_event.h"
-# include "storage_adapter_conf.h"
-# include "virautoclean.h"
-# include "virenum.h"
-
-# include <libxml/tree.h>
+#pragma once
+
+#include "internal.h"
+#include "virstorageencryption.h"
+#include "virstoragefile.h"
+#include "virbitmap.h"
+#include "virthread.h"
+#include "device_conf.h"
+#include "object_event.h"
+#include "storage_adapter_conf.h"
+#include "virautoclean.h"
+#include "virenum.h"
+
+#include <libxml/tree.h>
 
 /* Various callbacks needed to parse/create Storage Pool XML's using
  * a private namespace */
@@ -460,19 +459,19 @@ typedef enum {
 } virStoragePartedFsType;
 VIR_ENUM_DECL(virStoragePartedFs);
 
-# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ACTIVE \
+#define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ACTIVE \
                 (VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE | \
                  VIR_CONNECT_LIST_STORAGE_POOLS_INACTIVE)
 
-# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_PERSISTENT \
+#define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_PERSISTENT \
                 (VIR_CONNECT_LIST_STORAGE_POOLS_PERSISTENT | \
                  VIR_CONNECT_LIST_STORAGE_POOLS_TRANSIENT)
 
-# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_AUTOSTART \
+#define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_AUTOSTART \
                 (VIR_CONNECT_LIST_STORAGE_POOLS_AUTOSTART | \
                  VIR_CONNECT_LIST_STORAGE_POOLS_NO_AUTOSTART)
 
-# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE \
+#define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE \
                 (VIR_CONNECT_LIST_STORAGE_POOLS_DIR      | \
                  VIR_CONNECT_LIST_STORAGE_POOLS_FS       | \
                  VIR_CONNECT_LIST_STORAGE_POOLS_NETFS    | \
@@ -487,7 +486,7 @@ VIR_ENUM_DECL(virStoragePartedFs);
                  VIR_CONNECT_LIST_STORAGE_POOLS_ZFS      | \
                  VIR_CONNECT_LIST_STORAGE_POOLS_VSTORAGE)
 
-# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ALL \
+#define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ALL \
                 (VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ACTIVE     | \
                  VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_PERSISTENT | \
                  VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_AUTOSTART  | \
@@ -496,5 +495,3 @@ VIR_ENUM_DECL(virStoragePartedFs);
 VIR_DEFINE_AUTOPTR_FUNC(virStoragePoolSource, virStoragePoolSourceFree);
 VIR_DEFINE_AUTOPTR_FUNC(virStoragePoolDef, virStoragePoolDefFree);
 VIR_DEFINE_AUTOPTR_FUNC(virStorageVolDef, virStorageVolDefFree);
-
-#endif /* LIBVIRT_STORAGE_CONF_H */
diff --git a/src/conf/storage_event.h b/src/conf/storage_event.h
index fd6c10969c..3e67ad5ccf 100644
--- a/src/conf/storage_event.h
+++ b/src/conf/storage_event.h
@@ -20,12 +20,11 @@
  * <http://www.gnu.org/licenses/>.
 */
 
-#ifndef LIBVIRT_STORAGE_EVENT_H
-# define LIBVIRT_STORAGE_EVENT_H
+#pragma once
 
-# include "internal.h"
-# include "object_event.h"
-# include "object_event_private.h"
+#include "internal.h"
+#include "object_event.h"
+#include "object_event_private.h"
 
 int
 virStoragePoolEventStateRegisterID(virConnectPtr conn,
@@ -60,5 +59,3 @@ virStoragePoolEventLifecycleNew(const char *name,
 virObjectEventPtr
 virStoragePoolEventRefreshNew(const char *name,
                               const unsigned char *uuid);
-
-#endif /* LIBVIRT_STORAGE_EVENT_H */
diff --git a/src/conf/virstorageobj.h b/src/conf/virstorageobj.h
index c41d4c16ad..92d229f9b4 100644
--- a/src/conf/virstorageobj.h
+++ b/src/conf/virstorageobj.h
@@ -17,14 +17,13 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_VIRSTORAGEOBJ_H
-# define LIBVIRT_VIRSTORAGEOBJ_H
+#pragma once
 
-# include "internal.h"
+#include "internal.h"
 
-# include "storage_conf.h"
+#include "storage_conf.h"
 
-# include "capabilities.h"
+#include "capabilities.h"
 
 typedef struct _virStoragePoolObj virStoragePoolObj;
 typedef virStoragePoolObj *virStoragePoolObjPtr;
@@ -256,5 +255,3 @@ virStoragePoolObjListExport(virConnectPtr conn,
                             virStoragePoolPtr **pools,
                             virStoragePoolObjListFilter filter,
                             unsigned int flags);
-
-#endif /* LIBVIRT_VIRSTORAGEOBJ_H */
-- 
2.20.1




More information about the libvir-list mailing list