提交 33ed6221 编写于 作者: M Michal Privoznik

Drop virVasprintf()

Now that function is no longer used, it can be dropped.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
上级 a0679169
......@@ -1043,11 +1043,6 @@ BAD:
<dt><code>VIR_STRDUP</code>, <code>VIR_STRNDUP</code></dt>
<dd>Prefer the GLib APIs <code>g_strdup</code> and <code>g_strndup</code>.</dd>
<dt><code>virAsprintf</code>, <code>virVasprintf</code></dt>
<dd>The GLib APIs <code>g_strdup_printf</code> / <code>g_strdup_vprint</code> should be used
instead. Don't use <code>g_vasprintf</code> unless having the string length
returned is unavoidable.</dd>
<dt><code>virStrerror</code></dt>
<dd>The GLib <code>g_strerror()</code> function should be used instead,
which has a simpler calling convention as an added benefit.</dd>
......
......@@ -3120,7 +3120,6 @@ virStrToLong_ull;
virStrToLong_ullp;
virStrToLong_ulp;
virTrimSpaces;
virVasprintfInternal;
# util/virsysinfo.h
......
......@@ -720,30 +720,6 @@ virDoubleToStr(char **strp, double number)
}
int
virVasprintfInternal(char **strp,
const char *fmt,
va_list list)
{
char *str = NULL;
int ret;
ret = g_vasprintf(&str, fmt, list);
/* GLib is supposed to abort() on OOM, but a mistake meant
* it did not. Delete this once our min glib is at 2.64.0
* which includes the fix:
* https://gitlab.gnome.org/GNOME/glib/merge_requests/1145
*/
#if !GLIB_CHECK_VERSION(2, 64, 0)
if (!str)
abort();
#endif
*strp = str;
return ret;
}
/**
* virStrncpy:
*
......
......@@ -133,9 +133,6 @@ int virStrdup(char **dest, const char *src)
int virStrndup(char **dest, const char *src, ssize_t n)
G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1);
int virVasprintfInternal(char **strp, const char *fmt, va_list list)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_PRINTF(2, 0)
G_GNUC_WARN_UNUSED_RESULT;
/**
* VIR_STRDUP:
......@@ -208,15 +205,6 @@ int virVasprintfInternal(char **strp, const char *fmt, va_list list)
size_t virStringListLength(const char * const *strings);
/**
* virVasprintf
*
* Like glibc's vasprintf but aborts on OOM
*
* Returns number of bytes printed on success, aborts on OOM
*/
#define virVasprintf(strp, fmt, list) virVasprintfInternal(strp, fmt, list)
int virStringSortCompare(const void *a, const void *b);
int virStringSortRevCompare(const void *a, const void *b);
int virStringToUpper(char **dst, const char *src);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册