about summary refs log tree commit diff
path: root/stdio-common/printf-parsemb.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-10-10 20:14:12 +0000
committerUlrich Drepper <drepper@redhat.com>2007-10-10 20:14:12 +0000
commitc06b7169e41740e4be335ca3f6221bc7d60464c7 (patch)
treefa5b4f6e4629b6b8b36be74118acbdd0f9e73e6d /stdio-common/printf-parsemb.c
parent59d430c6809871b357f2e9e677ef7fdfc03fbf62 (diff)
downloadglibc-c06b7169e41740e4be335ca3f6221bc7d60464c7.tar.gz
glibc-c06b7169e41740e4be335ca3f6221bc7d60464c7.tar.xz
glibc-c06b7169e41740e4be335ca3f6221bc7d60464c7.zip
* 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.
Diffstat (limited to 'stdio-common/printf-parsemb.c')
-rw-r--r--stdio-common/printf-parsemb.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/stdio-common/printf-parsemb.c b/stdio-common/printf-parsemb.c
index 2f21fc6365..da6fd3edb0 100644
--- a/stdio-common/printf-parsemb.c
+++ b/stdio-common/printf-parsemb.c
@@ -46,35 +46,6 @@
 
 
 
-/* Find the next spec in FORMAT, or the end of the string.  Returns
-   a pointer into FORMAT, to a '%' or a '\0'.  */
-const UCHAR_T *
-#ifdef COMPILE_WPRINTF
-__find_specwc (const UCHAR_T *format)
-#else
-__find_specmb (const UCHAR_T *format, mbstate_t *ps)
-#endif
-{
-#ifdef COMPILE_WPRINTF
-  return (const UCHAR_T *) __wcschrnul ((const CHAR_T *) format, L'%');
-#else
-  while (*format != L_('\0') && *format != L_('%'))
-    {
-      int len;
-
-      /* Remove any hints of a wrong encoding.  */
-      ps->__count = 0;
-      if (! isascii (*format)
-	  && (len = __mbrlen ((const CHAR_T *) format, MB_CUR_MAX, ps)) > 0)
-	format += len;
-      else
-	++format;
-    }
-  return format;
-#endif
-}
-
-
 /* FORMAT must point to a '%' at the beginning of a spec.  Fills in *SPEC
    with the parsed details.  POSN is the number of arguments already
    consumed.  At most MAXTYPES - POSN types are filled in TYPES.  Return
@@ -87,8 +58,7 @@ __parse_one_specwc (const UCHAR_T *format, size_t posn,
 		    struct printf_spec *spec, size_t *max_ref_arg)
 #else
 __parse_one_specmb (const UCHAR_T *format, size_t posn,
-		    struct printf_spec *spec, size_t *max_ref_arg,
-		    mbstate_t *ps)
+		    struct printf_spec *spec, size_t *max_ref_arg)
 #endif
 {
   unsigned int n;
@@ -403,7 +373,7 @@ __parse_one_specmb (const UCHAR_T *format, size_t posn,
 #ifdef COMPILE_WPRINTF
       spec->next_fmt = __find_specwc (format);
 #else
-      spec->next_fmt = __find_specmb (format, ps);
+      spec->next_fmt = __find_specmb (format);
 #endif
     }