Change all references from avsprintf to vasprintf. From Sebastien Lorquet

This commit is contained in:
Sebastien Lorquet
2015-09-07 13:10:40 -06:00
committed by Gregory Nutt
parent 413ebde3b3
commit 77e4e7b231
8 changed files with 14 additions and 12 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
"aio_return","aio.h","defined(CONFIG_FS_AIO)","ssize_t","FAR struct aiocb *"
"aio_suspend","aio.h","defined(CONFIG_FS_AIO)","int","FAR struct aiocb *const []|FAR struct aiocb *const *","int","FAR const struct timespec *"
"asprintf","stdio.h","","int","FAR char **","const char *","..."
"avsprintf","stdio.h","","int","FAR char **","const char *","va_list"
"vasprintf","stdio.h","","int","FAR char **","const char *","va_list"
"b16atan2","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t","b16_t"
"b16cos","fixedmath.h","","b16_t","b16_t"
"b16divb16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t","b16_t"
1 _inet_ntoa arpa/inet.h defined(CONFIG_NET_IPv4) && !defined(CONFIG_CAN_PASS_STRUCTS) FAR char in_addr_t
5 aio_return aio.h defined(CONFIG_FS_AIO) ssize_t FAR struct aiocb *
6 aio_suspend aio.h defined(CONFIG_FS_AIO) int FAR struct aiocb *const []|FAR struct aiocb *const *
7 asprintf stdio.h int FAR char **
8 avsprintf vasprintf stdio.h int FAR char **
9 b16atan2 fixedmath.h !defined(CONFIG_HAVE_LONG_LONG) b16_t b16_t
10 b16cos fixedmath.h b16_t b16_t
11 b16divb16 fixedmath.h !defined(CONFIG_HAVE_LONG_LONG) b16_t b16_t
+1 -1
View File
@@ -38,7 +38,7 @@
# C streams.
CSRCS += lib_fileno.c lib_printf.c lib_sprintf.c lib_asprintf.c
CSRCS += lib_snprintf.c lib_libsprintf.c lib_vsprintf.c lib_avsprintf.c
CSRCS += lib_snprintf.c lib_libsprintf.c lib_vsprintf.c lib_vasprintf.c
CSRCS += lib_vsnprintf.c lib_libvsprintf.c lib_dprintf.c lib_vdprintf.c
CSRCS += lib_meminstream.c lib_memoutstream.c lib_memsistream.c
CSRCS += lib_memsostream.c lib_lowinstream.c lib_lowoutstream.c
+2 -2
View File
@@ -97,10 +97,10 @@ int asprintf (FAR char **ptr, const char *fmt, ...)
va_list ap;
int ret;
/* Let avsprintf do all of the work */
/* Let vasprintf do all of the work */
va_start(ap, fmt);
ret = avsprintf(ptr, fmt, ap);
ret = vasprintf(ptr, fmt, ap);
va_end(ap);
return ret;
+5 -5
View File
@@ -1,5 +1,5 @@
/****************************************************************************
* libc/stdio/lib_avsprintf.c
* libc/stdio/lib_vasprintf.c
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -49,7 +49,7 @@
****************************************************************************/
/* On some architectures, va_list is really a pointer to a structure on the
* stack. And the va_arg builtin will modify that instance of va_list. Since
* avsprintf traverse the parameters in the va_list twice, the va_list will
* vasprintf traverse the parameters in the va_list twice, the va_list will
* be altered in this first cases and the second usage will fail. So far, I
* have seen this only on the X86 family with GCC.
*/
@@ -95,14 +95,14 @@
****************************************************************************/
/****************************************************************************
* Name: avsprintf
* Name: vasprintf
*
* Description:
* This function is similar to vsprintf, except that it dynamically
* allocates a string (as with malloc) to hold the output, instead of
* putting the output in a buffer you allocate in advance. The ptr
* argument should be the address of a char * object, and a successful
* call to avsprintf stores a pointer to the newly allocated string at that
* call to vasprintf stores a pointer to the newly allocated string at that
* location.
*
* Returned Value:
@@ -112,7 +112,7 @@
*
****************************************************************************/
int avsprintf(FAR char **ptr, const char *fmt, va_list ap)
int vasprintf(FAR char **ptr, const char *fmt, va_list ap)
{
struct lib_outstream_s nulloutstream;
struct lib_memoutstream_s memoutstream;