From a0372590557f5390adfd4f5b0b934e32ed51a773 Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Fri, 7 Jun 2019 15:20:24 -0500 Subject: [PATCH] src/esx: use #pragma once in headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonathon Jongsma Reviewed-by: Ján Tomko Signed-off-by: Ján Tomko --- src/esx/esx_driver.h | 5 +--- src/esx/esx_interface_driver.h | 7 ++---- src/esx/esx_network_driver.h | 7 ++---- src/esx/esx_private.h | 15 +++++------- src/esx/esx_storage_backend_iscsi.h | 7 ++---- src/esx/esx_storage_backend_vmfs.h | 7 ++---- src/esx/esx_storage_driver.h | 7 ++---- src/esx/esx_stream.h | 9 +++---- src/esx/esx_util.h | 13 ++++------ src/esx/esx_vi.h | 37 +++++++++++++---------------- src/esx/esx_vi_methods.h | 11 ++++----- src/esx/esx_vi_types.h | 13 ++++------ 12 files changed, 51 insertions(+), 87 deletions(-) diff --git a/src/esx/esx_driver.h b/src/esx/esx_driver.h index 6c8f32c9d6..f37fec4867 100644 --- a/src/esx/esx_driver.h +++ b/src/esx/esx_driver.h @@ -20,9 +20,6 @@ * */ -#ifndef LIBVIRT_ESX_DRIVER_H -# define LIBVIRT_ESX_DRIVER_H +#pragma once int esxRegister(void); - -#endif /* LIBVIRT_ESX_DRIVER_H */ diff --git a/src/esx/esx_interface_driver.h b/src/esx/esx_interface_driver.h index 20e4fe60d0..014e9d06d4 100644 --- a/src/esx/esx_interface_driver.h +++ b/src/esx/esx_interface_driver.h @@ -20,11 +20,8 @@ * */ -#ifndef LIBVIRT_ESX_INTERFACE_DRIVER_H -# define LIBVIRT_ESX_INTERFACE_DRIVER_H +#pragma once -# include "driver.h" +#include "driver.h" extern virInterfaceDriver esxInterfaceDriver; - -#endif /* LIBVIRT_ESX_INTERFACE_DRIVER_H */ diff --git a/src/esx/esx_network_driver.h b/src/esx/esx_network_driver.h index c977a1abcf..b15e160c69 100644 --- a/src/esx/esx_network_driver.h +++ b/src/esx/esx_network_driver.h @@ -20,11 +20,8 @@ * */ -#ifndef LIBVIRT_ESX_NETWORK_DRIVER_H -# define LIBVIRT_ESX_NETWORK_DRIVER_H +#pragma once -# include "driver.h" +#include "driver.h" extern virNetworkDriver esxNetworkDriver; - -#endif /* LIBVIRT_ESX_NETWORK_DRIVER_H */ diff --git a/src/esx/esx_private.h b/src/esx/esx_private.h index abb4567e8f..15edab4aa1 100644 --- a/src/esx/esx_private.h +++ b/src/esx/esx_private.h @@ -19,14 +19,13 @@ * */ -#ifndef LIBVIRT_ESX_PRIVATE_H -# define LIBVIRT_ESX_PRIVATE_H +#pragma once -# include "internal.h" -# include "virerror.h" -# include "capabilities.h" -# include "domain_conf.h" -# include "esx_vi.h" +#include "internal.h" +#include "virerror.h" +#include "capabilities.h" +#include "domain_conf.h" +#include "esx_vi.h" typedef struct _esxPrivate { esxVI_Context *primary; /* points to host or vCenter */ @@ -41,5 +40,3 @@ typedef struct _esxPrivate { esxVI_Boolean supportsScreenshot; int32_t usedCpuTimeCounterId; } esxPrivate; - -#endif /* LIBVIRT_ESX_PRIVATE_H */ diff --git a/src/esx/esx_storage_backend_iscsi.h b/src/esx/esx_storage_backend_iscsi.h index 09ca4ac813..7d62060122 100644 --- a/src/esx/esx_storage_backend_iscsi.h +++ b/src/esx/esx_storage_backend_iscsi.h @@ -19,11 +19,8 @@ * */ -#ifndef LIBVIRT_ESX_STORAGE_BACKEND_ISCSI_H -# define LIBVIRT_ESX_STORAGE_BACKEND_ISCSI_H +#pragma once -# include "driver.h" +#include "driver.h" extern virStorageDriver esxStorageBackendISCSI; - -#endif /* LIBVIRT_ESX_STORAGE_BACKEND_ISCSI_H */ diff --git a/src/esx/esx_storage_backend_vmfs.h b/src/esx/esx_storage_backend_vmfs.h index 67b8af38cc..153996d6c6 100644 --- a/src/esx/esx_storage_backend_vmfs.h +++ b/src/esx/esx_storage_backend_vmfs.h @@ -20,11 +20,8 @@ * */ -#ifndef LIBVIRT_ESX_STORAGE_BACKEND_VMFS_H -# define LIBVIRT_ESX_STORAGE_BACKEND_VMFS_H +#pragma once -# include "driver.h" +#include "driver.h" extern virStorageDriver esxStorageBackendVMFS; - -#endif /* LIBVIRT_ESX_STORAGE_BACKEND_VMFS_H */ diff --git a/src/esx/esx_storage_driver.h b/src/esx/esx_storage_driver.h index 73110cf8e6..3c487355c8 100644 --- a/src/esx/esx_storage_driver.h +++ b/src/esx/esx_storage_driver.h @@ -20,11 +20,8 @@ * */ -#ifndef LIBVIRT_ESX_STORAGE_DRIVER_H -# define LIBVIRT_ESX_STORAGE_DRIVER_H +#pragma once -# include "driver.h" +#include "driver.h" extern virStorageDriver esxStorageDriver; - -#endif /* LIBVIRT_ESX_STORAGE_DRIVER_H */ diff --git a/src/esx/esx_stream.h b/src/esx/esx_stream.h index f00b4443aa..29ca014c67 100644 --- a/src/esx/esx_stream.h +++ b/src/esx/esx_stream.h @@ -19,14 +19,11 @@ * */ -#ifndef LIBVIRT_ESX_STREAM_H -# define LIBVIRT_ESX_STREAM_H +#pragma once -# include "internal.h" -# include "esx_private.h" +#include "internal.h" +#include "esx_private.h" int esxStreamOpenUpload(virStreamPtr stream, esxPrivate *priv, const char *url); int esxStreamOpenDownload(virStreamPtr stream, esxPrivate *priv, const char *url, unsigned long long offset, unsigned long long length); - -#endif /* LIBVIRT_ESX_STREAM_H */ diff --git a/src/esx/esx_util.h b/src/esx/esx_util.h index 163626688e..d80093dcb5 100644 --- a/src/esx/esx_util.h +++ b/src/esx/esx_util.h @@ -19,14 +19,13 @@ * */ -#ifndef LIBVIRT_ESX_UTIL_H -# define LIBVIRT_ESX_UTIL_H +#pragma once -# include -# include "internal.h" -# include "viruri.h" +#include +#include "internal.h" +#include "viruri.h" -# define ESX_VI_CHECK_ARG_LIST(val) \ +#define ESX_VI_CHECK_ARG_LIST(val) \ do { \ if (!val || *val) { \ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); \ @@ -69,5 +68,3 @@ void esxUtil_ReplaceSpecialWindowsPathChars(char *string); char *esxUtil_EscapeDatastoreItem(const char *string); char *esxUtil_EscapeForXml(const char *string); - -#endif /* LIBVIRT_ESX_UTIL_H */ diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h index ff2abfb034..bff2782ba1 100644 --- a/src/esx/esx_vi.h +++ b/src/esx/esx_vi.h @@ -20,25 +20,24 @@ * */ -#ifndef LIBVIRT_ESX_VI_H -# define LIBVIRT_ESX_VI_H +#pragma once -# include -# include -# include +#include +#include +#include -# include "internal.h" -# include "virerror.h" -# include "datatypes.h" -# include "esx_vi_types.h" -# include "esx_util.h" +#include "internal.h" +#include "virerror.h" +#include "datatypes.h" +#include "esx_vi_types.h" +#include "esx_util.h" /* curl_multi_wait was added in libcurl 7.28.0, emulate it on older versions */ -# define ESX_EMULATE_CURL_MULTI_WAIT (LIBCURL_VERSION_NUM < 0x071C00) +#define ESX_EMULATE_CURL_MULTI_WAIT (LIBCURL_VERSION_NUM < 0x071C00) -# define ESX_VI__SOAP__REQUEST_HEADER \ +#define ESX_VI__SOAP__REQUEST_HEADER \ "\n" \ "\n" \ "" -# define ESV_VI__XML_TAG__OPEN(_buffer, _element, _type) \ +#define ESV_VI__XML_TAG__OPEN(_buffer, _element, _type) \ do { \ virBufferAddLit(_buffer, "<"); \ virBufferAdd(_buffer, _element, -1); \ @@ -66,7 +65,7 @@ -# define ESV_VI__XML_TAG__CLOSE(_buffer, _element) \ +#define ESV_VI__XML_TAG__CLOSE(_buffer, _element) \ do { \ virBufferAddLit(_buffer, "