[PATCH 01/46] src/locking: use #pragma once in headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
---
 src/locking/domain_lock.h          | 11 ++++-------
 src/locking/lock_daemon.h          |  9 +++------
 src/locking/lock_daemon_config.h   |  7 ++-----
 src/locking/lock_daemon_dispatch.h |  7 ++-----
 src/locking/lock_driver.h          | 18 +++++++-----------
 src/locking/lock_driver_lockd.h    |  5 +----
 src/locking/lock_driver_nop.h      |  8 ++------
 src/locking/lock_manager.h         |  9 +++------
 8 files changed, 24 insertions(+), 50 deletions(-)

diff --git a/src/locking/domain_lock.h b/src/locking/domain_lock.h
index 02417b471b..6f197bf08b 100644
--- a/src/locking/domain_lock.h
+++ b/src/locking/domain_lock.h
@@ -19,12 +19,11 @@
  *
  */
 
-#ifndef LIBVIRT_DOMAIN_LOCK_H
-# define LIBVIRT_DOMAIN_LOCK_H
+#pragma once
 
-# include "internal.h"
-# include "domain_conf.h"
-# include "lock_manager.h"
+#include "internal.h"
+#include "domain_conf.h"
+#include "lock_manager.h"
 
 int virDomainLockProcessStart(virLockManagerPluginPtr plugin,
                               const char *uri,
@@ -57,5 +56,3 @@ int virDomainLockLeaseAttach(virLockManagerPluginPtr plugin,
 int virDomainLockLeaseDetach(virLockManagerPluginPtr plugin,
                              virDomainObjPtr dom,
                              virDomainLeaseDefPtr lease);
-
-#endif /* LIBVIRT_DOMAIN_LOCK_H */
diff --git a/src/locking/lock_daemon.h b/src/locking/lock_daemon.h
index 5c7f976ea4..7d30551c32 100644
--- a/src/locking/lock_daemon.h
+++ b/src/locking/lock_daemon.h
@@ -18,11 +18,10 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_LOCK_DAEMON_H
-# define LIBVIRT_LOCK_DAEMON_H
+#pragma once
 
-# include "virlockspace.h"
-# include "virthread.h"
+#include "virlockspace.h"
+#include "virthread.h"
 
 typedef struct _virLockDaemon virLockDaemon;
 typedef virLockDaemon *virLockDaemonPtr;
@@ -50,5 +49,3 @@ int virLockDaemonAddLockSpace(virLockDaemonPtr lockd,
 
 virLockSpacePtr virLockDaemonFindLockSpace(virLockDaemonPtr lockd,
                                            const char *path);
-
-#endif /* LIBVIRT_LOCK_DAEMON_H */
diff --git a/src/locking/lock_daemon_config.h b/src/locking/lock_daemon_config.h
index e820d60268..0f47ab1ed0 100644
--- a/src/locking/lock_daemon_config.h
+++ b/src/locking/lock_daemon_config.h
@@ -19,10 +19,9 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_LOCK_DAEMON_CONFIG_H
-# define LIBVIRT_LOCK_DAEMON_CONFIG_H
+#pragma once
 
-# include "internal.h"
+#include "internal.h"
 
 typedef struct _virLockDaemonConfig virLockDaemonConfig;
 typedef virLockDaemonConfig *virLockDaemonConfigPtr;
@@ -42,5 +41,3 @@ void virLockDaemonConfigFree(virLockDaemonConfigPtr data);
 int virLockDaemonConfigLoadFile(virLockDaemonConfigPtr data,
                                 const char *filename,
                                 bool allow_missing);
-
-#endif /* LIBVIRT_LOCK_DAEMON_CONFIG_H */
diff --git a/src/locking/lock_daemon_dispatch.h b/src/locking/lock_daemon_dispatch.h
index 568a7e0160..d269ba10a8 100644
--- a/src/locking/lock_daemon_dispatch.h
+++ b/src/locking/lock_daemon_dispatch.h
@@ -18,12 +18,9 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_LOCK_DAEMON_DISPATCH_H
-# define LIBVIRT_LOCK_DAEMON_DISPATCH_H
+#pragma once
 
-# include "rpc/virnetserverprogram.h"
+#include "rpc/virnetserverprogram.h"
 
 extern virNetServerProgramProc virLockSpaceProtocolProcs[];
 extern size_t virLockSpaceProtocolNProcs;
-
-#endif /* LIBVIRT_LOCK_DAEMON_DISPATCH_H */
diff --git a/src/locking/lock_driver.h b/src/locking/lock_driver.h
index 50c73a70d4..e53c28ee33 100644
--- a/src/locking/lock_driver.h
+++ b/src/locking/lock_driver.h
@@ -19,11 +19,10 @@
  *
  */
 
-#ifndef LIBVIRT_LOCK_DRIVER_H
-# define LIBVIRT_LOCK_DRIVER_H
+#pragma once
 
-# include "internal.h"
-# include "domain_conf.h"
+#include "internal.h"
+#include "domain_conf.h"
 
 typedef struct _virLockManager virLockManager;
 typedef virLockManager *virLockManagerPtr;
@@ -102,11 +101,11 @@ struct _virLockManagerParam {
  * Changes in minor version denote new compatible API entry points
  * Changes in micro version denote new compatible flags
  */
-# define VIR_LOCK_MANAGER_VERSION_MAJOR 1
-# define VIR_LOCK_MANAGER_VERSION_MINOR 0
-# define VIR_LOCK_MANAGER_VERSION_MICRO 0
+#define VIR_LOCK_MANAGER_VERSION_MAJOR 1
+#define VIR_LOCK_MANAGER_VERSION_MINOR 0
+#define VIR_LOCK_MANAGER_VERSION_MICRO 0
 
-# define VIR_LOCK_MANAGER_VERSION \
+#define VIR_LOCK_MANAGER_VERSION \
     ((VIR_LOCK_MANAGER_VERSION_MAJOR * 1000 * 1000) + \
      (VIR_LOCK_MANAGER_VERSION_MINOR * 1000) + \
      (VIR_LOCK_MANAGER_VERSION_MICRO))
@@ -314,6 +313,3 @@ struct _virLockDriver {
     virLockDriverRelease drvRelease;
     virLockDriverInquire drvInquire;
 };
-
-
-#endif /* LIBVIRT_LOCK_DRIVER_H */
diff --git a/src/locking/lock_driver_lockd.h b/src/locking/lock_driver_lockd.h
index d79d5e738a..b9eaab4831 100644
--- a/src/locking/lock_driver_lockd.h
+++ b/src/locking/lock_driver_lockd.h
@@ -19,12 +19,9 @@
  *
  */
 
-#ifndef LIBVIRT_LOCK_DRIVER_LOCKD_H
-# define LIBVIRT_LOCK_DRIVER_LOCKD_H
+#pragma once
 
 enum virLockSpaceProtocolAcquireResourceFlags {
         VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_SHARED = (1 << 0),
         VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_AUTOCREATE = (1 << 1),
 };
-
-#endif /* LIBVIRT_LOCK_DRIVER_LOCKD_H */
diff --git a/src/locking/lock_driver_nop.h b/src/locking/lock_driver_nop.h
index 2443072e3d..e2525e0bd1 100644
--- a/src/locking/lock_driver_nop.h
+++ b/src/locking/lock_driver_nop.h
@@ -19,12 +19,8 @@
  *
  */
 
-#ifndef LIBVIRT_LOCK_DRIVER_NOP_H
-# define LIBVIRT_LOCK_DRIVER_NOP_H
+#pragma once
 
-# include "lock_driver.h"
+#include "lock_driver.h"
 
 extern virLockDriver virLockDriverNop;
-
-
-#endif /* LIBVIRT_LOCK_DRIVER_NOP_H */
diff --git a/src/locking/lock_manager.h b/src/locking/lock_manager.h
index 71d3909709..4a19f58879 100644
--- a/src/locking/lock_manager.h
+++ b/src/locking/lock_manager.h
@@ -19,11 +19,10 @@
  *
  */
 
-#ifndef LIBVIRT_LOCK_MANAGER_H
-# define LIBVIRT_LOCK_MANAGER_H
+#pragma once
 
-# include "internal.h"
-# include "lock_driver.h"
+#include "internal.h"
+#include "lock_driver.h"
 
 typedef struct _virLockManagerPlugin virLockManagerPlugin;
 typedef virLockManagerPlugin *virLockManagerPluginPtr;
@@ -66,5 +65,3 @@ int virLockManagerInquire(virLockManagerPtr manager,
                           unsigned int flags);
 
 int virLockManagerFree(virLockManagerPtr manager);
-
-#endif /* LIBVIRT_LOCK_MANAGER_H */
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux