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

View File

@ -10948,4 +10948,6 @@
intended to support the initial board bring-up (2015-09-05). intended to support the initial board bring-up (2015-09-05).
* up_initialize() all architectures: Automatically initialize all * up_initialize() all architectures: Automatically initialize all
the TUN device if it is in the configuration (2015-09-06). the TUN device if it is in the configuration (2015-09-06).
* Change all references from avsprintf to vasprintf. From Sebastien
Lorquet (2015-09-07).

2
arch

@ -1 +1 @@
Subproject commit 1e8ed1f683eb8cd5ddec57ca978735bbde0af6cd Subproject commit 4b6d3fced65486ad40609ea5d08feb0882f3d80c

View File

@ -91,7 +91,7 @@ namespace std
using ::vprintf; using ::vprintf;
using ::vfprintf; using ::vfprintf;
using ::vsprintf; using ::vsprintf;
using ::avsprintf; using ::vasprintf;
using ::vsnprintf; using ::vsnprintf;
using ::vsscanf; using ::vsscanf;

View File

@ -163,7 +163,7 @@ void perror(FAR const char *s);
int vprintf(FAR const char *format, va_list ap); int vprintf(FAR const char *format, va_list ap);
int vfprintf(FAR FILE *stream, const char *format, va_list ap); int vfprintf(FAR FILE *stream, const char *format, va_list ap);
int vsprintf(FAR char *buf, const char *format, va_list ap); int vsprintf(FAR char *buf, const char *format, va_list ap);
int avsprintf(FAR char **ptr, const char *fmt, va_list ap); int vasprintf(FAR char **ptr, const char *fmt, va_list ap);
int vsnprintf(FAR char *buf, size_t size, const char *format, va_list ap); int vsnprintf(FAR char *buf, size_t size, const char *format, va_list ap);
int vsscanf(FAR const char *buf, FAR const char *s, va_list ap); int vsscanf(FAR const char *buf, FAR const char *s, va_list ap);

View File

@ -5,7 +5,7 @@
"aio_return","aio.h","defined(CONFIG_FS_AIO)","ssize_t","FAR struct aiocb *" "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 *" "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 *","..." "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" "b16atan2","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t","b16_t"
"b16cos","fixedmath.h","","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" "b16divb16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t","b16_t"

Can't render this file because it has a wrong number of fields in line 2.

View File

@ -38,7 +38,7 @@
# C streams. # C streams.
CSRCS += lib_fileno.c lib_printf.c lib_sprintf.c lib_asprintf.c 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_vsnprintf.c lib_libvsprintf.c lib_dprintf.c lib_vdprintf.c
CSRCS += lib_meminstream.c lib_memoutstream.c lib_memsistream.c CSRCS += lib_meminstream.c lib_memoutstream.c lib_memsistream.c
CSRCS += lib_memsostream.c lib_lowinstream.c lib_lowoutstream.c CSRCS += lib_memsostream.c lib_lowinstream.c lib_lowoutstream.c

View File

@ -97,10 +97,10 @@ int asprintf (FAR char **ptr, const char *fmt, ...)
va_list ap; va_list ap;
int ret; int ret;
/* Let avsprintf do all of the work */ /* Let vasprintf do all of the work */
va_start(ap, fmt); va_start(ap, fmt);
ret = avsprintf(ptr, fmt, ap); ret = vasprintf(ptr, fmt, ap);
va_end(ap); va_end(ap);
return ret; return ret;

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. * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@ -49,7 +49,7 @@
****************************************************************************/ ****************************************************************************/
/* On some architectures, va_list is really a pointer to a structure on the /* 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 * 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 * 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. * have seen this only on the X86 family with GCC.
*/ */
@ -95,14 +95,14 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: avsprintf * Name: vasprintf
* *
* Description: * Description:
* This function is similar to vsprintf, except that it dynamically * This function is similar to vsprintf, except that it dynamically
* allocates a string (as with malloc) to hold the output, instead of * allocates a string (as with malloc) to hold the output, instead of
* putting the output in a buffer you allocate in advance. The ptr * putting the output in a buffer you allocate in advance. The ptr
* argument should be the address of a char * object, and a successful * 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. * location.
* *
* Returned Value: * 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_outstream_s nulloutstream;
struct lib_memoutstream_s memoutstream; struct lib_memoutstream_s memoutstream;