svn commit: trunk/uClibc/libc/stdio

vda at uclibc.org vda at uclibc.org
Wed Apr 9 19:52:13 UTC 2008


Author: vda
Date: 2008-04-09 12:52:13 -0700 (Wed, 09 Apr 2008)
New Revision: 21684

Log:
Remove vestigial locking init from sprintf routines.



Modified:
   trunk/uClibc/libc/stdio/vdprintf.c
   trunk/uClibc/libc/stdio/vsnprintf.c
   trunk/uClibc/libc/stdio/vswprintf.c


Changeset:
Modified: trunk/uClibc/libc/stdio/vdprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vdprintf.c	2008-04-09 19:51:18 UTC (rev 21683)
+++ trunk/uClibc/libc/stdio/vdprintf.c	2008-04-09 19:52:13 UTC (rev 21684)
@@ -47,6 +47,8 @@
 	__INIT_MBSTATE(&(f.__state));
 #endif /* __STDIO_MBSTATE */
 
+/* _vfprintf_internal doesn't do any locking, locking init is here
+ * only because of fflush_unlocked. TODO? */
 #ifdef __UCLIBC_HAS_THREADS__
 	f.__user_locking = 1;		/* Set user locking. */
 	__stdio_init_mutex(&f.__lock);

Modified: trunk/uClibc/libc/stdio/vsnprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vsnprintf.c	2008-04-09 19:51:18 UTC (rev 21683)
+++ trunk/uClibc/libc/stdio/vsnprintf.c	2008-04-09 19:52:13 UTC (rev 21684)
@@ -41,16 +41,13 @@
 	__INIT_MBSTATE(&(f.__state));
 #endif /* __STDIO_MBSTATE */
 
-#ifdef __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) {
 		size = SIZE_MAX - (size_t) buf;
 	}
 
+/* TODO: this comment seems to be wrong */
 	/* Set these last since __bufputc initialization depends on
 	 * __user_locking and only gets set if user locking is on. */
 	f.__bufstart = (unsigned char *) buf;
@@ -195,10 +192,6 @@
 	__INIT_MBSTATE(&(f.__state));
 #endif /* __STDIO_MBSTATE */
 
-#ifdef __UCLIBC_HAS_THREADS__
-	f.__user_locking = 1;		/* Set user locking. */
-	__stdio_init_mutex(&f.__lock);
-#endif
 	f.__nextopen = NULL;
 
 	rv = _vfprintf_internal(&f, format, arg);

Modified: trunk/uClibc/libc/stdio/vswprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vswprintf.c	2008-04-09 19:51:18 UTC (rev 21683)
+++ trunk/uClibc/libc/stdio/vswprintf.c	2008-04-09 19:52:13 UTC (rev 21684)
@@ -38,10 +38,6 @@
 	__INIT_MBSTATE(&(f.__state));
 #endif /* __STDIO_MBSTATE */
 
-#ifdef __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))) {




More information about the uClibc-cvs mailing list