Skip to content

Commit 025af9d

Browse files
xiaoxiang781216Donny9
authored andcommitted
libc: Merge lib_vsprintf from lib_libsprintf.c into lib_libvsprintf.c
since all other printf variants in lib_libvsprintf.c Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
1 parent 84dc887 commit 025af9d

File tree

4 files changed

+19
-51
lines changed

4 files changed

+19
-51
lines changed

libs/libc/stream/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ list(
4646
lib_fileinstream.c
4747
lib_fileoutstream.c
4848
lib_libbsprintf.c
49-
lib_libsprintf.c
5049
lib_libvscanf.c
5150
lib_libvsprintf.c
5251
lib_ultoa_invert.c)

libs/libc/stream/Make.defs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CSRCS += lib_mtdoutstream.c lib_libnoflush.c lib_libsnoflush.c
3131
CSRCS += lib_syslogstream.c lib_syslograwstream.c lib_bufferedoutstream.c
3232
CSRCS += lib_hexdumpstream.c lib_base64outstream.c lib_mtdsostream.c
3333
CSRCS += lib_fileinstream.c lib_fileoutstream.c lib_libbsprintf.c
34-
CSRCS += lib_libsprintf.c lib_libvscanf.c lib_libvsprintf.c lib_ultoa_invert.c
34+
CSRCS += lib_libvscanf.c lib_libvsprintf.c lib_ultoa_invert.c
3535

3636
ifeq ($(CONFIG_LIBC_FLOATINGPOINT),y)
3737
CSRCS += lib_dtoa_engine.c lib_dtoa_data.c

libs/libc/stream/lib_libsprintf.c

Lines changed: 0 additions & 49 deletions
This file was deleted.

libs/libc/stream/lib_libvsprintf.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,24 @@ int lib_vsprintf(FAR struct lib_outstream_s *stream,
13861386
#endif
13871387
}
13881388

1389+
/****************************************************************************
1390+
* Name: lib_sprintf
1391+
****************************************************************************/
1392+
1393+
int lib_sprintf(FAR struct lib_outstream_s *stream, FAR const IPTR char *fmt,
1394+
...)
1395+
{
1396+
va_list ap;
1397+
int n;
1398+
1399+
/* Let lib_vsprintf do the real work */
1400+
1401+
va_start(ap, fmt);
1402+
n = lib_vsprintf(stream, fmt, ap);
1403+
va_end(ap);
1404+
return n;
1405+
}
1406+
13891407
/****************************************************************************
13901408
* Name: lib_sprintf_internal
13911409
*

0 commit comments

Comments
 (0)