From ff4b126a183a0a50aaa3ac1d9a323ae9d1f07292 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 15 Jun 1999 22:10:18 +0000 Subject: Update. 1999-06-15 Ulrich Drepper * stdio-common/printf-parse.h (parse_one_spec): Don't set is_longlong is not necessary. --- stdio-common/printf-parse.h | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'stdio-common') diff --git a/stdio-common/printf-parse.h b/stdio-common/printf-parse.h index 2e6f0dcd99..a915f03f18 100644 --- a/stdio-common/printf-parse.h +++ b/stdio-common/printf-parse.h @@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */ #include +#include #include #include #include @@ -265,7 +266,6 @@ parse_one_spec (const UCHAR_T *format, size_t posn, struct printf_spec *spec, } /* Check for type modifiers. */ -#define is_longlong is_long_double spec->info.is_long_double = 0; spec->info.is_short = 0; spec->info.is_long = 0; @@ -300,18 +300,24 @@ parse_one_spec (const UCHAR_T *format, size_t posn, struct printf_spec *spec, case L_('Z'): /* ints are size_ts. */ assert (sizeof (size_t) <= sizeof (unsigned long long int)); - spec->info.is_longlong = sizeof (size_t) > sizeof (unsigned long int); +#if LONG_MAX != LONG_LONG_MAX + spec->info.is_long_double = sizeof (size_t) > sizeof (unsigned long int); +#endif spec->info.is_long = sizeof (size_t) > sizeof (unsigned int); break; case L_('t'): assert (sizeof (ptrdiff_t) <= sizeof (long long int)); - spec->info.is_longlong = (sizeof (ptrdiff_t) > sizeof (long int)); +#if LONG_MAX != LONG_LONG_MAX + spec->info.is_long_double = (sizeof (ptrdiff_t) > sizeof (long int)); +#endif spec->info.is_long = sizeof (ptrdiff_t) > sizeof (int); break; case L_('j'): assert (sizeof (uintmax_t) <= sizeof (unsigned long long int)); - spec->info.is_longlong = (sizeof (uintmax_t) - > sizeof (unsigned long int)); +#if LONG_MAX != LONG_LONG_MAX + spec->info.is_long_double = (sizeof (uintmax_t) + > sizeof (unsigned long int)); +#endif spec->info.is_long = sizeof (uintmax_t) > sizeof (unsigned int); break; default: @@ -342,16 +348,19 @@ parse_one_spec (const UCHAR_T *format, size_t posn, struct printf_spec *spec, case L'o': case L'X': case L'x': - if (spec->info.is_longlong) +#if LONG_MAX != LONG_LONG_MAX + if (spec->info.is_long_double) spec->data_arg_type = PA_INT|PA_FLAG_LONG_LONG; - else if (spec->info.is_long) - spec->data_arg_type = PA_INT|PA_FLAG_LONG; - else if (spec->info.is_short) - spec->data_arg_type = PA_INT|PA_FLAG_SHORT; - else if (spec->info.is_char) - spec->data_arg_type = PA_CHAR; else - spec->data_arg_type = PA_INT; +#endif + if (spec->info.is_long) + spec->data_arg_type = PA_INT|PA_FLAG_LONG; + else if (spec->info.is_short) + spec->data_arg_type = PA_INT|PA_FLAG_SHORT; + else if (spec->info.is_char) + spec->data_arg_type = PA_CHAR; + else + spec->data_arg_type = PA_INT; break; case L'e': case L'E': -- cgit v1.2.3