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>
halt='use virStrToDouble, not strtod variants' \
$(_sc_search_regexp)
-# Use virAsprintf rather than as'printf since *strp is undefined on error.
-# But for plain %s, virAsprintf is overkill compared to strdup.
+# Use g_strdup_printf rather than as'printf since *strp is undefined on error.
+# But for plain %s, g_strdup_printf is overkill compared to g_strdup.
sc_prohibit_asprintf:
@prohibit='\<v?a[s]printf\>' \
- halt='use virAsprintf, not asprintf' \
+ halt='use g_strdup_printf, not asprintf' \
$(_sc_search_regexp)
- @prohibit='virAsprintf.*, *"%s",' \
- halt='use VIR_STRDUP instead of virAsprintf with "%s"' \
+ @prohibit='g_strdup_printf.*, *"%s",' \
+ halt='use g_strdup instead of g_strdup_printf with "%s"' \
$(_sc_search_regexp)
sc_prohibit_strdup:
dontwarn="$dontwarn -Wstrict-overflow"
# Not a problem since we don't use -funsafe-loop-optimizations
dontwarn="$dontwarn -Wunsafe-loop-optimizations"
- # Things like virAsprintf mean we can't use this
- dontwarn="$dontwarn -Wformat-nonliteral"
# Gnulib's stat-time.h violates this
dontwarn="$dontwarn -Waggregate-return"
# gcc 4.4.6 complains this is C++ only; gcc 4.7.0 implies this from -Wall
# util/virstring.h
-virAsprintfInternal;
virSkipSpaces;
virSkipSpacesAndBackslash;
virSkipSpacesBackwards;
return ret;
}
-int
-virAsprintfInternal(char **strp,
- const char *fmt, ...)
-{
- va_list ap;
- char *str = NULL;
- int ret;
-
- va_start(ap, fmt);
- ret = g_vasprintf(&str, fmt, ap);
- va_end(ap);
-
- if (!*str)
- abort();
- *strp = str;
-
- return ret;
-}
-
/**
* virStrncpy:
*
int virStrndup(char **dest, const char *src, ssize_t n)
G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1);
-int virAsprintfInternal(char **strp, const char *fmt, ...)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_PRINTF(2, 3)
- G_GNUC_WARN_UNUSED_RESULT;
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;
*/
#define virVasprintfQuiet(strp, fmt, list) virVasprintf(strp, fmt, list)
-/**
- * virAsprintf:
- * @strp: variable to hold result (char **)
- * @fmt: printf format
- *
- * Like glibc's asprintf but aborts on OOM.
- *
- * Returns number of bytes printed on success, aborts on OOM
- */
-
-#define virAsprintf(strp, ...) virAsprintfInternal(strp, __VA_ARGS__)
-
int virStringSortCompare(const void *a, const void *b);
int virStringSortRevCompare(const void *a, const void *b);
int virStringToUpper(char **dst, const char *src);