From c06b7169e41740e4be335ca3f6221bc7d60464c7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 10 Oct 2007 20:14:12 +0000 Subject: * 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. --- stdio-common/vfprintf.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'stdio-common/vfprintf.c') diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index fae0f7464e..d1dc1aaf59 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -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 } -- cgit 1.4.1