1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

* stdio-common/printf-parse.h: Include string.h and wchar.h.

(__find_specwc): Change into __extern_always_inline function.
	(__find_specmb): Likewise.  Remove ps argument.  Use __strchrnul.
	(__parse_one_specmb): Remove ps argument.
	* stdio-common/vfprintf.c (vfprintf): Remove mbstate variable.
	Adjust __find_specmb and __parse_one_specmb callers.
	* stdio-common/printf-prs.c (parse_printf_format): Likewise.
	* stdio-common/printf-parsemb.c (__find_specwc, __find_specmb):
	Removed.
	(__parse_one_specmb): Remove ps argument, adjust __find_specmb
	caller.
This commit is contained in:
Ulrich Drepper
2007-10-10 20:14:12 +00:00
parent 59d430c680
commit c06b7169e4
5 changed files with 38 additions and 56 deletions

View File

@@ -209,11 +209,6 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
CHAR_T *workstart = NULL;
CHAR_T *workend;
/* State for restartable multibyte character handling functions. */
#ifndef COMPILE_WPRINTF
mbstate_t mbstate;
#endif
/* We have to save the original argument pointer. */
va_list ap_save;
@@ -1294,11 +1289,8 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
/* Find the first format specifier. */
f = lead_str_end = __find_specwc ((const UCHAR_T *) format);
#else
/* Put state for processing format string in initial state. */
memset (&mbstate, '\0', sizeof (mbstate_t));
/* Find the first format specifier. */
f = lead_str_end = __find_specmb ((const UCHAR_T *) format, &mbstate);
f = lead_str_end = __find_specmb ((const UCHAR_T *) format);
#endif
/* Lock stream. */
@@ -1591,7 +1583,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
#ifdef COMPILE_WPRINTF
f = __find_specwc ((end_of_spec = ++f));
#else
f = __find_specmb ((end_of_spec = ++f), &mbstate);
f = __find_specmb ((end_of_spec = ++f));
#endif
/* Write the following constant string. */
@@ -1674,8 +1666,7 @@ do_positional:
#ifdef COMPILE_WPRINTF
nargs += __parse_one_specwc (f, nargs, &specs[nspecs], &max_ref_arg);
#else
nargs += __parse_one_specmb (f, nargs, &specs[nspecs], &max_ref_arg,
&mbstate);
nargs += __parse_one_specmb (f, nargs, &specs[nspecs], &max_ref_arg);
#endif
}