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/printf-parse.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'stdio-common/printf-parse.h') diff --git a/stdio-common/printf-parse.h b/stdio-common/printf-parse.h index aa49c7a642..f6ad71cd3b 100644 --- a/stdio-common/printf-parse.h +++ b/stdio-common/printf-parse.h @@ -1,5 +1,6 @@ /* Internal header for parsing printf format strings. - Copyright (C) 1995-1999, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000, 2002, 2003, 2007 + Free Software Foundation, Inc. This file is part of th GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,6 +21,8 @@ #include #include #include +#include +#include struct printf_spec @@ -86,11 +89,17 @@ extern printf_function **__printf_function_table attribute_hidden; /* Find the next spec in FORMAT, or the end of the string. Returns a pointer into FORMAT, to a '%' or a '\0'. */ -extern const unsigned char *__find_specmb (const UCHAR_T *format, - mbstate_t *ps) attribute_hidden; +__extern_always_inline const unsigned char * +__find_specmb (const unsigned char *format) +{ + return (const unsigned char *) __strchrnul ((const char *) format, '%'); +} -extern const unsigned int *__find_specwc (const UCHAR_T *format) - attribute_hidden; +__extern_always_inline const unsigned int * +__find_specwc (const unsigned int *format) +{ + return (const unsigned int *) __wcschrnul ((const wchar_t *) format, L'%'); +} /* FORMAT must point to a '%' at the beginning of a spec. Fills in *SPEC @@ -100,8 +109,7 @@ extern const unsigned int *__find_specwc (const UCHAR_T *format) remains the highest argument index used. */ extern size_t __parse_one_specmb (const unsigned char *format, size_t posn, struct printf_spec *spec, - size_t *max_ref_arg, mbstate_t *ps) - attribute_hidden; + size_t *max_ref_arg) attribute_hidden; extern size_t __parse_one_specwc (const unsigned int *format, size_t posn, struct printf_spec *spec, -- cgit v1.2.3