mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-14 07:04:43 -05:00
virbuffer: use g_auto directly for virBuffer
Since commit 44e7f02915
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>
This commit is contained in:
+3
-3
@@ -306,8 +306,8 @@ static int testBufAddBuffer(const void *data G_GNUC_UNUSED)
|
||||
static int
|
||||
testBufAddBuffer2(const void *opaque G_GNUC_UNUSED)
|
||||
{
|
||||
VIR_AUTOCLEAN(virBuffer) buf1 = VIR_BUFFER_INITIALIZER;
|
||||
VIR_AUTOCLEAN(virBuffer) buf2 = VIR_BUFFER_INITIALIZER;
|
||||
g_auto(virBuffer) buf1 = VIR_BUFFER_INITIALIZER;
|
||||
g_auto(virBuffer) buf2 = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
/* Intent of this test is to demonstrate a memleak that happen with
|
||||
* virBufferAddBuffer */
|
||||
@@ -461,7 +461,7 @@ testBufSetIndent(const void *opaque G_GNUC_UNUSED)
|
||||
static int
|
||||
testBufferAutoclean(const void *opaque G_GNUC_UNUSED)
|
||||
{
|
||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
virBufferAddLit(&buf, "test test test\n");
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user