svn commit: trunk/uClibc/libc/stdio
vda at uclibc.org
vda at uclibc.org
Thu Apr 10 13:39:08 PDT 2008
Author: vda
Date: 2008-04-10 13:39:07 -0700 (Thu, 10 Apr 2008)
New Revision: 21693
Log:
even more fixes for vda-made breakage in vXXXfprintf
(pointed out by Peter S.Mazinger)
Modified:
trunk/uClibc/libc/stdio/_vfprintf.c
trunk/uClibc/libc/stdio/vsnprintf.c
trunk/uClibc/libc/stdio/vswprintf.c
Changeset:
Modified: trunk/uClibc/libc/stdio/_vfprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/_vfprintf.c 2008-04-10 19:59:20 UTC (rev 21692)
+++ trunk/uClibc/libc/stdio/_vfprintf.c 2008-04-10 20:39:07 UTC (rev 21693)
@@ -1866,7 +1866,7 @@
libc_hidden_proto(fprintf)
int VFPRINTF_internal (FILE * __restrict stream,
- register const FMT_TYPE * __restrict format,
+ const FMT_TYPE * __restrict format,
va_list arg)
{
ppfs_t ppfs;
@@ -1954,7 +1954,7 @@
libc_hidden_proto(VFPRINTF)
int VFPRINTF (FILE * __restrict stream,
- register const FMT_TYPE * __restrict format,
+ const FMT_TYPE * __restrict format,
va_list arg)
{
int count;
Modified: trunk/uClibc/libc/stdio/vsnprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vsnprintf.c 2008-04-10 19:59:20 UTC (rev 21692)
+++ trunk/uClibc/libc/stdio/vsnprintf.c 2008-04-10 20:39:07 UTC (rev 21693)
@@ -19,9 +19,8 @@
#endif /* __UCLIBC_MJN3_ONLY__ */
#ifdef __STDIO_BUFFERS
+/* NB: we can still have __USE_OLD_VFPRINTF__ defined in this case! */
-/* NB: __USE_OLD_VFPRINTF__ is not defined in this case */
-
int vsnprintf(char *__restrict buf, size_t size,
const char * __restrict format, va_list arg)
{
@@ -47,6 +46,10 @@
__INIT_MBSTATE(&(f.__state));
#endif /* __STDIO_MBSTATE */
+#if defined(__USE_OLD_VFPRINTF__) && defined(__UCLIBC_HAS_THREADS__)
+ f.__user_locking = 1; /* Set user locking. */
+ __stdio_init_mutex(&f.__lock);
+#endif
f.__nextopen = NULL;
if (size > SIZE_MAX - (size_t) buf) {
@@ -62,7 +65,11 @@
__STDIO_STREAM_DISABLE_GETC(&f);
__STDIO_STREAM_ENABLE_PUTC(&f);
+#ifdef __USE_OLD_VFPRINTF__
+ rv = vfprintf(&f, format, arg);
+#else
rv = _vfprintf_internal(&f, format, arg);
+#endif
if (size) {
if (f.__bufpos == f.__bufend) {
--f.__bufpos;
Modified: trunk/uClibc/libc/stdio/vswprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vswprintf.c 2008-04-10 19:59:20 UTC (rev 21692)
+++ trunk/uClibc/libc/stdio/vswprintf.c 2008-04-10 20:39:07 UTC (rev 21693)
@@ -11,9 +11,7 @@
libc_hidden_proto(vswprintf)
-#ifdef __USE_OLD_VFPRINTF__
-libc_hidden_proto(vfwprintf)
-#endif
+/* NB: this file is not used if __USE_OLD_VFPRINTF__ */
#ifndef __STDIO_BUFFERS
#warning Skipping vswprintf since no buffering!
@@ -42,10 +40,6 @@
__INIT_MBSTATE(&(f.__state));
#endif /* __STDIO_MBSTATE */
-#if defined(__USE_OLD_VFPRINTF__) && defined(__UCLIBC_HAS_THREADS__)
- f.__user_locking = 1; /* Set user locking. */
- __stdio_init_mutex(&f.__lock);
-#endif
f.__nextopen = NULL;
if (size > ((SIZE_MAX - (size_t) buf)/sizeof(wchar_t))) {
@@ -58,11 +52,7 @@
__STDIO_STREAM_DISABLE_GETC(&f);
__STDIO_STREAM_DISABLE_PUTC(&f);
-#ifdef __USE_OLD_VFPRINTF__
- rv = vfwprintf(&f, format, arg);
-#else
rv = _vfwprintf_internal(&f, format, arg);
-#endif
/* NOTE: Return behaviour differs from snprintf... */
if (f.__bufpos == f.__bufend) {
More information about the uClibc-cvs
mailing list