From 36ac7bee0f6b0be35eafd74e0fc865edd2352197 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Wed, 9 Apr 2008 19:51:18 +0000 Subject: Factor out the core of vprintf() into separate function vprintf_internal, so that: * vprintf() does locking and __STDIO_STREAM_TRANS_TO_WRITE thing, then calls vprintf_internal * vsnprintf, vdprintf.c, vasprintf.c use vprintf_internal directly This makes sprintf faster (since it doesn't do any locking) and stops it from pulling in fseek in static compile. --- libc/stdio/vsnprintf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libc/stdio/vsnprintf.c') diff --git a/libc/stdio/vsnprintf.c b/libc/stdio/vsnprintf.c index 51aaf43d0..4eef2c1a0 100644 --- a/libc/stdio/vsnprintf.c +++ b/libc/stdio/vsnprintf.c @@ -10,8 +10,6 @@ libc_hidden_proto(vsnprintf) -libc_hidden_proto(vfprintf) - #ifdef __UCLIBC_MJN3_ONLY__ #warning WISHLIST: Implement vsnprintf for non-buffered and no custom stream case. #endif /* __UCLIBC_MJN3_ONLY__ */ @@ -61,7 +59,7 @@ int vsnprintf(char *__restrict buf, size_t size, __STDIO_STREAM_DISABLE_GETC(&f); __STDIO_STREAM_ENABLE_PUTC(&f); - rv = vfprintf(&f, format, arg); + rv = _vfprintf_internal(&f, format, arg); if (size) { if (f.__bufpos == f.__bufend) { --f.__bufpos; @@ -203,7 +201,7 @@ int vsnprintf(char *__restrict buf, size_t size, #endif f.__nextopen = NULL; - rv = vfprintf(&f, format, arg); + rv = _vfprintf_internal(&f, format, arg); return rv; } -- cgit v1.2.3