mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Drop virVasprintf()
Now that function is no longer used, it can be dropped. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
a067916975
commit
33ed622106
@ -1043,11 +1043,6 @@ BAD:
|
|||||||
<dt><code>VIR_STRDUP</code>, <code>VIR_STRNDUP</code></dt>
|
<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>
|
<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>
|
<dt><code>virStrerror</code></dt>
|
||||||
<dd>The GLib <code>g_strerror()</code> function should be used instead,
|
<dd>The GLib <code>g_strerror()</code> function should be used instead,
|
||||||
which has a simpler calling convention as an added benefit.</dd>
|
which has a simpler calling convention as an added benefit.</dd>
|
||||||
|
@ -3120,7 +3120,6 @@ virStrToLong_ull;
|
|||||||
virStrToLong_ullp;
|
virStrToLong_ullp;
|
||||||
virStrToLong_ulp;
|
virStrToLong_ulp;
|
||||||
virTrimSpaces;
|
virTrimSpaces;
|
||||||
virVasprintfInternal;
|
|
||||||
|
|
||||||
|
|
||||||
# util/virsysinfo.h
|
# 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:
|
* virStrncpy:
|
||||||
*
|
*
|
||||||
|
@ -133,9 +133,6 @@ int virStrdup(char **dest, const char *src)
|
|||||||
|
|
||||||
int virStrndup(char **dest, const char *src, ssize_t n)
|
int virStrndup(char **dest, const char *src, ssize_t n)
|
||||||
G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1);
|
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:
|
* VIR_STRDUP:
|
||||||
@ -208,15 +205,6 @@ int virVasprintfInternal(char **strp, const char *fmt, va_list list)
|
|||||||
|
|
||||||
size_t virStringListLength(const char * const *strings);
|
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 virStringSortCompare(const void *a, const void *b);
|
||||||
int virStringSortRevCompare(const void *a, const void *b);
|
int virStringSortRevCompare(const void *a, const void *b);
|
||||||
int virStringToUpper(char **dst, const char *src);
|
int virStringToUpper(char **dst, const char *src);
|
||||||
|
Loading…
Reference in New Issue
Block a user