Create and use typedefs virBufferEscapePair and virBufferEscapePairPtr
for struct _virBufferEscapePair for cleaner code and for use with
cleanup macros.
Signed-off-by: Sukrit Bhatnagar <skrtbhtngr(a)gmail.com>
---
src/util/virbuffer.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c
index 3d6defb..ea96704 100644
--- a/src/util/virbuffer.c
+++ b/src/util/virbuffer.c
@@ -648,12 +648,14 @@ virBufferEscape(virBufferPtr buf, char escape, const char
*toescape,
}
+typedef struct _virBufferEscapePair virBufferEscapePair;
+typedef virBufferEscapePair *virBufferEscapePairPtr;
+
struct _virBufferEscapePair {
char escape;
char *toescape;
};
-
/**
* virBufferEscapeN:
* @buf: the buffer to append to
@@ -678,8 +680,8 @@ virBufferEscapeN(virBufferPtr buf,
char *escaped = NULL;
char *out;
const char *cur;
- struct _virBufferEscapePair escapeItem;
- struct _virBufferEscapePair *escapeList = NULL;
+ virBufferEscapePair escapeItem;
+ virBufferEscapePairPtr escapeList = NULL;
size_t nescapeList = 0;
va_list ap;
--
1.8.3.1