Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Dec 2008 02:39:28 +0000 (UTC)
From:      David Schultz <das@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185904 - head/lib/libc/stdio
Message-ID:  <200812110239.mBB2dSnv050588@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: das
Date: Thu Dec 11 02:39:27 2008
New Revision: 185904
URL: http://svn.freebsd.org/changeset/base/185904

Log:
  Consolidate some variable initializations. No substantive change.

Modified:
  head/lib/libc/stdio/vfprintf.c
  head/lib/libc/stdio/vfwprintf.c

Modified: head/lib/libc/stdio/vfprintf.c
==============================================================================
--- head/lib/libc/stdio/vfprintf.c	Thu Dec 11 02:24:11 2008	(r185903)
+++ head/lib/libc/stdio/vfprintf.c	Thu Dec 11 02:39:27 2008	(r185904)
@@ -567,13 +567,6 @@ __vfprintf(FILE *fp, const char *fmt0, v
 	if (__use_xprintf > 0)
 		return (__xvprintf(fp, fmt0, ap));
 
-	thousands_sep = '\0';
-	grouping = NULL;
-	convbuf = NULL;
-#ifndef NO_FLOATING_POINT
-	dtoaresult = NULL;
-	decimal_point = localeconv()->decimal_point;
-#endif
 	/* sorry, fprintf(read_only_file, "") returns EOF, not 0 */
 	if (prepwrite(fp) != 0)
 		return (EOF);
@@ -583,6 +576,9 @@ __vfprintf(FILE *fp, const char *fmt0, v
 	    fp->_file >= 0)
 		return (__sbprintf(fp, fmt0, ap));
 
+	thousands_sep = '\0';
+	grouping = NULL;
+	convbuf = NULL;
 	fmt = (char *)fmt0;
 	argtable = NULL;
 	nextarg = 1;
@@ -591,6 +587,10 @@ __vfprintf(FILE *fp, const char *fmt0, v
 	uio.uio_resid = 0;
 	uio.uio_iovcnt = 0;
 	ret = 0;
+#ifndef NO_FLOATING_POINT
+	dtoaresult = NULL;
+	decimal_point = localeconv()->decimal_point;
+#endif
 
 	/*
 	 * Scan the format for conversions (`%' character).

Modified: head/lib/libc/stdio/vfwprintf.c
==============================================================================
--- head/lib/libc/stdio/vfwprintf.c	Thu Dec 11 02:24:11 2008	(r185903)
+++ head/lib/libc/stdio/vfwprintf.c	Thu Dec 11 02:39:27 2008	(r185904)
@@ -575,12 +575,6 @@ __vfwprintf(FILE *fp, const wchar_t *fmt
 	}
 
 
-	thousands_sep = '\0';
-	grouping = NULL;
-#ifndef NO_FLOATING_POINT
-	decimal_point = localeconv()->decimal_point;
-#endif
-	convbuf = NULL;
 	/* sorry, fwprintf(read_only_file, L"") returns WEOF, not 0 */
 	if (prepwrite(fp) != 0)
 		return (EOF);
@@ -590,11 +584,17 @@ __vfwprintf(FILE *fp, const wchar_t *fmt
 	    fp->_file >= 0)
 		return (__sbprintf(fp, fmt0, ap));
 
+	thousands_sep = '\0';
+	grouping = NULL;
+	convbuf = NULL;
 	fmt = (wchar_t *)fmt0;
 	argtable = NULL;
 	nextarg = 1;
 	va_copy(orgap, ap);
 	ret = 0;
+#ifndef NO_FLOATING_POINT
+	decimal_point = localeconv()->decimal_point;
+#endif
 
 	/*
 	 * Scan the format for conversions (`%' character).



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812110239.mBB2dSnv050588>