]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: xml: use g_auto directly for VIR_XPATH_NODE_AUTORESTORE
authorJán Tomko <jtomko@redhat.com>
Tue, 15 Oct 2019 12:47:50 +0000 (14:47 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 16 Oct 2019 10:06:43 +0000 (12:06 +0200)
Since commit 44e7f029159ed701b4a1739ac711507ee53790ed
    util: rewrite auto cleanup macros to use glib's equivalent

VIR_AUTOCLEAN is just an alias for g_auto. Use the GLib macros
directly instead of our custom aliases.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virxml.h

index c7def9ce61537978a4dc5592e509f42e05bd6bea..8813e31f75a15fae9373bd5785f20bc8d7e82046 100644 (file)
@@ -233,7 +233,7 @@ typedef virXPathContextNodeSave *virXPathContextNodeSavePtr;
 void
 virXPathContextNodeRestore(virXPathContextNodeSavePtr save);
 
-VIR_DEFINE_AUTOCLEAN_FUNC(virXPathContextNodeSave, virXPathContextNodeRestore);
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virXPathContextNodeSave, virXPathContextNodeRestore);
 
 /**
  * VIR_XPATH_NODE_AUTORESTORE:
@@ -243,8 +243,8 @@ VIR_DEFINE_AUTOCLEAN_FUNC(virXPathContextNodeSave, virXPathContextNodeRestore);
  * node pointer is reset to the original value when this macro was used.
  */
 #define VIR_XPATH_NODE_AUTORESTORE(_ctxt) \
-    VIR_AUTOCLEAN(virXPathContextNodeSave) _ctxt ## CtxtSave = { .ctxt = _ctxt,\
-                                                                 .node = _ctxt->node}; \
+    g_auto(virXPathContextNodeSave) _ctxt ## CtxtSave = { .ctxt = _ctxt,\
+                                                          .node = _ctxt->node}; \
     ignore_value(&_ctxt ## CtxtSave)
 
 VIR_DEFINE_AUTOPTR_FUNC(xmlDoc, xmlFreeDoc);