From c64a8d98f6a6f29f69f48a50e4ee16409127aa8c Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Tue, 18 Jun 2019 11:13:06 -0500 Subject: [PATCH] util: xml: 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/util/virxml.h | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/util/virxml.h b/src/util/virxml.h index 38031b62c5..6208977dd1 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -18,18 +18,17 @@ * . */ -#ifndef LIBVIRT_VIRXML_H -# define LIBVIRT_VIRXML_H +#pragma once -# include "internal.h" +#include "internal.h" -# include -# include -# include -# include +#include +#include +#include +#include -# include "virbuffer.h" -# include "virautoclean.h" +#include "virbuffer.h" +#include "virautoclean.h" int virXPathBoolean(const char *xpath, xmlXPathContextPtr ctxt); @@ -96,7 +95,7 @@ const char *virXMLPickShellSafeComment(const char *str1, const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParse(filename, xmlStr, url) \ +#define virXMLParse(filename, xmlStr, url) \ virXMLParseHelper(VIR_FROM_THIS, filename, xmlStr, url, NULL) /** @@ -108,7 +107,7 @@ const char *virXMLPickShellSafeComment(const char *str1, const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParseString(xmlStr, url) \ +#define virXMLParseString(xmlStr, url) \ virXMLParseHelper(VIR_FROM_THIS, NULL, xmlStr, url, NULL) /** @@ -119,7 +118,7 @@ const char *virXMLPickShellSafeComment(const char *str1, const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParseFile(filename) \ +#define virXMLParseFile(filename) \ virXMLParseHelper(VIR_FROM_THIS, filename, NULL, NULL, NULL) /** @@ -134,7 +133,7 @@ const char *virXMLPickShellSafeComment(const char *str1, const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParseCtxt(filename, xmlStr, url, pctxt) \ +#define virXMLParseCtxt(filename, xmlStr, url, pctxt) \ virXMLParseHelper(VIR_FROM_THIS, filename, xmlStr, url, pctxt) /** @@ -148,7 +147,7 @@ const char *virXMLPickShellSafeComment(const char *str1, const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParseStringCtxt(xmlStr, url, pctxt) \ +#define virXMLParseStringCtxt(xmlStr, url, pctxt) \ virXMLParseHelper(VIR_FROM_THIS, NULL, xmlStr, url, pctxt) /** @@ -161,7 +160,7 @@ const char *virXMLPickShellSafeComment(const char *str1, const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParseFileCtxt(filename, pctxt) \ +#define virXMLParseFileCtxt(filename, pctxt) \ virXMLParseHelper(VIR_FROM_THIS, filename, NULL, NULL, pctxt) int virXMLSaveFile(const char *path, @@ -240,12 +239,10 @@ VIR_DEFINE_AUTOCLEAN_FUNC(virXPathContextNodeSave, virXPathContextNodeRestore); * This macro ensures that when the scope where it's used ends, @ctxt's current * node pointer is reset to the original value when this macro was used. */ -# define VIR_XPATH_NODE_AUTORESTORE(_ctxt) \ +#define VIR_XPATH_NODE_AUTORESTORE(_ctxt) \ VIR_AUTOCLEAN(virXPathContextNodeSave) _ctxt ## CtxtSave = { .ctxt = _ctxt,\ .node = _ctxt->node}; \ ignore_value(&_ctxt ## CtxtSave) VIR_DEFINE_AUTOPTR_FUNC(xmlDoc, xmlFreeDoc); VIR_DEFINE_AUTOPTR_FUNC(xmlXPathContext, xmlXPathFreeContext); - -#endif /* LIBVIRT_VIRXML_H */